Skip to content
DutiesBook API
Open app

Quick start

Send your first WhatsApp template message in three simple steps.

Before you begin

  • An active DutiesBook account
  • A connected WhatsApp Business channel
  • At least one approved message template

Log in to dashboard

Access your account dashboard at your organization’s portal.

Navigate to API keys

Go to Organization → API Key

Create new key

Click Create API Key and name it (e.g., “Production Backend”)

Set permissions

Enable: readChannels, readTemplates, sendSingleMessages, sendBulkMessages

Save credentials

Copy your Account ID (acc_…), API Key (pk_…), and Secret Key (sk_…)

Important

Store your Secret Key securely. It cannot be retrieved after creation.

POST /auth/verify

Test that your credentials work:

Terminal window
curl -X POST https://app.dutiesbook.com/api/external/v1/auth/verify \
-H "X-Account-Id: acc_12345678" \
-H "X-Api-Key: pk_abcdefghij" \
-H "X-Secret-Key: sk_1234567890abcdef"
200 OK
{
"success": true,
"data": {
"valid": true,
"organization": {
"uuid": "org-uuid",
"name": "Your Organization"
},
"apiKey": {
"name": "Production Backend",
"accessType": "all_ips",
"createdAt": "2024-01-15T10:00:00Z"
}
}
}
GET /channels
Terminal window
curl https://app.dutiesbook.com/api/external/v1/channels \
-H "X-Account-Id: acc_12345678" \
-H "X-Api-Key: pk_abcdefghij" \
-H "X-Secret-Key: sk_1234567890abcdef"

Note

Copy the uuid of your WhatsApp channel from the response.

GET /channels/:channelId/templates
Terminal window
curl "https://app.dutiesbook.com/api/external/v1/channels/CHANNEL_UUID/templates?status=APPROVED" \
-H "X-Account-Id: acc_12345678" \
-H "X-Api-Key: pk_abcdefghij" \
-H "X-Secret-Key: sk_1234567890abcdef"

Note

Copy the name and language of the template you want to use.

POST /messages/send
Terminal window
curl -X POST https://app.dutiesbook.com/api/external/v1/messages/send \
-H "Content-Type: application/json" \
-H "X-Account-Id: acc_12345678" \
-H "X-Api-Key: pk_abcdefghij" \
-H "X-Secret-Key: sk_1234567890abcdef" \
-d '{
"channelId": "CHANNEL_UUID",
"to": "+1234567890",
"templateName": "hello_world",
"language": "en_US",
"variables": {
"body": {
"1": "John"
}
}
}'
200 OK
{
"success": true,
"data": {
"messageId": "wamid.HBgLMTIzNDU2Nzg5MA==",
"status": "sent",
"to": "+1234567890",
"templateName": "hello_world",
"sentAt": "2024-01-15T10:30:00Z"
}
}

Congratulations!

You’ve sent your first message using the External API!