Quick Start: API & Webhook
Before you start
Section titled “Before you start”- Your account has permission to manage API keys and webhooks in the Developer menu.
- At least one WhatsApp sender, RCS agent, or SMS sender is active on your account.
-
Open the API Keys page
In the left sidebar, click Developer › API Keys (
/developer/api-keys), then click Generate New Key. -
Create and save your API key
In the Generate New API Key dialog, enter a Key Name, click Generate Key, copy the key displayed in the New API Key Generated dialog, and click Done.
-
Open the Webhooks page
Go to Developer › Webhooks (
/developer/webhooks) and click Add Endpoint. -
Register a status webhook endpoint
In the Add Webhook Endpoint dialog, enter your server’s HTTPS URL in Endpoint URL, select the delivery status events (
message.status.sent,message.status.delivered,message.status.read,message.status.failed) under Events to deliver, and click Add Endpoint. -
Save your webhook signing secret
Copy the value shown under Your Secret in the Webhook Created Successfully dialog to verify HMAC payload signatures, then click I have saved my secret.
-
Send your first message with
curlRun the command below in your terminal, replacing
$API_KEY,{phone_number_id}(the ID of your WhatsApp business phone number), and the recipient number:Terminal window curl -X POST https://messaging.cpaas.id/v1/{phone_number_id}/messages \-H "Authorization: Bearer $API_KEY" \-H "Idempotency-Key: quickstart-001" \-H "Content-Type: application/json" \-d '{"messaging_product": "whatsapp","to": "+6281234567890","type": "template","template": {"name": "hello_world","language": { "code": "id" }}}' -
Verify webhook delivery
Confirm that your server receives an HTTP
POSTwithmessage.status.sentandmessage.status.delivered, or click Send test event on the endpoint row on the Webhooks page to test connectivity at any time.


Result
Section titled “Result”Your curl call returns HTTP 202 Accepted with a message_id, and your webhook endpoint receives real-time delivery status updates.