Skip to Content
aiMermaid
APIReference

Finish a binary upload (step 3 of 3)

Also available in Swagger.

This calls the live API and changes your real projects.
POST
/v1/projects/{id}/attachments/{upload_id}/complete

Checks the bytes that arrived at the upload link: real type (a PNG must really be a PNG), size, project and account limits. On success the upload is ready and can be attached. On any failure the stored file is deleted (upload_deleted: true) and you start again. Calling it again on a ready upload returns the same answer. Credits: 5.

Authorization

bearer
headerAuthorizationBearer <token>

An API key: amk_live__. A key can have an expiry date chosen when it is created (1 hour to 90 days, or none). After that moment the API answers 401 unauthorized, as for a revoked key. Create a new key or rotate the expired one (rotation keeps the same lifetime). A key can also be limited to one folder (with its subfolders) or one project: anything else answers 404 not_found, and a project key cannot create projects or use folders (403 insufficient_scope). A folder key creates projects and folders inside its folder. If that folder or project is deleted for good, the key answers 403 target_gone.

Path Parameters

id*string
Formatuuid
upload_id*string

The upload_id from POST /v1/projects/{id}/attachments.

Formatuuid

Response Body

Checked and ready

application/json
  1. response
Example Request
curl -X POST 'https://pltlaavsvbpebaopfbsp.supabase.co/functions/v1/api/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/attachments/497f6eca-6276-4993-bfeb-53cbbbba6f08/complete'
Example Response
{  "upload_id": "8d0e7c52-1f3a-4b6d-9e2c-7a5b4c3d2e1f",  "status": "ready",  "name": "call.mp3",  "kind": "audio",  "size": 2483112,  "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",  "next": [    "POST /v1/projects/3f6c1e2a-9b7d-4c1e-8a2f-5d6e7f8a9b0c/batch with {\"ops\":[{\"op\":\"add_attachment\",\"to\":\"<step or group id>\",\"upload_id\":\"8d0e7c52-1f3a-4b6d-9e2c-7a5b4c3d2e1f\"}]}. Unattached uploads are deleted after 24 hours."  ]}