Skip to content

Rate limits and idempotency

Built in modules/identity for authentication, key creation and sign-in routes. In v1, identity limits are fixed-window counters in memory per API process.

View .mdOpen llms.txt

Identity rate limits (built)

Buckets are isolated so bad cookies or links do not lock out working API keys, and code verification outages refund the try so a WorkOS blip does not burn your five tries.

Fixed-window limits enforced by modules/identity
BucketLimitWindowKeyed by
Failed auth checks2010 minutesClient IP
Unauthenticated POST /v1/keys101 hourClient IP
Unauthenticated POST /v1/keys31 hourTarget email (also caps emails sent)
Failed sign-in callbacks / wrong codes2010 minutesClient IP
Failed /v1/auth/refresh checks2010 minutesClient IP
Failed link token checks3010 minutesClient IP
POST /v1/auth/code tries510 minutesTarget email (counted before WorkOS is called)
POST /v1/auth/code tries2010 minutesClient IP (counted before WorkOS is called)

Handling HTTP 429

Every rate-limited response returns HTTP 429 with code rate_limited, a Retry-After header in whole seconds, and a fix field stating how long to wait. Wait at least Retry-After seconds before retrying.

http
HTTP/1.1 429 Too Many Requests
Retry-After: 540
Content-Type: application/json

{
  "code": "rate_limited",
  "message": "Too many sign-in code tries for this email or from this address.",
  "fix": "Wait 540 seconds, or sign in at /v1/auth/sign-in instead."
}

Idempotency keys

Retriable write routes in upcoming product modules (profiles, generations, sites, banner publishes and evidence packs) accept an Idempotency-Key header backed by platform.idempotency_keys. Route-specific rules are added as modules/documents, modules/sites and modules/evidence ship.