Skip to main content
The Xem API limits how many requests each client can make, to keep the service responsive and to slow down password guessing. Limits are counted per client IP address and per endpoint.

Limits

Health checks at /health and /api/v1/health are not limited. The limit is stored in Redis, so it is shared by every API instance. If Redis is unavailable, each API instance falls back to a single in-memory limit of 20 requests per second per IP address, and the stricter limits above do not apply. Self-hosted installs should keep Redis running.

Response headers

Every limited response includes:

When you exceed the limit

The API returns 429 Too Many Requests with this body:
retry_after is the number of seconds to wait before trying again: the length of that endpoint’s window.

Retry with backoff

Wait for retry_after seconds, or back off exponentially if it is missing, and add a little random jitter so many clients do not retry at once:
When you send email through the API, include a requestId so a retried request cannot send the same message twice. See the quickstart.

Staying under the limit

  • Send campaigns to lists from the app, instead of one API call per recipient.
  • Cache data that rarely changes, such as templates and lists.
  • Spread scheduled jobs out instead of starting them all on the minute.
  • Watch X-RateLimit-Remaining and slow down before it reaches zero.
Self-hosted installs can change these limits in server/internal/api/middleware/ratelimit.go.