ChatMaxima Docs

ChatMaxima API - Getting Started and API Key Setup

Use the ChatMaxima REST API to send WhatsApp, Instagram and other channel messages, sync contacts and export chats. Get your API key and make your first call.

What is the ChatMaxima API

The ChatMaxima API is a REST API that connects your own systems to your ChatMaxima workspace. Send WhatsApp templates and session messages, reply on Instagram, Messenger, Telegram, SMS, email and web chat, keep contacts in sync with your CRM, receive delivery and reply events by webhook, and export conversation history.

Key things to know:

  • Version - the current API is v2.
  • Transport - every request is made over HTTPS and returns JSON.
  • Base URL - all endpoints live under https://chatmaxima.com/api/v2.
  • Auth - requests are authenticated with an API key that is unique to your workspace.
  • Plan - API access is included in the Pro, Max, Ultra and Enterprise plans.
  • OpenAPI - a machine-readable spec is available at https://docs.chatmaxima.com/openapi/chatmaxima-api-v2.json.

Available endpoints

AreaEndpointsWhat you can do
Send MessagesPOST /messages/send/, GET /messages/{id}/Send on WhatsApp, Instagram, Messenger, Telegram, SMS, email or web chat, and check delivery.
WhatsApp TemplatesGET /whatsapp/templates/, POST /whatsapp/templates/send/List approved templates and send them to start or reopen a conversation.
WhatsApp MessagesPOST /whatsapp/messages/send/, GET /whatsapp/messages/{id}/status/Send free-form WhatsApp messages inside the 24-hour window and check status.
WhatsApp WebhooksGET, POST /whatsapp/webhooks/, DELETE, testReceive delivered, read, failed and reply events.
Channel AccountsGET /channels/accounts/List connected channels and get the account_id for sends.
Media UploadPOST /media/Upload files to attach to non-WhatsApp messages.
ContactsGET, POST /contacts/, POST /contacts/sync/, GET, PUT /contacts/{id}/Create, update, look up and bulk sync contacts.
Conversations ExportGET /conversations/export/Pull conversation history for a sync into another system.

Get your API key

Your API key lives in the Developer portal, on the Settings page. It is created automatically for your workspace the first time you open that page.

  1. Open the Developer portal at https://chatmaxima.com/developer/.
  2. Sign in with your ChatMaxima account if you are not already logged in.
  3. Go to Settings (the API Key page) at https://chatmaxima.com/developer/settings/.
  4. Your API key is shown on the page. Click Copy API Key to copy it.
  5. If you manage more than one workspace, use the team switcher in the top menu to select the right workspace first. Each workspace has its own key, and a key only works for the workspace it belongs to.

Note: Treat the API key like a password. It carries the permissions of your workspace, so keep it secret and store it server side only. Never put it in a browser, a mobile app, or any public code.

Make your first request

Send the key as the raw value of the Authorization header, with no Bearer prefix. The example below lists your connected channels with the Channel Accounts endpoint.

curl https://chatmaxima.com/api/v2/channels/accounts/ \
  -H "Authorization: YOUR_API_KEY"

Note: Every endpoint path ends with a trailing slash. A request without it is redirected, and most HTTP clients drop the request body on a redirect, so always include the slash.

Responses

A successful call returns the standard response envelope. message and meta are included when there is something to report.

{
  "status": "success",
  "code": 200,
  "message": "Message sent",
  "data": {},
  "meta": {}
}

Creating something returns 201. Deleting a webhook returns 204 with no body. Status values in responses are always strings.

Errors

A failed call returns an HTTP error status and an error object. details is included when there is more to say, such as the field that failed or the provider's own error.

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key provided."
  }
}

These errors can come from any endpoint:

HTTPCodeWhen it happens
401MISSING_API_KEYNo Authorization header was sent.
401INVALID_API_KEYThe key is wrong or has been rotated.
403PLAN_NO_API_ACCESSYour plan does not include API access. details.upgrade_url links to the upgrade page.
403PLAN_EXPIREDSend endpoints only: your plan has ended.
403MESSAGE_LIMIT_REACHEDSend endpoints only: your monthly message allowance, including add-ons, is used up.
400INVALID_JSONThe request body is not valid JSON.
400MISSING_REQUIRED_FIELDSA required field is missing. The message names it.
429RATE_LIMIT_EXCEEDEDToo many requests. See Rate limits.

Each endpoint page lists its own error codes as well.

Rate limits

Limits are counted per API key in one-minute windows:

RequestsLimit per minute
Sends (/messages/send/, /whatsapp/messages/send/, /whatsapp/templates/send/)300
Other writes (POST, PUT, DELETE)120
Reads (GET)300

Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix timestamp). Over the limit you get 429 with a Retry-After header in seconds:

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please retry after 12 seconds.",
    "details": { "limit": 300, "window": "60 seconds", "retry_after": 12 }
  }
}

Explore interactively

Signed-in users can try the API live, with their own key, in the interactive developer reference:

https://chatmaxima.com/developer/v2/docs

Next steps

On this page