Overview
The Storage API provides bucket-based file storage similar to S3. Upload, download, and manage files with support for both local and S3-compatible storage backends.Headers
For authenticated function invocations:Upload Object with upload strategy
InsForge supports two types of storage backends:- Local Storage: Files are stored on the local filesystem. Use for development or low-volume production.
- S3-Compatible: Files are stored on S3-compatible object storage. Use for high-volume production.
- Get upload strategy
- Upload file
- Confirm upload (S3 only)
Step 1: Get Upload Strategy
Get the optimal upload strategy (direct or presigned URL) based on storage backend. The upload strategy API returns the optimal upload method based on the storage backend:- Local Storage: Direct upload to InsForge API
- S3-Compatible: Presigned URL for direct upload to S3
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Original filename |
contentType | string | No | MIME type of the file |
size | integer | No | File size in bytes |
Example
Response (S3 Backend)
Response (Local Storage)
Step 2: Upload File
Upload the file to the specified URL using the provided method.- Local Storage: Use a PUT request to
uploadUrlwithmultipart/form-dataand afilefield. - S3-Compatible: Use a POST request to
uploadUrlwithmultipart/form-dataand afilefield. Include all fields from thefieldsobject in the request.
Step 3: Confirm Presigned Upload (S3 Only)
Confirm that a file was successfully uploaded to S3 using presigned URL.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
size | integer | Yes | File size in bytes |
contentType | string | No | MIME type of the file |
etag | string | No | S3 ETag of the uploaded object |
Example
Response
Upload Object (Deprecated)
Upload a file to a bucket with a specific key.Path Parameters
| Parameter | Type | Description |
|---|---|---|
bucketName | string | Name of the bucket |
objectKey | string | Object key (can include / for pseudo-folders) |
Request Body
multipart/form-data with a file field.
Example
Response
Upload with Auto-Generated Key (Deprecated)
Upload a file with an auto-generated unique key.Example
Response
Download Object with download strategy
InsForge supports two types of storage backends:- Local Storage: Files are stored on the local filesystem. Use for development or low-volume production.
- S3-Compatible: Files are stored on S3-compatible object storage. Use for high-volume production.
- Get download strategy
- Download file from returned URL
Step 1: Get Download Strategy
Get the optimal download strategy (direct URL or presigned URL) based on storage backend and bucket visibility. The download strategy API returns the optimal download method based on the storage backend and bucket visibility:- Local Storage: Direct download from InsForge API
- S3-Compatible: Presigned URL for S3.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
expiresIn | integer | No | URL expiration in seconds (default: 3600) |
Example
Response (S3 Public Bucket)
Response (S3 Private Bucket)
Step 2: Download File
Download the file from the returned URL, using the appropriate method.Download Object (Deprecated)
Download a file from a bucket.Example
Response
Binary file content with appropriateContent-Type and Content-Length headers.
Delete Object
Delete a file from a bucket.Example
Response
List Objects in Bucket
List all objects in a bucket with optional filtering.Query Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Filter by key prefix (e.g., users/) |
search | string | Search objects by key (partial match) |
limit | integer | Maximum objects to return (1-1000, default: 100) |
offset | integer | Number of objects to skip |
Example
Response
Bucket Management (Admin)
List All Buckets
Example
Response
Create Bucket
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
bucketName | string | Yes | Bucket name (alphanumeric, underscore, hyphen) |
isPublic | boolean | No | Whether bucket is publicly accessible (default: true) |
Example
Response
Update Bucket
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
isPublic | boolean | Yes | Whether bucket is publicly accessible |