POST
/
api
/
storage
/
buckets
/
{bucketName}
/
upload-strategy
{
"method": "presigned",
"uploadUrl": "https://s3-bucket.amazonaws.com/",
"fields": {
"bucket": "my-s3-bucket",
"key": "app-key/avatars/profile-photo-1234567890-abc123.jpg",
"X-Amz-Algorithm": "AWS4-HMAC-SHA256",
"X-Amz-Credential": "AKIA.../20250905/us-east-2/s3/aws4_request",
"X-Amz-Date": "20250905T000000Z",
"Policy": "eyJ...",
"X-Amz-Signature": "abc123..."
},
"key": "profile-photo-1234567890-abc123.jpg",
"confirmRequired": true,
"confirmUrl": "/api/storage/buckets/avatars/objects/profile-photo-1234567890-abc123.jpg/confirm-upload",
"expiresAt": "2025-09-05T01:00:00Z"
}

Authorizations

x-api-key
string
header
required

Path Parameters

bucketName
string
required

Body

application/json
filename
string
required

Original filename for generating unique key

Example:

"profile-photo.jpg"

contentType
string

MIME type of the file

Example:

"image/jpeg"

size
integer

File size in bytes

Example:

102400

Response

Upload strategy details

method
enum<string>
required

Upload method - presigned for S3, direct for local storage

Available options:
presigned,
direct
Example:

"presigned"

uploadUrl
string
required

URL to upload the file to

Example:

"https://s3-bucket.amazonaws.com/"

key
string
required

Generated unique key for the file

Example:

"profile-photo-1234567890-abc123.jpg"

confirmRequired
boolean
required

Whether upload confirmation is required

Example:

true

fields
object

Form fields for presigned POST (S3 only)

Example:
{
"bucket": "my-s3-bucket",
"key": "app-key/avatars/profile.jpg",
"X-Amz-Algorithm": "AWS4-HMAC-SHA256"
}
confirmUrl
string

URL to confirm the upload (if confirmRequired is true)

Example:

"/api/storage/buckets/avatars/objects/profile.jpg/confirm-upload"

expiresAt
string<date-time>

Expiration time for presigned URL (S3 only)

Example:

"2025-09-05T01:00:00Z"