Rate limits and idempotency
Rate limits
Seven counters, in fixed one-minute windows. A call goes through all of them; the first one full answers 429 API_RATE_LIMITED with Retry-After.
| Counter | Ceiling | Counted per | Applies to |
|---|---|---|---|
| Address | 1 200 / min | calling IP address | every /v1 call that presents a key, before the key is even checked |
| Reads | 600 / min | key | GET, HEAD |
| Writes | 60 / min | key | POST, PUT, PATCH, DELETE |
| Power | 20 / min | key and service | POST /services/{code}/power |
| Reinstall | 2 / min | key and service | POST /services/{code}/reinstall |
| Deployment | 10 / min | key and site | POST /services/{code}/web/sites/{siteId}/deployments and .../deployments/{deploymentId}/redeploy, together |
| Account | 1 200 / min | account | every call, across all keys |
POST /services/{code}/backups, POST /services/{code}/backups/restore, POST /services/{code}/actions/{action} and every /services/{code}/web/... and /services/{code}/games/... route also spend the account's action budgets, shared with the dashboard, whatever the route:
| Action budget | Ceiling |
|---|---|
| All actions | 300 / min |
| Backups (create or restore) | 10 / min |
| Password or secret resets | 10 / min |
| Domain verifications | 10 / min |
| Subdomain availability checks | 30 / min |
Over budget, the answer is the same 429 API_RATE_LIMITED with Retry-After, and the action is not run. Every call to these routes counts, reads included: an integration polling them in a loop eats into the budget of its owner's dashboard.
Three details that change how a retry loop behaves:
- A refused call counts. A burst of
400eats the write budget like successful calls do. Fix the body before retrying. - Rotating a key resets its per-key counters. The account counter and the action budgets carry on.
- The accepted rate can exceed the nominal ceiling. Rely on the nominal ceiling only.
Reading the headers
| Header | Value |
|---|---|
X-RateLimit-Limit | the ceiling of the key or account counter closest to its limit (the action budgets are not reflected) |
X-RateLimit-Remaining | what is left on that counter |
X-RateLimit-Reset | epoch timestamp in seconds of the end of the window, not a delay |
Retry-After | on 429 API_RATE_LIMITED: seconds to wait, minimum 1 |
These headers describe the tightest counter at that moment, which is not always the same one from call to call.
Idempotency
Fifteen routes require an Idempotency-Key header: the four that move money, the seven that create a web hosting resource or start a deployment, and the four of a game server that answer a password or start an install.
POST /ordersPOST /orders/{orderNumber}/payPOST /invoices/{code}/payPOST /services/{code}/renewPOST /services/{code}/web/sitesandPOST /services/{code}/web/sites/{siteId}/clonePOST /services/{code}/web/databasesPOST /services/{code}/web/sftp-accountsPOST /services/{code}/web/sites/{siteId}/appsPOST /services/{code}/web/sites/{siteId}/deploymentsand.../deployments/{deploymentId}/redeployPOST /services/{code}/games/databasesandPOST /services/{code}/games/databases/{databaseId}/passwordPOST /services/{code}/games/versions/installsPOST /services/{code}/games/content/installs
| Idempotency key | Detail |
|---|---|
| Format | non-blank string, 128 characters at most. A UUID does |
| Absent or blank | 400 IDEMPOTENCY_KEY_REQUIRED |
| Beyond 128 characters | 400 IDEMPOTENCY_KEY_INVALID |
| Scope | the API key. Two keys may use the same string without colliding |
| Retention | 24 hours |
What makes it "the same request"
The digest covers the method, the concrete path and the body. The same idempotency key on another order number is therefore a different request.
| Situation | Answer |
|---|---|
| Identical replay after a success | the recorded response, with Idempotent-Replayed: true. Nothing is redone |
| Same key, different request | 409 IDEMPOTENCY_KEY_REUSED |
| Same key while the first call is still running | 409 IDEMPOTENCY_IN_PROGRESS with Retry-After: 2 |
Refusals replay too
A refusal is a result: it is recorded and replayed. A replayed 402 PAYMENT_DENIED stays a 402, with no second payment attempt.
The exceptions are the refusals in the left column: they release the key, so fix the condition and retry with the same one. The others are recorded and replayed, PRODUCT_OUT_OF_STOCK and the validation refusals of POST /orders included: fix the request, then retry with a new key.
| Releases the key | Does not release it |
|---|---|
INSUFFICIENT_BALANCE | PAYMENT_DENIED and PAYMENT_DENIED_* |
NO_PAYMENT_METHOD | PAYMENT_RECORDED_MISMATCH |
PAYMENT_METHOD_ID_REQUIRED | API_KEY_SPENDING_CAP_EXCEEDED |
PAYMENT_METHOD_NOT_FOUND | PAYMENT_FAILED |
PAYMENT_METHOD_NOT_ACTIVE | any 500 |
PAYMENT_METHOD_DECRYPTION_FAILED | |
PAYMENT_METHOD_VAULT_ID_MISSING | |
PAYMENT_IN_PROGRESS | |
RENEWAL_IN_PROGRESS | |
RENEWAL_TOO_FREQUENT | |
PROMO_RATE_LIMITED | |
SITE_BUSY, INSTANCE_BUSY, DATABASE_BUSY | |
API_RATE_LIMITED | |
ACCOUNT_ACCESS_DENIED, ACCOUNT_ACCESS_REVOKED, SITE_SCOPE_RESTRICTED | |
SERVICE_NOT_FOUND, NOT_FOUND, SERVICE_NOT_ACTIVE, SERVICE_IN_DUNNING |
API_KEY_SPENDING_CAP_EXCEEDED does not release the key, even when nothing was charged. Raise the cap, then retry with a new idempotency key.
A password does not replay
A creation or a reset that answers a password (a database, an SFTP account, an application's administrator, a game server's database) shows it once, in the first answer. A replay under the same idempotency key returns the same resource without its credential fields, with "credentialsRedacted": true in data; a connection URL loses its user:password@. The password is never kept with the recorded answer. Lost, it is reset: POST /services/{code}/web/databases/{databaseId}/password, POST /services/{code}/web/sftp-accounts/{accountId}/password, POST /services/{code}/web/sites/{siteId}/apps/{installId}/admin-password, POST /services/{code}/games/databases/{databaseId}/password.
In practice
- Generate the idempotency key before the first send, and store it with the task, not in memory.
- Reuse it as is for every retry of the same task.
- Change it as soon as the task changes, even by one cent.