> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate limits

> How limits work and how to back off

Rate limits protect the API for everyone. The main limit applies per company: all requests made with your company's API key count together. Limits can change, so read them from the response headers rather than hard-coding them.

## The limits

| Limit | Counted per | Requests a minute |
| - | - | - |
| Every request | Company | 600 |
| `POST /partner-applications`, `POST /resume-fit`, each | Company | 20 |
| Requests with a missing or invalid API key | IP address | 300 |
| Every request to Alex | IP address | 10,000 |

> [!NOTE]
>
> These numbers are counted separately on each server instance that serves the API, and requests are spread across instances.
> The limit you can actually reach is therefore usually higher than the number shown, and varies with how many instances are
> running. Don't plan on more than the documented number: it is the one you can rely on.

## Headers

Responses to authenticated requests carry the limit that applies to the request. A `401` for a missing or invalid API key has none of them, because the key is checked before any company limit applies; the `429` for [too many failed authentications](#failed-authentication) does carry them.

| Header | Meaning |
| - | - |
| `RateLimit-Policy` | The limit and its window in seconds, such as `600;w=60`. |
| `RateLimit-Limit` | Requests allowed in the current window. |
| `RateLimit-Remaining` | Requests left in the current window. |
| `RateLimit-Reset` | Seconds until the window resets. |

On `POST /partner-applications` and `POST /resume-fit`, the headers describe that endpoint's own, lower limit. Like the limits, the headers count one server instance's requests, so they are a guide, not an exact count.

## When you're limited

Over any limit, the API returns `429` with `Retry-After` and the `RateLimit-*` headers of the limit you hit:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 12
RateLimit-Policy: 600;w=60
RateLimit-Limit: 600
RateLimit-Remaining: 0
RateLimit-Reset: 12
```

```json theme={null}
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited",
    "message": "Too many requests. Retry after the number of seconds in the Retry-After header.",
    "request_id": "req_8f14e45fceea167a5a36dedd4bea2543"
  }
}
```

Wait for the number of seconds in `Retry-After`, then retry. If you send an `Idempotency-Key`, reuse it: a `429` releases the key. See [Idempotency](https://docs.alex.com/api-reference/v2/idempotency.md).

## Endpoints with their own limits

`POST /partner-applications` and `POST /resume-fit` do heavy work on each request, so each has a lower limit of its own, 20 requests a minute, on top of the company limit. Their `429` is answered the same way, with `Retry-After` and `RateLimit-*` headers.

## Failed authentication

Too many requests with a missing or invalid API key from one IP address also return `429` `rate_limited`, with `Retry-After` and `RateLimit-*` headers, for every request from that address until the window resets, even with a valid key. Check that your key is right before you retry.

## Temporarily unavailable

[`PATCH /talent-match-candidates/{external_candidate_id}`](https://docs.alex.com/api-reference/v2/talent-match/update-candidate) returns `503` `talent_match_writes_paused` while Talent Match isn't taking changes. It also has a `Retry-After` header: wait that long, then retry.

## Staying within the limits

* Use `updated_since` to fetch only what changed, rather than listing everything. See [Pagination](https://docs.alex.com/api-reference/v2/pagination.md).
* Use `limit=100` when you page through a large list.
* Spread bulk work out over time, rather than sending it all at once.
* Back off exponentially when you get repeated `429`s.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.