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
| Area | Endpoints | What you can do |
|---|---|---|
| Send Messages | POST /messages/send/, GET /messages/{id}/ | Send on WhatsApp, Instagram, Messenger, Telegram, SMS, email or web chat, and check delivery. |
| WhatsApp Templates | GET /whatsapp/templates/, POST /whatsapp/templates/send/ | List approved templates and send them to start or reopen a conversation. |
| WhatsApp Messages | POST /whatsapp/messages/send/, GET /whatsapp/messages/{id}/status/ | Send free-form WhatsApp messages inside the 24-hour window and check status. |
| WhatsApp Webhooks | GET, POST /whatsapp/webhooks/, DELETE, test | Receive delivered, read, failed and reply events. |
| Channel Accounts | GET /channels/accounts/ | List connected channels and get the account_id for sends. |
| Media Upload | POST /media/ | Upload files to attach to non-WhatsApp messages. |
| Contacts | GET, POST /contacts/, POST /contacts/sync/, GET, PUT /contacts/{id}/ | Create, update, look up and bulk sync contacts. |
| Conversations Export | GET /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.
- Open the Developer portal at https://chatmaxima.com/developer/.
- Sign in with your ChatMaxima account if you are not already logged in.
- Go to Settings (the API Key page) at https://chatmaxima.com/developer/settings/.
- Your API key is shown on the page. Click Copy API Key to copy it.
- 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:
| HTTP | Code | When it happens |
|---|---|---|
| 401 | MISSING_API_KEY | No Authorization header was sent. |
| 401 | INVALID_API_KEY | The key is wrong or has been rotated. |
| 403 | PLAN_NO_API_ACCESS | Your plan does not include API access. details.upgrade_url links to the upgrade page. |
| 403 | PLAN_EXPIRED | Send endpoints only: your plan has ended. |
| 403 | MESSAGE_LIMIT_REACHED | Send endpoints only: your monthly message allowance, including add-ons, is used up. |
| 400 | INVALID_JSON | The request body is not valid JSON. |
| 400 | MISSING_REQUIRED_FIELDS | A required field is missing. The message names it. |
| 429 | RATE_LIMIT_EXCEEDED | Too 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:
| Requests | Limit 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