Uploads
Send the photos, videos and voice recordings a tool works on.
A tool never takes a file in its own request. You upload the file first and pass its upload_id.
POST /uploads
{ "type": "image", "mime_type": "image/png", "size_bytes": 1048576 }
| Field | ||
|---|---|---|
type | required | image, video or audio |
mime_type | required | Image: image/jpeg, image/png, image/webp. Video: video/mp4, video/webm, video/quicktime. Audio: audio/mpeg, audio/wav, audio/mp4, audio/aac, audio/ogg, audio/flac |
size_bytes | required | The file's exact size |
filename | optional | The file's own name (for example IMG_2045.jpg), shown back to you in PicVid |
Response 201:
{
"upload": {
"id": "9f1c2b7e-…",
"upload_url": "https://…",
"method": "PUT",
"headers": { "Content-Type": "image/png" },
"expires_in_seconds": 300
}
}
Then send the bytes - with the Content-Type shown in headers - before the link expires:
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/png" --data-binary @photo.png
Use upload.id as the tool's …_upload_id field. If you start a job before the file is uploaded, you get 409 UPLOAD_NOT_FINISHED.
Sizes
- Pictures up to 10 MB.
- Videos up to the account plan's upload limit (see Credits and plans).
- A file bigger than allowed gets
400 FILE_TOO_LARGEwithmax_bytes.
An upload that no job uses is deleted after a while. Uploads are private to the account.
Still need help? Contact support