Idempotency, retries, and errors
Idempotency-Key, retry policy, and RFC 9457 error codes.
Early access
Every mutating endpoint accepts Idempotency-Key. Keys are stored 24h, scoped by org, and bound to a hash of the request. The same key + same body returns the original response. A same key + different body returns a conflict.
The TypeScript SDK generates a UUIDv7 Idempotency-Key for emails.send when you omit one.
Worker retries
The send worker retries SES throttling and 5xx with exponential backoff and jitter, max 8 attempts over about an hour. 4xx validation errors are not retried. After that: status failed + event.
SDK retries on 429 and 5xx, honoring Retry-After.
Errors
Errors use RFC 9457 application/problem+json with a stable code.
{
"type": "https://mailroom.dev/errors/policy_denied",
"title": "Policy denied this send",
"status": 403,
"code": "policy_denied",
"detail": "Rule r_new_recipient denied this message.",
"instance": "/v1/emails",
"request_id": "req_…"
}| HTTP | code | When |
|---|---|---|
| 401 | unauthorized | Missing or invalid key |
| 403 | policy_denied | Policy deny |
| 403 | forbidden | Missing scope |
| 404 | not_found | Unknown id (also used for cross-tenant) |
| 409 | idempotency_conflict | Same key, different body |
| 422 | validation_error | Zod/schema failure |
| 423 | agent_paused | Kill switch |
| 429 | rate_limited | Token bucket |
| 429 | quota_exceeded | Plan cap or spend cap |
x-request-id is always present. Do not log Authorization or *_secret / *_key fields.