Developers

Contacts, channels & templates API

Updated 13 November 2026

Besides sending messages, the API lets you add contacts to Baat and list a channel’s templates. Every endpoint takes your API key in the X-API-KEY header, and is part of the Business plan.

All field names use snake_case. A field written in another style, such as countryCode, is ignored without an error.

Create or update a contact

POST https://api.baat.ai/v1/remote/contacts

Needs the contacts:write scope.

curl -X POST "https://api.baat.ai/v1/remote/contacts" \
  -H "X-API-KEY: $BAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Aarav Sharma",
    "phone": { "country_code": "91", "number": "919876543210" },
    "email": "aarav@example.com",
    "marketing_opt_in": true,
    "acquisition_source": "website-form",
    "preferred_language": "en"
  }'
FieldTypeDescription
namestringThe contact’s name
phoneobjectcountry_code, such as "91", and number: digits only, starting with the country code, such as "919876543210"
emailstringEmail address
marketing_opt_inbooleanWhether the contact agreed to receive marketing messages
acquisition_sourcestringWhere the contact came from
preferred_languagestringLanguage code, such as en

Write the number the same way WhatsApp does, with the country code and no +. Baat matches contacts by the exact number, so +919876543210 and 919876543210 would become two contacts.

The call returns 201 Created with the contact, including its id.

If the number already exists: by default Baat updates that contact with the fields you send and keeps the ones you leave out, and still returns 201. Add ?ignore-duplicate=false to the URL to get 409 Conflict instead, and change nothing.

List templates for a channel

GET https://api.baat.ai/v1/remote/account/channels/{channelId}/whatsapp-templates

Needs the templates:read scope. Returns the templates on that channel in every status, so check status before you send one. Results come in pages.

Query parameterDefaultDescription
limit50The most templates to return
after—The cursor from the previous page, to get the next page
{
  "cursor": "QVFIU…",
  "data": [
    {
      "template_id": "2067036557116441",
      "name": "order_shipped_v2",
      "language": "en",
      "status": "APPROVED",
      "category": "UTILITY"
    }
  ]
}

Each template also includes its components. Use template_id, name and language when you send it. On the last page, cursor is null.

Finding your channel ID

The simplest place is the Send via API tab on any template, under Settings → Templates, which shows the channel_id to use.

There is also an endpoint, GET https://api.baat.ai/v1/remote/account/channels, but it needs the channels:read scope, which the Create key form does not offer yet.

Errors

HTTPCause
401The API key is unknown, inactive or expired
403The key does not have the scope the endpoint needs
400The request is invalid, or the X-API-KEY header is missing
409The contact already exists and you set ignore-duplicate=false

Related reading

Where this fits in the wider picture.

Need a hand?

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

Contact support Book a demo