Resources
Rate limits
API rate limits by tier with response headers and best practices
npayload enforces rate limits to ensure fair usage and platform stability. Limits are applied per API key at the edge layer.
Rate limit tiers
| Tier | Requests per minute | Burst | Concurrent connections |
|---|---|---|---|
| Free | 60 | 10 | 5 |
| Starter | 600 | 50 | 25 |
| Pro | 6,000 | 200 | 100 |
| Enterprise | Custom | Custom | Custom |
Response headers
Every API response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait (only on 429 responses) |
Rate-limited response
When you exceed the rate limit, the API returns 429 Too Many Requests:
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 30 seconds.",
"retryAfter": 30
}
}Per-endpoint limits
Some endpoints have additional limits:
| Endpoint | Limit | Notes |
|---|---|---|
POST /oauth/token | 30/min per IP | Prevents credential stuffing |
POST /v1/messages/batch | 10/min | Each batch can contain up to 100 messages |
POST /v1/messages/transactional | 10/min | Atomic multi-channel publish |
Best practices
- Use batch publish to send multiple messages in one request instead of many individual calls.
- Implement exponential backoff when you receive a
429response. Use theRetry-Afterheader. - Cache responses where possible (channel metadata, subscription lists).
- Monitor your usage via the dashboard to stay within limits.
async function publishWithRetry(channel: string, payload: unknown, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
return await npayload.messages.publish({ channel, payload });
} catch (error) {
if (error instanceof RateLimitError && attempt < maxRetries - 1) {
const delay = error.retryAfter ?? Math.pow(2, attempt) * 1000;
await new Promise((resolve) => setTimeout(resolve, delay));
continue;
}
throw error;
}
}
}Next steps
- Error codes for all API error responses
- API reference for endpoint documentation
Was this page helpful?