Skip to content

Quick Start: API & Webhook

  • 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.
  1. Open the API Keys page

    In the left sidebar, click Developer › API Keys (/developer/api-keys), then click Generate New Key.

  2. 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.

  3. Open the Webhooks page

    Go to Developer › Webhooks (/developer/webhooks) and click Add Endpoint.

  4. 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.

  5. 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.

  6. Send your first message with curl

    Run 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" }
    }
    }'
  7. Verify webhook delivery

    Confirm that your server receives an HTTP POST with message.status.sent and message.status.delivered, or click Send test event on the endpoint row on the Webhooks page to test connectivity at any time.

Developer › API Keys page for creating and managing server API keys
Developer › API Keys page for creating and managing server API keys
Developer › Webhooks page for registering endpoint URLs and events
Developer › Webhooks page for registering endpoint URLs and events

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