Skip to Content
MailroomMailroom home

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_…"
}
HTTPcodeWhen
401unauthorizedMissing or invalid key
403policy_deniedPolicy deny
403forbiddenMissing scope
404not_foundUnknown id (also used for cross-tenant)
409idempotency_conflictSame key, different body
422validation_errorZod/schema failure
423agent_pausedKill switch
429rate_limitedToken bucket
429quota_exceededPlan cap or spend cap

x-request-id is always present. Do not log Authorization or *_secret / *_key fields.

On this page