API conventions
This page covers the core conventions of the Qlara Platform REST API: authentication, request identification, rate limits, pagination, error handling, and response format.
Base URL
All API requests are made against the following base URL:
https://api.qlara.ai/api
Two APIs are served under it: the Platform API, under /api/partner-gateway, which holds campaigns and everything around them, and the messaging API, under /api/message-server, which holds the templates and the single sends of SMS, RCS, WhatsApp and email. For example, campaigns are created at:
https://api.qlara.ai/api/partner-gateway/campaigns
This page writes every path in full, from the host. The pages of the API Reference sections write short paths: there, POST /campaigns is the address above, and a path that starts with /message-server belongs to the messaging API, under https://api.qlara.ai/api.
Authentication
Every request must include valid credentials. Which methods you can use depends on the endpoint:
- The Qlara Platform endpoints under
/api/partner-gateway/accept only an API key, in theX-Api-Keyheader. They ignore theAuthorizationheader: a call with Basic credentials and no key gets401with{"error": "Invalid API Key"}. - The messaging endpoints under
/api/message-server/, and the media downloadGET /api/files/{mediaKey}, accept either an API key or Basic Auth.
API Key (recommended)
Pass your API key in the X-Api-Key header:
curl -X GET "https://api.qlara.ai/api/partner-gateway/contacts" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Basic Auth
Messaging endpoints and /api/files only. Pass your credentials as a Base64-encoded username:password in the Authorization header:
curl "https://api.qlara.ai/api/message-server/whatsapp/templates" \
-H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="
API Key authentication is recommended for all new integrations. It works on every endpoint, it is simpler and easier to rotate, and it does not expose your account password.
Never expose your API key or credentials in client-side code, public repositories, or URLs. Always send them via headers over HTTPS.
Request Identification
Every response from the Qlara Platform endpoints under /api/partner-gateway/ carries an X-Request-Id header:
X-Request-Id: 16d9b2a9ca97da0d8c4c4ea2ae689017
The value is the trace identifier the platform assigned to your request, the same key that indexes every log line the request produced. Log it on your side and quote it when you contact support about a specific call. It is present on error responses too, including 401 and 500, which is when you need it most.
The messaging endpoints under /api/message-server/, and /api/files, do not send this header. For those, keep the messageId returned by an accepted send, and for an error quote the endpoint and the time of the call.
Rate Limits
No requests-per-second limit is applied at the moment by the Qlara Platform endpoints under /api/partner-gateway/ or by the messaging endpoints under /api/message-server/.
The media download GET /api/files/{mediaKey} applies a per-account limit on requests per second, set by your subscription plan. When you exceed it, it answers 429 Too Many Requests with an empty body and a Retry-After: 1 header: wait one second and retry.
A 429 without Retry-After reports a subscription limit instead, which retrying does not clear. This is the only 429 of the Qlara Platform endpoints: POST /api/partner-gateway/media answers it, with {"status": "fail", "data": "Client error."}, when the file would take your account past the media storage of its plan. On the messaging endpoints, WhatsApp template creation answers it when the whatsapp_templates limit of your plan is reached.
No X-RateLimit-* headers are returned by any endpoint. For delivery status, prefer webhooks over tight polling loops: see the Webhook guide.
Pagination
Endpoints that return collections (contacts, contact lists, campaigns, email campaigns, exports, media, RCS agents, WhatsApp phone numbers, message history) are page-based: page selects a page, counting from 0, and limit sets the page size.
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 0 | Page index. The first page is 0. |
limit | integer | 10 or 20, per endpoint | Page size. Where a maximum is enforced it is 1000, or 100 for the email campaigns. Check the endpoint reference. |
Example request
curl -X GET "https://api.qlara.ai/api/partner-gateway/contacts?page=2&limit=20" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Example response
{
"data": [
{
"id": 202365451,
"fullName": "Marco Rossi",
"phoneNumbers": ["+393401234567"],
"createdAt": "2026-01-15 10:30:00.000+0000"
},
{
"id": 202365452,
"fullName": "Giulia Bianchi",
"phoneNumbers": ["+393409876543"],
"createdAt": "2026-01-16 14:20:00.000+0000"
}
],
"page": 2,
"limit": 20,
"totalCount": 1250,
"totalPages": 63
}
To iterate through all records, increment page from 0 to totalPages - 1.
A few collections have a different shape:
GET /api/partner-gateway/campaignswraps the same page object in a JSend envelope:{ "status": "success", "data": { "data": [...], "page": 0, "limit": 20, "totalCount": 12, "totalPages": 1 } }.GET /api/partner-gateway/messages/historyandGET /api/partner-gateway/messages/statusreturn a plain JSON array. History still acceptspageandlimit, which count entries: an SMS split into parts appears once per part. Withoutstatus, you have reached the last page when it comes back with fewer items thanlimit. Withstatus, the filter is applied to each page after it is read, so a short or even empty page does not mean the end: to collect every message in one status, page withoutstatusand keep the entries whosedeliveryStatusyou want.GET /api/partner-gateway/inbox/conversations,GET /api/partner-gateway/socials,GET /api/partner-gateway/authenticationandGET /api/partner-gateway/campaigns/email/sendersreturn a plain JSON array with no pagination. The inbox lists one section at a time:sectionisACTIVE(the default),ARCHIVEDorTRASHED, so a call without it leaves out archived and trashed conversations. Narrow it further with its filters (unreadOnly,channelIds,dateFrom) and sort it withorderBy.
Error Handling
The API uses standard HTTP status codes. The Qlara Platform endpoints return a JSend body.
Error response format
A request that was refused (4xx) is a fail, and data says why. It is a string in most cases:
{
"status": "fail",
"data": "Invalid 'from': '27/08/2026'. Accepted formats: yyyy-MM-dd (a whole day, UTC), yyyy-MM-ddTHH:mm:ss (UTC) or ISO-8601 with an offset such as 2025-01-15T00:00:00+01:00 or 2025-01-15T00:00:00Z"
}
When bean validation fails, on the request body or on query and path parameters alike, data is a list of lists of messages, one list per invalid object. The message about a query or path parameter starts with the parameter's name:
{
"status": "fail",
"data": [["limit: must be less than or equal to 1000"]]
}
The messaging endpoints under /api/message-server/ use another shape: data is an object that maps the path of each invalid field to its messages, for example {"sendSms.request.destination": ["'destination' can't be blank"]}.
A 4xx returned by an internal service of the platform is passed on with a fixed data that names no parameter: Resource not found. for a 404, Client error. for the other codes. A 400 is the exception: it carries the reason the service gave, or Bad request. when it gave none.
A failure on our side (5xx) is an error:
{
"status": "error",
"message": "Something bad happened. Please try again!"
}
A 5xx relayed from an internal service reads "message": "Remote server error." for a 500 and "Server error." for the other codes.
One exception to this shape: a missing or invalid API key, or a key that does not include the operation called, answers 401 with {"error": "Invalid API Key"} on the Qlara Platform endpoints. The messaging endpoints and /api/files answer 401 with an empty body, and a 429 from /api/files has no body either.
HTTP status codes
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | The request body or query parameters are invalid. When the gateway itself refuses the request, data names the parameter and, for dates and enumerations, the accepted values; a 400 passed on from an internal service carries the reason the service gave, or Bad request. when it gave none. |
401 | Unauthorized | Missing or invalid credentials. On the Qlara Platform endpoints also a key that does not include the operation you called; on the messaging endpoints and /api/files also an Authorization header that is not valid Basic Auth, or a caller blocked for 10 minutes after repeated failed attempts. See the Authentication guide. |
402 | Payment Required | Your wallet does not cover the price of the email campaign you are confirming: the body is {"status": "fail", "data": "Insufficient credit for the email campaign"}. Read the price with GET /api/partner-gateway/campaigns/email/{id}/price, top up, then confirm again. |
403 | Forbidden | The request is not allowed for your key or account, for example POST /api/partner-gateway/authentication asking for operations the calling key does not hold, or a sender ID that is not registered and approved for your company. On the messaging sends, also an account the platform cannot find (code 102) and, for email, an account not enabled for email sending (code 36). |
404 | Not Found | The endpoint or the resource does not exist for your account. A status lookup answers 404 when the message id is unknown for the given channel, or when the message has not been dispatched yet (a scheduled message before its scheduledDate). |
405 | Method Not Allowed | The path exists, but not with this HTTP method. |
409 | Conflict | The request conflicts with the current state of the resource, for example a webhook that is already configured, or a media item that is public or still in use. |
429 | Too Many Requests | With Retry-After: GET /api/files/{mediaKey} exceeded the per-account requests-per-second limit. Without it: a subscription limit was reached (media storage, WhatsApp templates). See Rate Limits. |
500 | Internal Server Error | An unexpected error on our side. Retry with exponential backoff and, if it persists, contact support quoting the X-Request-Id (Qlara Platform endpoints) or the endpoint and time of the call. |
502 | Bad Gateway | An upstream service or channel provider returned an error, refused the request, or could not be reached. On the messaging endpoints, a 502 with an empty body means your credentials could not be checked at that moment. |
504 | Gateway Timeout | Qlara Platform endpoints: an upstream service did not answer in time. The request may have been carried out anyway: read the resource before sending it again. |
511 | Network Authentication Required | Messaging endpoints only, on sends: your IP address is outside the ranges allowed for your account (code 100). See the Authentication guide. |
Any other status an upstream service answers with (for example 422 or 503) is passed on unchanged. On the Qlara Platform endpoints, a 401 or 403 of an upstream service becomes 502: your key was already accepted, so it describes a problem on our side.
Retry strategy
For transient errors (5xx other than 511, and a 429 that carries Retry-After), implement exponential backoff with jitter, and wait at least the Retry-After delay when there is one:
- First retry: wait 1 second
- Second retry: wait 2 seconds
- Third retry: wait 4 seconds
- Maximum retries: 5 attempts
- Add jitter: add a random delay of 0--500ms to each wait time to avoid thundering herd
Sends are the exception: never retry them blindly. A 5xx or a timeout on a request that sends a message (SMS, RCS, WhatsApp, email) does not mean the message was not accepted: the platform may have queued it before the error reached you, and it does not deduplicate sends, so sending the same request again can deliver the message twice. Set your own messageId on every send, so that you know it even when the response is lost. Before resending, look the message up by that messageId with GET /api/partner-gateway/messages/status or GET /api/partner-gateway/messages/history, and resend only if it is not there. Email does not appear there yet (see Email): after a 5xx on an email send, check with the recipient or your own logs before resending. The backoff above applies as it is to reads and to the other requests.
The same goes for confirming a campaign. After a 5xx or a timeout on PUT /api/partner-gateway/campaigns/{id}/confirm, read the campaign with GET /api/partner-gateway/campaigns/{id} before confirming again: a status other than DRAFT means the confirmation went through, and a second one would only answer 400. For an email campaign the calls are PUT /api/partner-gateway/campaigns/email/{id}/confirm and GET /api/partner-gateway/campaigns/email/{id}, and the draft status is CREATED.
Do not retry 400, 401, 402, 403, 404, 422 or 511 errors, nor a 429 without Retry-After. These indicate a problem with your request or your account that must be fixed before retrying: a message refused with 422 is refused again if you send it unchanged, a 402 comes back until your wallet covers the price, repeated failed authentications on the messaging endpoints block your IP address for 10 minutes, and a 511 lasts until your IP address is allowed.
Response Format
All API responses use JSON with UTF-8 encoding.
Common response headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json;charset=UTF-8 | Response body format |
X-Request-Id | 16d9b2a9ca97da0d8c4c4ea2ae689017 | Trace identifier of the request, to quote to support. Qlara Platform endpoints only |
Cache-Control | no-cache, no-store, must-revalidate | Responses must not be cached |
Successful responses
- Single resource: the resource object at the top level.
- Collections: the page object described under Pagination, or a plain array for the endpoints listed there.
- Create:
201 Createdwith the created resource. - Update:
200 OKwith the updated resource. - Delete:
204 No Contentfor most resources. The contact deletes answer200 OKwithtrueinstead:DELETE /api/partner-gateway/contactsandDELETE /api/partner-gateway/contacts/listtake the ids to delete in theidsquery parameter, comma-separated, not in the body;DELETE /api/partner-gateway/contacts/list/contactstakes a JSON body (listIdspluscontactIdsorallContacts);DELETE /api/partner-gateway/contacts/list/contacts/{id}takes the association id in the path.DELETE /api/partner-gateway/campaigns/email/{id}answers200 OKwith{"status": "success", "data": null}. - Async operations (exports):
202 Acceptedwith an empty body, without an export id. PollGET /api/partner-gateway/exportsuntil a new entry for your request appears: an export is listed only once its file is ready, already withisAvailableForDownload: true, and an export that fails is never listed. Then callGET /api/partner-gateway/exports/{exportId}for the download URL.
Timestamps
Two formats are in use, depending on the resource:
| Where | Format | Example |
|---|---|---|
Delivery status and message history (sendDate, deliveryDate, readDate) | ISO 8601 with offset | 2026-09-03T08:28:52Z |
Contacts, lists, campaigns, exports, inbox (createdAt, lastMessageDate, ...) and scheduledDate on sends | yyyy-MM-dd HH:mm:ss.SSSZ | 2026-09-01 10:17:53.200+0000 |
Date query parameters
from and to on GET /api/partner-gateway/messages/history, and dateFrom on GET /api/partner-gateway/inbox/conversations, accept:
| Form | Example | Read as |
|---|---|---|
| Date only | 2026-08-27 | The whole UTC day: 00:00:00Z as from and dateFrom, 23:59:59Z as to |
| Date-time without offset | 2026-08-27T10:30:00 | UTC |
| ISO 8601 with offset | 2026-08-27T00:00:00%2B01:00, 2026-08-27T23:59:59Z | As given |
Percent-encode a + in the offset as %2B: in a query string an unencoded + is decoded as a space. A value in any other shape is answered 400 with the list of accepted formats.
Delivery statuses
GET /api/partner-gateway/messages/status and GET /api/partner-gateway/messages/history report a normalised deliveryStatus (ACCEPTED, REJECTED, DELIVERED, EXPIRED, DELETED, UNDELIVERABLE, ERROR, DISABLED, UNSUPPORTED, CONVERSATION_CLOSED, or UNKNOWN) with a lowercase deliveryStatusDescription. The delivery-status webhook sends the same status as a numeric statusCode. The Delivery Statuses table in the API reference maps each code to its status and lists the channels that use it.
What's next?
- Quick Start -- Send your first message with a campaign.
- Authentication guide -- Detailed auth setup with IP whitelisting.
- API Reference -- Full endpoint documentation.
- Postman Collections -- Ready-to-use request collections.