v1

latestOpenAPI 3.0.32026-07-26172157253.6 KB
Client

Get Upload Strategy (Direct or Presigned URL)

Returns upload strategy based on storage backend (S3 returns presigned URLs, local returns direct upload endpoints).

The filename is used verbatim as the object key. Uploading to an existing key replaces the current object in place. To upload with a server-generated unique key instead, use POST /api/storage/buckets/{bucketName}/objects. End-user creates and replacements are gated by the storage.objects row-level-security policies.

post/api/storage/buckets/{bucketName}/upload-strategy

Path parameters

bucketNamestring required

Request body

filenamestring required

Object key to upload to (used verbatim)

contentTypestring

MIME type of the file

sizeinteger

File size in bytes

Example request

{
  "filename": "profile-photo.jpg",
  "contentType": "image/jpeg",
  "size": 102400
}

Response

Upload strategy details

method'presigned' | 'direct' required

Upload method - presigned for S3, direct for local storage

uploadUrlstring required

URL to upload the file to

fieldsobject

Form fields for presigned POST (S3 only)

keystring required

Final logical object key (the filename, used verbatim).

confirmRequiredboolean required

Whether upload confirmation is required

confirmUrlstring

URL to confirm the upload (if confirmRequired is true)

expiresAtstring date-time

Expiration time for presigned URL (S3 only)

Example response

{
  "method": "presigned",
  "uploadUrl": "https://s3-bucket.amazonaws.com/",
  "fields": {
    "bucket": "my-s3-bucket",
    "key": "app-key/avatars/profile.jpg",
    "X-Amz-Algorithm": "AWS4-HMAC-SHA256"
  },
  "key": "profile-photo.jpg",
  "confirmRequired": true,
  "confirmUrl": "/api/storage/buckets/avatars/objects/profile.jpg/confirm-upload",
  "expiresAt": "2025-09-05T01:00:00Z"
}