Skip to content

Send Messages

All messages are sent through the main endpoint:

POST https://messaging.cpaas.id/v1/{phone_number_id}/messages

Replace {phone_number_id} with your WhatsApp Business phone number ID (obtained from the cpaas.id page Channels).

Every request must include the header Authorization with a Bearer token:

Authorization: Bearer YOUR_API_KEY
ParametersTypeRequiredDescription
messaging_productstringYesAlways "whatsapp"
tostringYesRecipient phone number in E.164 format (without +)
typestringYesMessage type: text, image, document, template, interactive, location, contact, audio, video, sticker, reaction
custom_propertiesobjectNoCustom metadata returned in the webhook, but not sent to the provider

All message types return the same response:

{
"messaging_product": "whatsapp",
"messages": [
{
"id": "msg_f7a816e2-8397-11f0-8e34-010203040506"
}
]
}

Save id from the response to track the message status via the webhook.

Once the message is sent, you will receive a webhook for each status change. See the page Webhook for full details.

TheDescription
message.status.sentMessage successfully sent to the network
message.status.deliveredMessage delivered to the recipient’s device
message.status.readMessage read by the recipient
message.status.failedMessage failed to send