Skip to main content
POST
Send a WhatsApp template message

Authorizations

Authorization
string
header
required

API key from your account settings

Path Parameters

agentId
string
required

The agent ID

Minimum string length: 1
Example:

"5QHA6VB-DIAbBhxwqxfdi"

Body

application/json
to
string
required

Recipient phone number in international format (digits with country code, + and separators are tolerated). The phone number is the recipient identity: no user ID is needed — a Chatbase user is automatically resolved or created from this number (matching an existing contact with the same phone when one exists), and replies continue in that user’s conversation.

Minimum string length: 1
Example:

"14155552671"

template
object
required
from
string

Which of the agent’s connected WhatsApp business numbers to send from, in international format. Formatting is ignored when matching, so +1 415-555-2671 and 14155552671 are equivalent. Optional when the agent has exactly one connected number.

Minimum string length: 1
Example:

"14155552671"

Response

The message was accepted by WhatsApp

messageId
string | null
required

WhatsApp message ID (wamid) of the sent message

conversationId
string | null
required

Chatbase conversation the recipient’s replies continue in. The message is also appended to that conversation, unless a human has taken it over or it has ended — in those cases only the WhatsApp delivery happens.

to
string
required

Canonical recipient WhatsApp ID the message was sent to