outerlayer CLI and the dashboard call. Call it from a script to do what they do. This page gives the rules that every endpoint shares.
OuterLayer serves the API at one base URL:
/v1/. Conventions says how the API changes.
Authenticate
Send a credential as a bearer token on every request:
A factory key never works on
/v1/orgs/.... A management key never works on factory endpoints.
A login token acts with your role on the factory that the header names. It never holds the permissions to manage keys, members, roles, billing or single sign-on, or to delete a factory. Use a factory key in a script.
GET /health, GET /v1/pricing and GET /v1/openapi.json need no credential.
Name the factory
Factory endpoints also need theX-Outerlayer-App-Id header. Its value is the factory id. Copy the Factory ID from the factory’s Settings → General.
401 and a login token gets 400 app_id_required.
A factory key or a login token acts only on the factory that this header names:
- A path that names another factory, such as
/v1/apps/{appId}, answers403. GET /v1/appslists only that factory.
/v1/orgs/{orgName}/...and/v1/me/factories, which name no factory./v1/mcpwith a factory key, because the key belongs to one factory./v1/apps/{appId}/mcp, which takes the factory from the path.
Permissions
Each endpoint needs a permission, such aswork.read. A key holds the permissions you chose when you made it. API keys lists the presets and the permissions that CLI commands need.
A call without the permission answers 403, and error.required_permission names the permission. It is a list when any one of several permissions works. Add the permission to the key.
These are the permissions for the endpoints a script calls most:
Other endpoints name their permission in the
403 they answer.
Two limits apply to every key:
- No factory key holds
factory.insert,factory.updateorfactory.delete. Create, change and delete a factory in the dashboard. - Only a person records a review. A key cannot post a comment with a pass or a fail, send a follow-up, or call
POST /v1/work-items/{workItemId}/notes. Those calls answer403withverdict_needs_personorfollow_up_needs_person. A login token can make these calls when your role holds the permission each one needs:work.approvefor a pass, andwork.reviewfor a fail or a follow-up. A plain comment needswork.comment.
Make a request
List the factory’s live work items:work.read. A page holds up to 100 items:
pagination.cursor is not null, send it back as ?cursor=<cursor> for the next page. Other endpoints page in other ways. See Pages of results.
Pages of results
A list endpoint returns one page at a time. The way to the next page depends on the endpoint:
The default
limit differs by endpoint. So does the field that holds the total. The endpoint’s page shows both.
Conventions
- A successful answer holds its result in
data. These do not: the health check, the price list, file downloads, the audit-log export (CSV), the MCP endpoints and any204answer. - New fields and new endpoints arrive under
/v1/with no new prefix. Ignore fields you do not know. - A breaking change ships under a new prefix, such as
/v2/, with a deprecation window of at least 90 days. - Some calls take an id that you choose, so that a retry is safe. Send the same id again, and OuterLayer returns the stored result. It stores nothing twice.
Get the OpenAPI spec
The OpenAPI spec is athttps://api.outerlayer.ai/v1/openapi.json. It needs no credential. Use it to generate a client.
Errors
An error answers with a status code and this body:error.code, which is stable. error.message is for people. Some errors add fields, such as required_permission above.
On a
426, error.minimum is the lowest runner protocol. It is a whole number, not a CLI version.
When an answer has error.requestId, the X-Request-Id header holds the same id.
When an organization is read-only
A read-only organization gets402 with billing_read_only on these requests:
POST /v1/work-itemsPOST /v1/work-items/buildPOST /v1/work-items/{workItemId}/claimPOST /v1/work-items/{workItemId}/comments, only when a person records a fail or sends a follow-upPOST /v1/work-items/{workItemId}/notesPOST /v1/work-items/{workItemId}/attachments, only when a person uploads the filePOST /v1/work-items/{workItemId}/mocks, only when a person adds the mockPOST /v1/work-items/{workItemId}/mocks/{mockId}/replace, only when a person replaces the mock
Rate limits
Most endpoints have no rate limit. These do:
Most limits count the calls of one organization. The attachment, session sync and artifact upload limits count the calls of one caller. One caller in a loop does not stop the other callers of the organization. A caller is a member, an API key or a build’s own key. The endpoints in the first row share one count.
An organization is read-only when it has no active subscription and no running trial, or when its payment retries ran out. In every other state the higher limits apply, including the trial and the grace period after a failed payment. See Billing state.
An MCP tool call counts against the same limit as the REST endpoint it mirrors.
The
outerlayer CLI waits the Retry-After time and sends the request again. See outerlayer sync and outerlayer emit artifact.
A 429 carries X-RateLimit-Limit, X-RateLimit-Remaining, and, when known, X-RateLimit-Reset (Unix time in milliseconds) and Retry-After (seconds).
Invites and resends have their own limit, and it answers 400, not 429. See Organization API.