Skip to content
WbizTool

API v2 (beta)

Media

The Media directory holds your workspace's files: price lists, menus, brochures, product photos. Upload a file once, then send it as often as you like with "media": {"media_id": …} in a message or a reminder. It's the same directory as the Media directory page in the dashboard, so files uploaded there are listed here too.

OperationEndpointScope
Upload a filePOST /api/v2/mediamedia
List filesGET /api/v2/mediamedia
Get a fileGET /api/v2/media/{id}media
Delete a fileDELETE /api/v2/media/{id}media

Upload a file#

POSThttps://wbiztool.com/api/v2/media

Body: multipart/form-data

Send one file per request as multipart/form-data, in the field file. This is the one v2 endpoint that doesn't take JSON. The answer is 201 with the Media object.

  • Up to 64 MB per file.
  • Types: the type comes from the extension at the end of the file name, so keep it.
KindExtensions
Images.jpg, .jpeg, .jpe, .png, .gif, .webp, .bmp
Documents.pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .csv, .txt
Audio.mp3, .m4a, .wav, .ogg, .oga, .aac
Video.mp4, .mov, .avi
Archives.zip, .rar
  • Storage: all the workspace's files together can take up what its plan allows, from 250 MB to 10 GB (see Storage per plan). A file that doesn't fit is refused with storage_full.
  • An image file (type image) is sent as an image by default; anything else as a file.
  • Send an Idempotency-Key so a retry after a timeout doesn't store the file twice.
curl -X POST https://wbiztool.com/api/v2/media \
  -H "Authorization: Bearer $WBIZTOOL_API_KEY" \
  -H "Idempotency-Key: price-list-2026-10" \
  -F "file=@./price list.pdf"

Answer (201):

{
  "id": 3301,
  "name": "price list.pdf",
  "type": "file",
  "mime_type": "application/pdf",
  "size": 182344,
  "url": "https://media.wbiztool.com/media/org_5012/media_5012_17608123450000_0.pdf",
  "created_at": "2026-10-18T10:31:40.120Z"
}

Then send it:

{
  "to": { "phone": "+919876543210" },
  "text": "Here is our new price list.",
  "media": { "media_id": 3301 }
}

The recipient sees the name it was uploaded with (price list.pdf); set media.file_name in the message to show another.

Errors when uploading#

HTTPCodeWhen
400validation_failedNo file in the field file, or more than one
413file_too_largeThe file is over 64 MB
415unsupported_file_typeThe extension isn't one of the types above
415unsupported_content_typeThe request isn't multipart/form-data (JSON, say)
422storage_fullThe file doesn't fit in the plan's storage; used and limit say how much, in bytes
502upload_failedThe file couldn't be stored. Try again (with the same Idempotency-Key)

List files#

GEThttps://wbiztool.com/api/v2/media

The workspace's files, newest first, in pages (limit 1 to 100, default 25, and cursor).

curl "https://wbiztool.com/api/v2/media?limit=100" \
  -H "Authorization: Bearer $WBIZTOOL_API_KEY"

The answer is {"data": [Media, …], "next_cursor": "…" or null}.

Get a file#

GEThttps://wbiztool.com/api/v2/media/{id}
curl https://wbiztool.com/api/v2/media/3301 \
  -H "Authorization: Bearer $WBIZTOOL_API_KEY"

A file that doesn't exist or was deleted answers 404 media_not_found.

Delete a file#

DELETEhttps://wbiztool.com/api/v2/media/{id}

Deletes the file from the Media directory and from storage, so its url stops working. Messages already sent keep their copy on the recipient's phone.

It's refused while something will still send the file: a message that's waiting to go out (including a campaign's), an active reminder, or an active Google Sheets trigger. The answer is then 409 media_in_use, and count says how many. Cancel or change those first, or wait until the messages have gone out.

curl -X DELETE https://wbiztool.com/api/v2/media/3301 \
  -H "Authorization: Bearer $WBIZTOOL_API_KEY"
{ "id": 3301, "deleted": true }
HTTPCodeWhen
404media_not_foundNo such file
409media_in_useA waiting message, an active reminder or a Google Sheets trigger still uses it

The Media object#

FieldTypeDescription
idintegerThe file's id: the media_id to send it with.
namestringThe name it was uploaded with.
typestringimage for image files, file for everything else.
mime_typestringSuch as application/pdf or image/jpeg.
sizeintegerSize in bytes.
urlstringA public link to the file. Anyone with the link can open it, so don't upload files that must stay private.
created_atstringWhen it was uploaded.