FeaturesStorageUploading Files

Upload Files

REST endpoint

POST /api/v1/projects/{slug}/storage/upload

Headers:

Authorization: Bearer {accessToken}
Content-Type: multipart/form-data

Form fields:

FieldTypeRequiredDescription
fileFileYesThe file to upload
pathstringNoCustom storage path (default: {uuid}.{ext})
contentTypestringNoOverride MIME type
publicbooleanNoMake publicly accessible (default: true)

Response:

{
  "url": "https://cdn.aerostack.ai/projects/{slug}/{path}",
  "key": "projects/{slug}/{path}",
  "size": 204800,
  "contentType": "image/jpeg",
  "createdAt": "2026-03-04T12:00:00Z"
}

Errors

StatusErrorDescription
400MISSING_FILENo file provided in form data
400FILE_TOO_LARGEFile exceeds 100 MB limit
401UNAUTHORIZEDMissing or invalid token
413Request body too large

The upload endpoint requires authentication. Ensure your AerostackProvider is configured with a valid apiKey, or pass a user accessToken in the Authorization header.