Media
Upload files once and send them as often as you like.
Endpoints
List files
https://api.saei.automize.sa/v1/media- Scope:
media:read - Works in test mode
Query parameters
limitintegeroptionalHow many objects to return, 1 to 100.
cursorstringoptionalThe
next_cursorfrom the previous page.typestringoptionalOne of
imagevideoaudiodocumentsticker
Response fields200· A page of files.
object"list"requireddataarray<Media>requiredChild fields (8)
idstringrequiredobject"media"requiredtypestringrequiredOne of
imagevideoaudiodocumentstickerfilenamestring | nulloptionalmime_typestring | nulloptionalsize_bytesintegerrequiredurlstringrequiredA permanent, public, unguessable link. Anyone with it can open the file.
created_atstring | nulloptional
has_morebooleanrequirednext_cursorstring | nullrequired
Errors this can return2
- 422parameter_invalidInvalid parameter
- 429rate_limitedToo many requests
Try it
curl -X GET https://api.saei.automize.sa/v1/media \
-H "Authorization: Bearer $API_KEY"A page of files.
{
"object": "list",
"data": [
{
"id": "med_381",
"object": "media",
"type": "image",
"filename": "string",
"mime_type": "string",
"size_bytes": 0,
"url": "string",
"created_at": "2026-10-01T09:30:00Z"
}
],
"has_more": false,
"next_cursor": "string"
}Upload a file
https://api.saei.automize.sa/v1/media- Scope:
media:write - Works in test mode
- Accepts Idempotency-Key
Adds a file to the workspace media library and gives it a permanent public URL. Send its id as the media_id of an image, video, audio, document or sticker message, as often as you like.
Send the file as multipart/form-data with the type it will be sent as. WhatsApp's limits are checked here, before anything is sent: images JPEG/PNG up to 5 MB, video MP4/3GPP up to 16 MB, audio up to 16 MB, documents up to 100 MB, stickers WebP up to 100 KB (500 KB animated).
Headers
Idempotency-KeystringoptionalAny unique string (a UUID is ideal). Retrying with the same key and body returns the first response instead of acting twice. Remembered for 24 hours.
Request body
filestringrequiredtypestringrequiredOne of
imagevideoaudiodocumentsticker
Response fields201· Uploaded.
idstringrequiredobject"media"requiredtypestringrequiredOne of
imagevideoaudiodocumentstickerfilenamestring | nulloptionalmime_typestring | nulloptionalsize_bytesintegerrequiredurlstringrequiredA permanent, public, unguessable link. Anyone with it can open the file.
created_atstring | nulloptional
Errors this can return6
- 402quota_exceededAllowance used up
- 422parameter_missingMissing parameter
- 422parameter_invalidInvalid parameter
- 413payload_too_largeBody too large
- 422media_invalidFile not accepted
- 429rate_limitedToo many requests
Try it
curl -X POST https://api.saei.automize.sa/v1/media \
-H "Authorization: Bearer $API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F "file=@photo.jpg" \
-F "type=image"Uploaded.
{
"id": "med_381",
"object": "media",
"type": "image",
"filename": "shoe-front.png",
"mime_type": "image/png",
"size_bytes": 482113,
"url": "https://api.example.com/media/3f9a0c1b2d4e5f60718293a4b5c6d7e8f9012345/shoe-front.png",
"created_at": "2026-10-01T09:00:00Z"
}Get a file
https://api.saei.automize.sa/v1/media/{id}- Scope:
media:read - Works in test mode
Path parameters
idstringrequiredThe object's id.
Response fields200· The file's details and public URL.
idstringrequiredobject"media"requiredtypestringrequiredOne of
imagevideoaudiodocumentstickerfilenamestring | nulloptionalmime_typestring | nulloptionalsize_bytesintegerrequiredurlstringrequiredA permanent, public, unguessable link. Anyone with it can open the file.
created_atstring | nulloptional
Errors this can return2
- 404resource_missingNot found
- 429rate_limitedToo many requests
Try it
curl -X GET https://api.saei.automize.sa/v1/media/med_381 \
-H "Authorization: Bearer $API_KEY"The file's details and public URL.
{
"id": "med_381",
"object": "media",
"type": "image",
"filename": "string",
"mime_type": "string",
"size_bytes": 0,
"url": "string",
"created_at": "2026-10-01T09:30:00Z"
}Delete a file
https://api.saei.automize.sa/v1/media/{id}- Scope:
media:write - Live keys only
Deletes the file and its public URL at once. If saved messages or templates still use it, the answer is resource_in_use listing them; add ?force=true to delete anyway. Needs a live key, because the library is your live one.
Path parameters
idstringrequiredThe object's id.
Query parameters
forcebooleanoptional
Response fields200· Deleted.
idstringrequiredobjectstringrequireddeletedtruerequired
Errors this can return4
- 403test_mode_unsupportedNot in test mode
- 404resource_missingNot found
- 409resource_in_useStill in use
- 429rate_limitedToo many requests
Try it
curl -X DELETE https://api.saei.automize.sa/v1/media/med_381 \
-H "Authorization: Bearer $API_KEY"Deleted.
{
"id": "med_381",
"object": "media",
"deleted": true
}