Rate limits
Each API key gets 100 requests a minute, shared across every endpoint it calls. The widget and automation webhooks allow 200 a minute per IP address.
Careflow counts requests over a sliding one-minute window. When you go over, the request is refused with 429 and a Retry-After header that says how many seconds to wait.
The limits
| Endpoints | Limit | Counted per |
|---|---|---|
Everything you call with an API key: POST /v1/conversations/messages, and the agents, knowledge, analytics, tools, variables and integrations endpoints | 100 a minute, all together | API key |
/v1/web/* (config, session, messages, conversations, help) | 200 a minute | IP address |
POST /webhooks/workflow/{webhookId} | 200 a minute | IP address |
An API key has one budget for everything it does. A key that sends conversation messages and also syncs knowledge spends the same 100 requests a minute on both, so a burst of knowledge requests can leave too few for the messages sent with that key. Give each system its own key and each gets its own budget, which also means a busy batch job can't hold up your customer-facing service.
Two services that share a key share one budget, and a new key starts its own. The limit follows the key, not the IP address, so it's the same wherever the requests come from.
The widget endpoints and the automation webhooks share one budget per IP address. In practice that's one visitor's browser, or one server calling your webhooks. Visitors behind the same office or hotel network share an IP address, and so share the budget.
The voice WebSocket at /v1/web/voice/stream has no request limit. A call stays open until someone hangs up.
The widget's daily message cap
On top of the per-minute limit, each web widget answers up to 1,000 visitor messages a day, counted from midnight UTC. After that, POST /v1/web/messages returns 429 with message set to cap_exceeded until the next day. This cap has no Retry-After header.
Read the headers
Responses that pass the limit carry two headers:
X-RateLimit-Limit: the limit for this endpoint, such as100.X-RateLimit-Remaining: how many requests are left in the current window.
A refused request carries Retry-After too, and names the limit in its body:
{
"code": "ERROR",
"message": "too_many_requests",
"error": "You have exceeded the rate limit for api. Please try again in 12s."
}
The window slides, so there's no burst at the top of the minute. Retry-After is the time until your oldest counted request falls out of the window.
Back off and retry
Wait for Retry-After, add a little random jitter so many workers don't all retry on the same second, and try again:
async function withRetry(url, options, attempts = 3) {
for (let i = 1; ; i++) {
const res = await fetch(url, options);
if (res.status !== 429 || i >= attempts) return res;
const body = await res.clone().json();
if (body.message === "cap_exceeded") return res;
const seconds = Number(res.headers.get("Retry-After")) || 1;
const jitter = 0.8 + Math.random() * 0.4;
await new Promise((r) => setTimeout(r, seconds * 1000 * jitter));
}
}
Stay under the limits in the first place:
- Send one Conversations request per customer message. Don't poll for replies: the reply comes back in the same response.
- When you wait for knowledge to finish processing, check every few seconds rather than in a tight loop, and stop once it's done.
- For reports, read the analytics totals or the export once a day instead of fetching every session one by one.
- In your chat window, call
GET /v1/web/configonce per page load, and create a session only when the visitor opens the chat. - Reuse a session token until it expires, rather than creating one per message.
Where to go next
- Errors covers every other failure.
- Authentication covers keys and session tokens.