API reference
Rate limit
The API allows 120 requests per minute per project.
Rate limits are applied per project, across all endpoints, in a fixed one-minute window. Exceeding the limit returns 429 Too Many Requests.
The limit#
Each project may make 120 requests per minute. When you go over, Deckle responds with 429 and a Retry-After header telling you how many seconds to wait before the window resets.
http
HTTP/1.1 429 Too Many Requests
Retry-After: 42
Content-Type: application/json
{ "error": "Rate limit exceeded. Slow down and retry shortly." }Handling 429s#
Respect the Retry-After value and back off before retrying. For bursty workloads — importing contacts, sending in batches — spread requests out or add an exponential backoff.
ts
async function withRetry<T>(fn: () => Promise<T>): Promise<T> {
try {
return await fn();
} catch (err: any) {
if (err?.status === 429) {
const wait = Number(err.body?.retry_after ?? 2) * 1000;
await new Promise((r) => setTimeout(r, wait));
return withRetry(fn);
}
throw err;
}
}Large audiences
To broadcast to your whole list, use a campaign rather than loopingsend. Campaigns are delivered by Deckle’s worker and aren’t subject to the per-request API limit.