Skip to main content

POST /api/storage/upload

Uploads a file using a multipart/form-data request and returns a public CDN URL. Save the path field from the response — you need it to delete the file later.

Required Header

x-api-key: your pk_live_… or sk_live_… key.
Do not set the Content-Type header manually when uploading files. When you pass a FormData object, the browser (or HTTP client) automatically sets the correct multipart/form-data boundary. Setting it manually will break the upload.

Request Body

Send the request as multipart/form-data with a single field:
file
required
The file to upload. Accepted as a binary file input (e.g., from an <input type="file"> element or a file buffer in Node.js).

Response Fields

string
Human-readable confirmation (e.g., "File uploaded successfully").
string
The public CDN URL where the file can be accessed. All uploaded files are publicly accessible — do not upload sensitive or private documents.
string
The internal storage path in the format PROJECT_ID/filename.ext. Save this value — you must provide it when deleting the file.
string
The storage backend used (e.g., "internal").

File Limits

Code Examples

Success Response

Errors