ChumiAI Docs
Send single and bulk WhatsApp messages using pre-approved templates via the ChumiAI API.
Prerequisite
You must create and get approval for your WhatsApp templates in your ChumiAI account dashboard before you can send them via the API. Templates created directly in Meta Business Suite must be synced to ChumiAI first.
Use this endpoint to send a template message to a single recipient.
/api/v1/whatsapp/send-templateX-API-Keyheader required| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number in international format (e.g., 233244123456). |
templateName | string | Yes | The exact name of the approved template in ChumiAI. |
languageCode | string | No | Language code (default: en_US). |
templateParameters | array | No | List of parameters to fill in the template placeholders (e.g., {{1}}, {{2}}). |
headerMediaId | string | No | WhatsApp Media ID for templates with media headers. |
headerMediaUrl | string | No | Public URL of the media for templates with media headers. |
curl -X POST "https://api.chumiai.app/api/v1/whatsapp/send-template" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "233244123456",
"templateName": "welcome_message",
"languageCode": "en_US",
"templateParameters": [
{ "text": "John" },
{ "text": "CHUMI-2024" }
]
}'Send messages to multiple recipients by uploading a file. This creates an asynchronous background job.
/api/v1/whatsapp/bulk-import-messagesX-API-Keymultipart/form-data| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Excel (.xlsx, .xls) or CSV file containing recipient data. |
templateName | string | Yes | The name of the template to use. |
languageCode | string | No | Language code (default: en_US). |
File Format
curl -X POST "https://api.chumiai.app/api/v1/whatsapp/bulk-import-messages" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@recipients.xlsx" \
-F "templateName=promotion_broadcast" \
-F "languageCode=en_US"Send a template to all contacts in a specific ChumiAI contact group.
/api/v1/whatsapp/send-template-to-groupX-API-Keyheader required| Field | Type | Required | Description |
|---|---|---|---|
groupId | string (GUID) | Yes | The ID of the contact group. |
templateName | string | Yes | The name of the template. |
languageCode | string | No | Language code (default: en_US). |
parameterDefaults | object | No | Default values for parameters (e.g., {"1": "Customer"}). |
curl -X POST "https://api.chumiai.app/api/v1/whatsapp/send-template-to-group" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"groupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"templateName": "monthly_newsletter",
"parameterDefaults": {
"1": "Valued Member"
}
}'Since bulk operations run in the background, use these endpoints to check progress.
Get Job Status
/api/v1/whatsapp/bulk-jobs/{jobId}/statusGet Job History
/api/v1/whatsapp/bulk-jobs?page=1&pageSize=20{
"jobId": "...",
"status": "Processing",
"totalRecipients": 500,
"successfullySent": 120,
"failed": 2,
"progressPercentage": 24.4
}500
Total
120
Sent
2
Failed
24.4%
Progress