Rate limits
Each API key has an allowance of requests a minute, set by the plan of the workspace in the path.
| Plan | Requests a minute, per key |
|---|---|
| Free | 60 |
| Every paid plan, and trials | 600 |
- The count is per key, so one busy integration never uses up another's allowance.
- A workspace key always counts at its workspace's plan. For a personal key, paths without a workspace (
/me/workspaces,/auth/me) count at 60 a minute. - The window is a fixed minute: the count starts again when it ends.
Where you stand
Every response to a key carries three headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit |
Your allowance this minute |
X-RateLimit-Remaining |
Requests left in this minute |
X-RateLimit-Reset |
Seconds until the minute ends and the count starts again |
http
HTTP/1.1 200 OK
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 587
X-RateLimit-Reset: 41Over the limit
The request is refused with 429 and a Retry-After header, in seconds:
http
HTTP/1.1 429 Too Many Requests
Retry-After: 18
Content-Type: application/json
{
"code": "RATE_LIMITED",
"message": "Too many requests for this API key",
"details": { "retryAfterS": 18, "limitPerMinute": 60 }
}Nothing was done; send the same request again once Retry-After has passed.
Staying inside it
- Watch
X-RateLimit-Remainingand slow down as it nears zero, instead of waiting for a429. - Read in bulk. One report call returns a whole team's month; a list page holds up to 500 rows. That beats one request per person or per day.
- Use webhooks instead of asking every minute whether anything changed. See Webhooks.
- Retry politely. On a
429, wait forRetry-After: nothing was done, so any request is safe to repeat. On a5xxor a network error, back off: wait 1 second, then 2, 4, 8… up to a minute, with a little randomness so many clients don't retry in step. Repeat a read freely; before repeating a write that may have reached us, read back to see whether it did, so you don't record the same time twice.
js
async function punchly(path, init = {}, attempt = 0) {
const res = await fetch(`https://api.punchly.work/v1${path}`, {
...init,
headers: { 'X-Api-Key': process.env.PUNCHLY_API_KEY, 'Content-Type': 'application/json', ...init.headers },
});
const safeToRepeat = res.status === 429 || (res.status >= 500 && (init.method ?? 'GET') === 'GET');
if (safeToRepeat && attempt < 6) {
const retryAfter = Number(res.headers.get('retry-after'));
const wait = retryAfter > 0 ? retryAfter * 1000 : Math.min(60_000, 1000 * 2 ** attempt) * (0.5 + Math.random());
await new Promise((resolve) => setTimeout(resolve, wait));
return punchly(path, init, attempt + 1);
}
return res;
}Need more than 600 a minute? Tell us what you're building.