Getting started

Base URL: https://chatsa.co/api/v1

The ChatSa API lets your software send and receive WhatsApp messages through a business's ChatSa number, read conversations, receive signed webhooks for everything that happens, and, for partner platforms, create ChatSa accounts for your own customers. Everything a business does through the API also shows in its ChatSa inbox, so ChatSa keeps the full history.

Base URL#

https://chatsa.co/api/v1

https://chat.sa/api/v1 serves the same API. Every call is HTTPS and JSON.

Responses#

A successful call answers with the result inside data:

{ "data": { "chatbot_id": "6f1c…", "connected": true } }

An error answers with an HTTP status and a machine-readable code plus a human message (the same code is also in the X-Chat-Error header):

{ "code": "window_closed", "message": "The 24-hour window with this number is closed; send an approved template." }

Some errors add fields that help you act on them, such as retry_after or window_open_until. See Errors and rate limits.

Three ways to integrate#

You are building…UseCredentials
An integration for your own ChatSa workspace (your CRM, a script, Zapier)The REST API with an API keyAn API key from Dashboard → Developers → API keys
An app that existing ChatSa customers connect to their chatbot with one buttonConnect with ChatSa (OAuth 2.0 with PKCE)Your app's client id and secret; a token per connected chatbot
A platform that creates ChatSa accounts for its own customers, who never sign in to ChatSaThe partner APIYour app's client credentials, an account key per customer, a chatbot key per number

Every app starts on the standard tier ("Connect with ChatSa"). Creating accounts for your customers needs the account-creation tier: see Partner tiers.

Your first request#

  1. In ChatSa, open Dashboard → Developers → API keys.
  2. Name the key, tick whatsapp:read, tick the chatbot whose WhatsApp number you want to use, and press Create key. Copy the key (csa_…): it is shown once.
  3. Ask for the number's status:
curl https://chatsa.co/api/v1/whatsapp/status \
  -H "Authorization: Bearer csa_your_key"
{
  "data": {
    "capabilities": ["messages", "voice_notes", "voice_api", "takeover", "coexistence"],
    "chatbot_id": "6f1c2a4e-0000-4000-8000-000000000001",
    "chatbot_name": "Acme Plumbing",
    "mode": "api",
    "connected": true,
    "phone_number": "14155550123",
    "display_name": "Acme Plumbing",
    "quality_rating": "GREEN",
    "messaging_limit": "TIER_1K",
    "coexistence": null
  }
}

A key limited to exactly one chatbot doesn't need chatbot_id; any other key adds ?chatbot_id=<uuid>.

Conventions#

  • Phone numbers. WhatsApp numbers are E.164 digits without the plus (14155550123); +1 415… style input is accepted and normalised. Always include the country code. SMS and calls use E.164 with the plus (+14155550123).
  • Times are ISO 8601 in UTC.
  • Idempotency. Calls that send something require an idempotency key, so a retry never sends twice. See Errors and rate limits.
  • Secrets (API keys, client secrets, webhook signing secrets) are shown once and never again, so a lost one can only be replaced. ChatSa keeps API keys and client secrets only as a hash.

Older read endpoints#

GET /conversations, GET /contacts and GET /analytics predate the conventions above. They take any key of the workspace (a key with no scopes is read-only), answer with their own top-level fields (for example { "conversations": [ … ], "limit": 50, "offset": 0 }) and errors as { "error": "…" }. A key limited to some chatbots reads only their conversations and totals (total_contacts is then null), and GET /contacts needs a key for the whole workspace (403 workspace_key_required otherwise). GET /health reports the service's health.

Next steps#