File Upload
1 API call in this section.
Upload File to Storage
Platform & Access / File Upload
POST
/upload-fileUploads a file to Supabase Storage and returns information about the uploaded file including its public URL.
Path within the bucket (subfolder)
Business Rules
Content-Type must be 'multipart/form-data'
The file field is required and must be a valid file
The bucket must exist in Supabase Storage
Filename is automatically generated with timestamp prefix to avoid conflicts
Query parameters
| Parameter | Type | Description |
|---|---|---|
languageOptional | string | Language code for response localization (Optional, default: en) Language code for localized response messages (optional, default: en) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
fileRequired | file | The file to upload Example: |
bucketRequired | text | Storage bucket name (defaults to 'public') Example: |
path | text | Path within the bucket (subfolder) Example: |
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/upload-file?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --form 'file=@/path/to/file.jpg' \4 --form-string 'bucket=public' \5 --form-string 'path=uploads'Response examples
200OK
Response body
json
1{2 "success": true,3 "message": "File uploaded successfully",4 "data": {5 "path": "uploads/1625097600000-example.jpg",6 "fullPath": "public/uploads/1625097600000-example.jpg",7 "publicUrl": "https://example.supabase.co/storage/v1/object/public/public/uploads/1625097600000-example.jpg",8 "fileName": "1625097600000-example.jpg",9 "originalName": "example.jpg",10 "contentType": "image/jpeg",11 "size": 10240012 }13}