Sending
Send a message
https://api.batzap.com/v1/send-messageSends a WhatsApp message to a person or group and records it in the inbox. Supports text, image, video, audio and voice notes, documents, contact cards, polls, replies and @mentions.
Pick one content type per request. Precedence when several are sent: image, video, document, audio, contacts, poll, text.
Media can be sent inline as base64, or uploaded first with Upload media and referenced by s3_key (recommended above a few MB). Limit: 20 MB.
If to is a Crisp conversation id, the reply goes out through Crisp instead.
On failure the body carries error and an error_code: WHATSAPP_DISCONNECTED, TIMEOUT, RATE_LIMITED, INVALID_RECIPIENT or SEND_FAILED.
- Scope
- messages:send
- Rate limit
- Send · 10/min, 300/day
Body parameters
tostringrequiredRecipient: a phone number in E.164 (+5511987654321), a group JID (...@g.us) or a conversation id.
integration_iduuidoptionalWhatsApp number to act from (see List integrations). Filled in automatically when the key is restricted to a single number.
messagestringoptionalText, or the caption of an image, document or audio.
imagestring (base64)optionalImage to send.
videostring (base64)optionalVideo to send. Requires mimetype.
documentstring (base64)optionalFile to send. Requires mimetype and filename.
audiostring (base64)optionalAudio to send. Set ptt: true to deliver it as a voice note.
s3_keystringoptionalMedia uploaded with Upload media, instead of base64. The type comes from mimetype.
mimetypestringoptionalMedia type. Video: video/mp4, video/webm, video/quicktime. Documents: PDF, CSV, Word, Excel, PowerPoint, plain text, subtitles.
filenamestringoptionalFile name shown for a document.
pttbooleanoptionalSend audio as a voice note.
quoted_message_idstringoptional_id of the message to reply to. If it is not found, the message goes out without the quote.
mentionsstring[]optionalGroups only. Phone numbers to @mention; each must also appear as @<number> in message.
contactsobjectoptionalContact card: { displayName?, contacts: [{ name, phones: [{ number, type? }] }] }.
pollobjectoptionalPoll: { name, values: [2 to 12 options], selectableCount? }. selectableCount 0 allows any number of choices.
sender_namestringoptionalAuthor shown for this message in the inbox.
Errors
400to or content, unsupported media type, file over 20 MB, or the number has no WhatsApp.402BILLING_ACCESS_DENIED The organization's subscription is inactive.404428WHATSAPP_DISCONNECTED The sending number is disconnected or reconnecting.503NO_SERVER_REASSIGNED The number is being moved between servers. Retry in a few seconds.Plus the errors every route can return: see Errors.
