Skip to main content

Send WABA Message

Send a message via WhatsApp Business API (WABA). You can send either a template message (for starting a conversation or after the 24-hour window) or a session message (plain text within an active conversation).

info

Requires a WABA channel connected to your 2Chat account. Get template UUIDs from the Get WABA Templates endpoint.

Request body (common fields)

FieldDescriptionRequired
to_numberRecipient number in E.164 format (e.g. +595981048477).Yes
from_numberYour WABA number in E.164 format (e.g. +5215512345432).Yes

For template messages, also send:

FieldDescriptionRequired
template_uuidTemplate UUID from Get WABA Templates.Yes
paramsTemplate variable values. Required for template messages; use an empty object {} (or e.g. {"body": []}) if the template has no variables.Yes
params.bodyArray of strings replacing {{1}}, {{2}}, … in the template body.If template has body variables
params.headerHeader variable (if template has a text header variable).If applicable
params.buttonsButton payloads (e.g. for dynamic URL or OTP).If applicable

For session messages (within 24-hour window), send:

FieldDescriptionRequired
textPlain text message.Yes
caution

You must send either a template message (template_uuid and params; params is required even if empty) or a session message (text), not both in the same request.


Send a template message

Use when starting a conversation or when the 24-hour session has expired. Replace template placeholders with values in params.body (and optionally params.header or params.buttons).

curl --request POST \
--url 'https://api.p.2chat.io/open/waba/send-message' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"to_number": "+595981048477",
"from_number": "+5215512345432",
"template_uuid": "TMP1b44a079-c75c-4403-bc8f-a75c4ce5cd23",
"params": {
"body": ["Maria", "TRK-98452"]
}
}'

Send a session message

Use when replying within the 24-hour customer session. Send only text (no template_uuid or params).

curl --request POST \
--url 'https://api.p.2chat.io/open/waba/send-message' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"to_number": "+595981048477",
"from_number": "+5215512345432",
"text": "Hi, how can we help you today?"
}'

Response

Example success response:

{
"success": true,
"batched": true,
"message_uuid": "MSG126d9055-9dad-415f-b934-ff909773a8ef"
}
FieldDescription
successtrue when the message was accepted
batchedtrue when the message was successfully queued for sending
message_uuidInternal UUID of the message for tracking

Errors return an appropriate HTTP status and a JSON body with error details.