Upload a file to project storage. The file is saved using a path structure defined by pathParts. The filename is sanitized using transliteration.
Must be multipart/form-data
Body Parameters (multipart/form-data)
The file to upload. Must not exceed 15MB.
A JSON stringified array of folder path segments (e.g., ["profile", "images"])
Response
Unique identifier for the uploaded file
Relative path to the file (e.g., “profile/images/photo.jpg”)
Public URL to access the file
Error Responses
Missing File - 400 Bad Request
{
"error": "No file provided",
"code": "storage/no-file"
}
Invalid Path Parts - 400 Bad Request
{
"error": "pathParts must be an array of strings",
"code": "storage/invalid-path-parts"
}
File Too Large - 413 Payload Too Large
{
"error": "File size exceeds the allowed limit of 15MB",
"code": "storage/file-too-large"
}
Server Error - 500 Internal Server Error
{
"error": "Internal server error",
"code": "storage/server-error",
"details": "<Error message>"
}
Notes
- Requires authentication
- The uploaded file is stored at the location specified by
pathParts, with the filename sanitized
- Returns a public URL to access the file
- Maximum file size: 15MB
- Content-Type must be
multipart/form-data
- Rate limiting: 50 requests per 5 minutes