Developers
API reference & error codes
Updated 13 November 2026
A one-page reference for the Baat developer API. For step-by-step guides, see the other articles in this section.
The API and webhooks are part of the Business plan, and you can try them during the free trial.
Base URLs
| Environment | Host |
|---|---|
| Production | https://api.baat.ai |
| Staging | https://stageapi.baat.ai |
Authentication
Pass your key in the X-API-KEY header on every request. Keys look like bk_live_ followed by 34 characters and are issued per organization.
X-API-KEY: bk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Endpoints
| Method | Path | Scope | Purpose |
|---|---|---|---|
POST | /m1/whatsapp/messages | messages:send | Send a template message, or a text message inside the 24-hour window |
GET | /m1/orgs/{orgId}/messages | messages:read | Read the messages in a conversation |
POST | /v1/remote/contacts | contacts:write | Create or update a contact |
GET | /v1/remote/account/channels/{channelId}/whatsapp-templates | templates:read | List the templates on a channel, in every status |
Request and response fields use snake_case.
API keys and webhooks are managed in the dashboard, under Settings → Developers, not through these endpoints.
HTTP status codes
| Code | Meaning |
|---|---|
200 OK | Request succeeded (reads). |
201 Created | Resource created (e.g. a contact). |
202 Accepted | Message accepted and queued for delivery. |
400 Bad Request | The request is invalid, or a required header is missing |
401 Unauthorized | The API key is unknown, inactive or expired |
403 Forbidden | The key does not have the scope the endpoint needs. The send endpoint returns "status": "insufficient_scope" |
409 Conflict | The contact already exists and you set ignore-duplicate=false |
500 Internal Server Error | Something failed on Baat’s side. A message may already be queued, so check before you retry a send |
There are no published rate limits.
Webhook delivery
| Aspect | Detail |
|---|---|
| Method | POST with Content-Type: application/json |
| Signature header | X-Baat-Signature: sha256= — HMAC-SHA256 of the raw body, keyed with the signing secret. |
| Events | contact.created, contact.updated, conversation.opened, conversation.closed, flow_response.submitted |
| Payload | { event, occurred_at, organization_id, data } |
| Retries | Up to 8 attempts, with waits growing from 10 minutes to 7 days (about 13 days in all), then marked Failed |
Make webhook handlers safe to run twice, and verify the X-Baat-Signature on every webhook. Keep API keys and signing secrets out of source control, and revoke a key the moment it may have been exposed.