Rate limits and errors
The Unstract Flow API limits how often one API key can call each endpoint, and returns its errors in the JSON shape below.
Rate limits
| Endpoint | Per API key | Per organization |
|---|---|---|
| Start a run | 30 requests a minute | 300 requests a minute |
| Get a run | 120 requests a minute | 1200 requests a minute |
| Get a run's results | 120 requests a minute | 1200 requests a minute |
| List workflows | 120 requests a minute | 1200 requests a minute |
| List runs | 120 requests a minute | 1200 requests a minute |
| Get run logs | 120 requests a minute | 1200 requests a minute |
| Get a ticket | 120 requests a minute | 1200 requests a minute |
| Check a key | 60 requests a minute | 600 requests a minute |
| List tickets | 60 requests a minute | 600 requests a minute |
| Ticket history | 60 requests a minute | 600 requests a minute |
| Claim the next ticket | 30 requests a minute | 300 requests a minute |
| Claim a ticket | 30 requests a minute | 300 requests a minute |
| Skip a ticket | 30 requests a minute | 300 requests a minute |
| Release a ticket | 30 requests a minute | 300 requests a minute |
| Escalate a ticket | 30 requests a minute | 300 requests a minute |
| Resolve a ticket | 30 requests a minute | 300 requests a minute |
| Create a workflow, change a workflow, save a spec, check a spec | 30 requests a minute | 300 requests a minute |
| Get a workflow, its spec, its versions or one version | 120 requests a minute | 1200 requests a minute |
| Add, link or remove a connector | 30 requests a minute | 300 requests a minute |
| List connectors, a workflow's connectors or credentials | 120 requests a minute | 1200 requests a minute |
| Prepare a workflow, cancel or tag a build | 30 requests a minute | 300 requests a minute |
| List builds, get a build | 120 requests a minute | 1200 requests a minute |
| Reset or remove pipeline items, reset a whole pipeline, expedite files | 30 requests a minute | 300 requests a minute |
| List a connector's pipeline items | 120 requests a minute | 1200 requests a minute |
| Create, change, activate, pause, run or delete a deployment, regenerate its webhook key | 30 requests a minute | 300 requests a minute |
| List deployments, get a deployment, list its runs | 120 requests a minute | 1200 requests a minute |
| List runs across the organization, get a run, get a run's recovery options | 120 requests a minute | 1200 requests a minute |
| Recover a run | 30 requests a minute | 300 requests a minute |
| Cancel a run | 30 requests a minute | 300 requests a minute |
| Start an import into a reference table, confirm its mapping, make it current, discard it | 30 requests a minute | 300 requests a minute |
| List a project's reference tables, get a table, its versions, an import or its changes | 120 requests a minute | 1200 requests a minute |
Each limit counts the requests one API key made to one URL over the last minute, whichever address they come from. Each of these is a URL of its own: starting runs of one workflow, reading one run, reading that run's results or logs, listing one workflow's runs, listing tickets, reading or acting on one ticket, and reading one ticket's history. So reading two runs counts against two limits. For the same URL, your organization is also limited to ten times the figure across all its keys. Requests from the API explorer carry no key, so their limits count by the address they come from: 30 a minute for each request that changes something, 60 for List tickets and Ticket history, and 120 for each other read. A request over a limit gets 429:
{
"code": "RATE_LIMITED",
"message": "Rate limit exceeded: 30 per 1 minute. Try again in 42 seconds.",
"request_id": "…"
}
The response says when to try again:
| Header | What it holds |
|---|---|
Retry-After | Seconds to wait before the next request. |
X-RateLimit-Limit | The limit that was reached. |
X-RateLimit-Remaining | 0. |
X-RateLimit-Reset | When the limit frees up, as a Unix time in seconds. |
Starting a run is also subject to your organization's cap on runs in flight. Runs that are queued, running or resuming count toward it; runs waiting for a review or a call limit don't. When your organization already has as many runs in flight as its cap allows, the request gets 429 with the code HTTP_429, no Retry-After header, and a message that starts Account concurrency limit reached. It still counts toward the request limit.
Allowance exceeded
When your organization has spent more than its allowance for the current billing period, starting a run gets 402:
{
"code": "QUOTA_EXCEEDED",
"message": "Account allowance exceeded for the current billing period.",
"request_id": "…",
"spent_cents": 50412,
"allowance_cents": 50000,
"account_id": "…"
}
spent_cents is what the organization has used this period and allowance_cents its allowance, both in cents. The check applies when a run starts from the API or from the editor. Repeating the request gets the same answer until the next period begins or the allowance is raised.
Error body
Every error uses one shape, and the 402 above adds its three fields to it:
{"code": "HTTP_404", "message": "Run not found", "request_id": "3f0c…"}
code is HTTP_ followed by the status, or a named code where the error has one, such as COMPILATION_NOT_READY on a run that pins a build that isn't ready; message then says why, and details carries the error's own fields. Include the request_id when you contact support: it names the request in Flow's logs.
Every response, a success or an error, carries the same id in its X-Request-ID header. To use an id of your own, send it in an X-Request-ID header: up to 128 letters, digits, ., _, : and -, starting with a letter or digit. Flow replaces any other value with an id of its own.
The workflow, connector, build and deployment endpoints name their codes, such as SPEC_CHANGED or BUILD_IN_PROGRESS. Author and deploy over the API lists them with each endpoint, and Reference tables over the API lists the import codes, such as IMPORT_IN_PROGRESS. A recovery that can't go ahead gets 409 with the code RECOVERY_NOT_AVAILABLE and details.reason; Runs lists the reasons.
A request that fails validation gets 422, with one entry in details for each problem. loc names the field, and type and msg say what is wrong with it:
{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{"type": "missing", "loc": ["body", "name"], "msg": "Field required"}
],
"request_id": "…"
}
Where the problem is a rule such as a length or a pattern, ctx gives the rule. An entry leaves out what you sent, so a secret in a refused request is never repeated in the response or in Flow's logs.
An unexpected error gets 500 with the code INTERNAL_SERVER_ERROR.