Developers

API reference & error codes

Updated 31 May 2026

A consolidated reference for the Baat developer API. For step-by-step guides, see the other articles in this section.

Base URLs

EnvironmentHost
Productionhttps://api.baat.ai
Staginghttps://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

MethodPathScopePurpose
POST/m1/whatsapp/messagesmessages:sendSend a WhatsApp template message.
POST/v1/remote/contactscontacts:writeCreate a contact.
GET/v1/remote/account/channelschannels:readList connected WhatsApp channels.
GET/v1/remote/account/channels/{channelId}/whatsapp-templatestemplates:readList approved templates on a channel.

API keys and webhook subscriptions are managed from the dashboard (Developers section), not through these key-authenticated endpoints.

HTTP status codes

CodeMeaning
200 OKRequest succeeded (reads).
201 CreatedResource created (e.g. a contact).
202 AcceptedMessage accepted and queued for delivery.
400 Bad RequestInvalid or malformed request.
401 UnauthorizedMissing, unknown, inactive or expired API key.
403 ForbiddenKey lacks the required scope (insufficient_scope).
409 ConflictDuplicate resource (e.g. contact phone number with ignore-duplicate=false).
500 Internal Server ErrorUnexpected error on Baat’s side — safe to retry.

Webhook delivery

AspectDetail
MethodPOST with Content-Type: application/json
Signature headerX-Baat-Signature: sha256= — HMAC-SHA256 of the raw body, keyed with the signing secret.
Eventscontact.created, contact.updated, conversation.opened, conversation.closed, flow_response.submitted
Payload{ event, occurred_at, organization_id, data }
RetriesUp to 8 attempts with backoff (10 min → 7 days), then marked Failed.

Build handlers to be idempotent and verify the X-Baat-Signature on every webhook. Treat API keys and signing secrets as secrets — store them in a vault, never in source control, and rotate on suspicion of exposure.

Need a hand?

Our team answers on WhatsApp, usually within a business day.

Contact support Book a demo