rate_limited
A rate limit refused this call, and the response carries Retry-After: 60; the export cap can take up to an hour to clear.
How to fix it
- Honour Retry-After. The header is set to 60 on every rate_limited response from both the REST API and the MCP endpoint.
- Back off exponentially with jitter rather than retrying on a fixed interval. This is the one family of errors where retrying is correct, which makes a synchronised retry storm the realistic failure.
- Spread work across time rather than across credentials. Buckets are keyed on the verified principal and on the workspace, so a second key in the same workspace shares the workspace bucket.
- For exports, wait for the hour to pass. The cap is two per member in any rolling hour.
Which rule fired
There are two different kinds of limit behind this code and they behave differently. The general one is a request-rate throttle with three buckets: an edge bucket keyed on a hash of the client IP, a workspace bucket, and a principal bucket keyed by api key, connection or identity. Only verified principal fields feed the last two, never a workspace header, so a caller cannot spread its load across buckets by claiming a different workspace. The other kind is a per-operation limit on calls that are expensive or reach out on your behalf, counted over a trailing window: two exports per member per hour, and one webhook test per endpoint per 60 seconds. Creating an inbox can also be held back by the service's own pacing of calls to the mail provider, before any request reaches it.
| In error.message | Means |
|---|---|
Too many requests. Retry shortly. | The workspace bucket or the principal bucket rejected the request. The principal bucket is keyed on the verified api key id, connection id or identity id. The edge bucket, keyed on an HMAC of the client IP, rejected the request before any principal was resolved. |
At most two exports can be requested per hour per member. | A third export was requested within an hour by the same member. The limit is two per hour per member. |
Webhook test events are rate-limited. Try again shortly. | A webhook test event was sent within 60 seconds of the previous one on the same endpoint. |
Inbox creation was deferred before contacting the provider. No address or inbox capacity was retained; retry shortly. | Inbox creation was deferred before the provider was contacted and the local reservation was confirmed released. No address or capacity was retained. |
Why it works this way: The edge counter is treated as permissive and never as billing authority. It is local to a Cloudflare location and therefore cannot see global traffic, so it is used to shed obvious load early and the real accounting happens on the principal and workspace buckets behind it.
Example
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry shortly.",
"request_id": "req_8Kd2x91",
"retryable": true,
"details": {}
}
} The MCP server answers with the same body and status, and sets retry-after too.
Where it appears
- Every /v1 route
-
POST /projects/{project_id}/ exports -
POST /projects/{project_id}/ webhooks/ {webhook_id}/ test -
POST /projects/{project_id}/ inboxes -
POST https://mcp.emailforagents.ai/mcp
Paths are relative to https://api.emailforagents.ai/v1.