Files API
Upload files for file-typed fields.
Upload a file
There is one file endpoint. It uploads a file to storage and returns an asset object you can store in a file-typed field.
POST /api/v1/upload
Content-Type: multipart/form-data
Form fields:
file: the file binary (required)project_slug: slug of the project the file belongs to (required)schema_slug: slug of the schema this file is for (optional, used for organization and field-type validation)field_slug: slug of the field this file fills (optional; when set withschema_slug, the upload is checked against the field'sacceptlist)
Returns:
{
"success": true,
"asset": {
"type": "asset",
"url": "https://...supabase.co/storage/v1/object/public/...goblin.png",
"path": "<project-id>/enemy/1716900000000/goblin.png",
"filename": "goblin.png",
"mimeType": "image/png",
"size": 12345
}
}
Store the returned asset object (or at least its url) as the value of a file-typed field when you create or update a record.
Note: There is no separate endpoint to list, fetch metadata for, or delete uploaded files. Files live in storage and are referenced from record data by URL. To remove a file, delete the record (or clear the field) that references it.
Limits
| Tier | Total storage |
|---|---|
| Free | 100 MB |
| Pro | 10 GB |
| Enterprise | 25 GB |
The per-file maximum is 500 MB on every tier. Uploads are also validated by magic bytes, so the file contents must match the declared MIME type.
