Skip to content

Send a message to a contact ​

POST /communicateSrvCloudAPI/message/v1/sendToContact

For the base URL, request headers and response codes, see the overview.

Send text, an image, a video or a file to a contact. The message goes out through the WhatsApp channel the contact belongs to.

Before you send

  • Messages are really delivered to your customers and cannot be recalled.
  • This endpoint sends regular messages, not WhatsApp template messages. Under WhatsApp's rules, regular messages are only delivered within 24 hours of the customer's last message to you.
  • Requests are not deduplicated by RequestID. Calling twice sends twice, so make sure retries in your system do not cause duplicate messages.

Request body ​

FieldTypeRequiredDescription
RequestIDStringYesA request identifier you generate. 8–48 characters; letters, digits, - and _
ContactIDStringYesThe contact's ChatBooster ID (a number, passed as a string)
TextStringDependsRequired for a text-only message. For media, it is used as the caption and may be empty
MediaURLStringNoA publicly accessible media URL. Leave empty to send text only
FileNameStringNoFile name, used to work out the file type and shown in the conversation
MimeTypeStringNoThe media's MIME type. Used when provided; otherwise the type is taken from the extension of FileName or the URL

Supported media types

TypeExtensions
Image.jpg .jpeg .png
Video.mp4 .3gp
File.pdf .doc .docx .xls .xlsx .ppt .pptx .txt

Other types (for example .gif, .webp, .zip) return 400 with the message unsupported media type.

Example requests ​

Text only:

bash
curl -X POST "https://api.chatbooster.ai/communicateSrvCloudAPI/message/v1/sendToContact" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "RequestID": "order-10086-shipped",
    "ContactID": "1234567890",
    "Text": "Your order has shipped."
  }'

Image with a caption:

bash
curl -X POST "https://api.chatbooster.ai/communicateSrvCloudAPI/message/v1/sendToContact" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "RequestID": "order-10086-receipt",
    "ContactID": "1234567890",
    "MediaURL": "https://example.com/receipt.jpg",
    "FileName": "receipt.jpg",
    "Text": "Here is your receipt."
  }'

Response ​

FieldTypeDescription
CodeInteger200 on success
MessageStringStatus message
Data.RequestIDStringThe RequestID from your request
Data.MessageIDStringID of the message that was sent
Data.ChannelIDStringID of the channel the message was sent through
json
{
  "Code": 200,
  "Message": "ok",
  "Data": {
    "RequestID": "order-10086-shipped",
    "MessageID": "wamid.HBgM...",
    "ChannelID": "channel-id"
  }
}

Errors

CodeCause
400ContactID is malformed, Text is missing on a text-only message, the media type is not supported, or the contact has no usable WhatsApp channel
401The API key is invalid, or the workspace plan does not include the Platform API
404The contact does not exist or does not belong to this workspace
500The message could not be sent; see Message for details