Skip to main content
The OuterLayer API is what the 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:
Almost every path starts with /v1/. Conventions says how the API changes.

Authenticate

Send a credential as a bearer token on every request:
Which credential you send depends on the endpoint: 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 the X-Outerlayer-App-Id header. Its value is the factory id. Copy the Factory ID from the factory’s Settings → General.
Without it, a factory key gets 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}, answers 403.
  • GET /v1/apps lists only that factory.
You can leave the header out on:
  • /v1/orgs/{orgName}/... and /v1/me/factories, which name no factory.
  • /v1/mcp with a factory key, because the key belongs to one factory.
  • /v1/apps/{appId}/mcp, which takes the factory from the path.
See Use the MCP server for the MCP endpoints.

Permissions

Each endpoint needs a permission, such as work.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.update or factory.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 answer 403 with verdict_needs_person or follow_up_needs_person. A login token can make these calls when your role holds the permission each one needs: work.approve for a pass, and work.review for a fail or a follow-up. A plain comment needs work.comment.

Make a request

List the factory’s live work items:
The key needs work.read. A page holds up to 100 items:
When 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 any 204 answer.
  • 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.
These calls take an id you choose:

Get the OpenAPI spec

The OpenAPI spec is at https://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:
Branch on 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 gets 402 with billing_read_only on these requests:
  • POST /v1/work-items
  • POST /v1/work-items/build
  • POST /v1/work-items/{workItemId}/claim
  • POST /v1/work-items/{workItemId}/comments, only when a person records a fail or sends a follow-up
  • POST /v1/work-items/{workItemId}/notes
  • POST /v1/work-items/{workItemId}/attachments, only when a person uploads the file
  • POST /v1/work-items/{workItemId}/mocks, only when a person adds the mock
  • POST /v1/work-items/{workItemId}/mocks/{mockId}/replace, only when a person replaces the mock
These still work: claim renew, release and stop, all reads, session sync and artifact upload. See Billing and trials for what the dashboard shows.

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.

Next steps

Find an endpoint in the Endpoints group of this tab. To manage members, roles and the audit log, see Organization API.