Skip to content
Wbiztool

Media API

Upload media API

Upload an image, document, audio or video file to your workspace's media library and get back a download URL. Pass that URL to Send message, or, for images only, to Create reminder as img_url, when you don't have your own file hosting.

POSThttps://wbiztool.com/api/v1/media/upload/

Body: multipart/form-data

The file is stored straight away and the response includes its file_url. Uploaded files also appear on the Media directory page in your dashboard.

Quick example#

curl -X POST https://wbiztool.com/api/v1/media/upload/ \
  -F client_id=12345 \
  -F api_key=YOUR_API_KEY \
  -F media_file=@./invoice-4821.pdf

Replace 12345 and YOUR_API_KEY with your own values. See Authentication for where to find them.

Request parameters#

Send the request as multipart/form-data. JSON bodies and query-string parameters aren't read by this endpoint.

client_idintegerrequired

Your API Client ID from Settings → API keys.

api_keystringrequired

Your API key from the same page.

media_filefilerequired

The file to upload, up to 64 MB. Its type is decided by the file name's extension, so the name must end in one of the supported extensions.

Supported file types#

CategoryExtensions
Images.jpg, .jpeg, .png, .gif
Documents.pdf, .doc, .xls, .ppt, .txt, .csv
Audio.mp3, .wav
Video.mp4, .mov
Archives.zip

Images are stored with file_type set to image; everything else is file.

Response#

A successful request returns HTTP 200:

{
  "status": 1,
  "message": "File uploaded successfully",
  "data": {
    "id": 5122,
    "file_name": "media_12345_17895804001234.pdf",
    "original_file_name": "invoice-4821.pdf",
    "file_url": "https://wbiztool-static.s3.ap-southeast-1.amazonaws.com/media/org_12345/media_12345_17895804001234.pdf",
    "file_type": "file",
    "file_size": 248312,
    "file_size_display": "242.5 KB",
    "mime_type": "application/pdf",
    "is_image": false,
    "file_extension": "pdf",
    "created_at": "2026-09-16T10:20:31.512934+00:00"
  }
}
FieldTypeDescription
statusinteger1 if the file was uploaded, 0 if the request failed.
messagestringFile uploaded successfully, otherwise the error.
data.idintegerID of the media file. Use it with Get media file.
data.file_namestringName the file is stored under, generated by Wbiztool.
data.original_file_namestringThe name of the file you uploaded.
data.file_urlstringDirect download URL. Use it as img_url or file_url when sending.
data.file_typestringimage or file.
data.file_sizeintegerSize in bytes.
data.file_size_displaystringReadable size with one decimal, for example 242.5 KB.
data.mime_typestringMIME type worked out from the extension, for example application/pdf.
data.is_imagebooleantrue when file_type is image.
data.file_extensionstringLower-case extension of original_file_name, without the dot.
data.created_atstringUpload time, ISO 8601 in UTC with a +00:00 offset.

Errors#

Errors also return HTTP 200, with status set to 0:

{ "status": 0, "message": "File is too large. Maximum size is 64MB. Your file: 71.3MB" }
MessageHow to fix it
Only POST method is supportedSend a POST request.
client_id is requiredAdd client_id as a form field. Check the body is multipart/form-data, not JSON.
api_key is requiredAdd api_key as a form field.
media_file is requiredSend the file in a field named media_file.
client_id must be a valid integerSend client_id as a number.
Invalid API keyCheck the key exists and hasn't been deleted or disabled.
Invalid client_id for this API keyThe key belongs to a different client_id.
File is too large. Maximum size is 64MB. Your file: …MBUpload a file of 64 MB or less.
File type not supported. Type detected: …Use one of the supported extensions.
Error uploading file: …The upload couldn't be completed. Try again. You also get this if the API key isn't linked to a workspace; create a new key in the workspace you want to use.

Upload and send#

Upload the file, then pass file_url to Send message: as img_url with msg_type 1 for images, or as file_url with msg_type 2 for other files.

Upload a PDF and send it
import requests

BASE = "https://wbiztool.com/api/v1"
AUTH = {"client_id": 12345, "api_key": "YOUR_API_KEY"}

with open("invoice-4821.pdf", "rb") as f:
    upload = requests.post(f"{BASE}/media/upload/", data=AUTH, files={"media_file": f}, timeout=120).json()
if upload["status"] != 1:
    raise SystemExit("Upload failed: " + upload["message"])

media = upload["data"]
message = {
    **AUTH,
    "whatsapp_client": 678,
    "country_code": "91",
    "phone": "9876543210",
    "msg": "Your invoice for order #4821 is attached.",
}
if media["is_image"]:
    message.update(msg_type=1, img_url=media["file_url"])
else:
    message.update(msg_type=2, file_url=media["file_url"], file_name=media["original_file_name"])

sent = requests.post(f"{BASE}/send_msg/", json=message, timeout=60).json()
print(sent)

Send message has its own list of file extensions. Of the types this API accepts, .doc, .ppt, .csv, .zip, .wav and .mov files sent with msg_type 2 are delivered with .pdf added to the name (for example brochure.doc.pdf). Convert documents to PDF before you send them. See Sending images and files. The name is also sent in lower case (Invoice-4821.PDF arrives as invoice-4821.pdf).

Images sent with msg_type 1 must be 16 MB or smaller. Larger images upload fine here but fail when sent, with File exceeds WhatsApp size limit (16MB max). Compress them first, or send them as a file with msg_type 2.

Tips#

  • Reuse uploads. Store the id or file_url and send the same file many times instead of uploading it again.
  • Keep the original name meaningful. original_file_name is what you see in the dashboard and a good value for file_name when sending.
  • Find earlier uploads with List media.