Skip to content

Media

View as Markdown

Upload files once and send them as often as you like.

Endpoints

List files

gethttps://api.saei.automize.sa/v1/media
  • Scope: media:read
  • Works in test mode

Query parameters

  • limitintegeroptional

    How many objects to return, 1 to 100.

  • cursorstringoptional

    The next_cursor from the previous page.

  • typestringoptional

    One ofimagevideoaudiodocumentsticker

Response fields200
  • object"list"required
  • dataarray<Media>required
    Child fields (8)
    • idstringrequired
    • object"media"required
    • typestringrequired

      One ofimagevideoaudiodocumentsticker

    • filenamestring | nulloptional
    • mime_typestring | nulloptional
    • size_bytesintegerrequired
    • urlstringrequired

      A permanent, public, unguessable link. Anyone with it can open the file.

    • created_atstring | nulloptional
  • has_morebooleanrequired
  • next_cursorstring | nullrequired
Errors this can return2
Try it
curl -X GET https://api.saei.automize.sa/v1/media \
  -H "Authorization: Bearer $API_KEY"
Response

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

posthttps://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-Keystringoptional

    Any 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

  • filestringrequired
  • typestringrequired

    One ofimagevideoaudiodocumentsticker

Response fields201
  • idstringrequired
  • object"media"required
  • typestringrequired

    One ofimagevideoaudiodocumentsticker

  • filenamestring | nulloptional
  • mime_typestring | nulloptional
  • size_bytesintegerrequired
  • urlstringrequired

    A permanent, public, unguessable link. Anyone with it can open the file.

  • created_atstring | nulloptional
Errors this can return6
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"
Response

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

gethttps://api.saei.automize.sa/v1/media/{id}
  • Scope: media:read
  • Works in test mode

Path parameters

  • idstringrequired

    The object's id.

Response fields200
  • idstringrequired
  • object"media"required
  • typestringrequired

    One ofimagevideoaudiodocumentsticker

  • filenamestring | nulloptional
  • mime_typestring | nulloptional
  • size_bytesintegerrequired
  • urlstringrequired

    A permanent, public, unguessable link. Anyone with it can open the file.

  • created_atstring | nulloptional
Errors this can return2
Try it
curl -X GET https://api.saei.automize.sa/v1/media/med_381 \
  -H "Authorization: Bearer $API_KEY"
Response

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

deletehttps://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

  • idstringrequired

    The object's id.

Query parameters

  • forcebooleanoptional
Response fields200
  • idstringrequired
  • objectstringrequired
  • deletedtruerequired
Errors this can return4
Try it
curl -X DELETE https://api.saei.automize.sa/v1/media/med_381 \
  -H "Authorization: Bearer $API_KEY"
Response

Deleted.

{
  "id": "med_381",
  "object": "media",
  "deleted": true
}