Apply multiple rate limit checks
Check and enforce multiple rate limits in a single request for any identifiers (user IDs, IP addresses, API clients, etc.).
Use this to efficiently check multiple rate limits at once. Each rate limit check is independent and returns its own result with a top-level passed indicator showing if all checks succeeded.
Response Codes: Rate limit checks return HTTP 200 regardless of whether limits are exceeded — check the passed field to see if all limits passed, or the success field in each individual result. A 429 may be returned if the workspace exceeds its API rate limit. Other 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
Required Permissions
Your root key must have one of the following permissions:
- ratelimit.*.limit (to check limits in any namespace)
- ratelimit.<namespace_id>.limit (to check limits in all specific namespaces being checked)
Request body
Example request
[
{
"namespace": "sms.sign_up",
"cost": 5,
"duration": 60000,
"identifier": "user_12345",
"limit": 1000
}
]Response
All rate limit checks completed successfully. Check the success field in each result to determine if the corresponding request is allowed.
Example response
{
"meta": {
"requestId": "req_123"
}
}