Using the API

For the developers and tools that call your company's API. Members find the complete reference for their own company, generated from its published artifacts, under API docs in OneAPI.

Signing in

Send a OneAPI key as a bearer token. The key decides the company, so addresses never contain it.

curl -H "Authorization: Bearer oa_svc_…" https://oneapi.cloudcircus.com/api/whoami/

/api/whoami/ answers with the company, the key (and when it expires), the person or API key it belongs to, and its permissions: a good first call. Keys starting oa_svc_ belong to an API key, oa_pat_ to a person.

Addresses and methods

Every published artifact gets the same set of endpoints. With an artifact called invoice:

RequestDoesNeeds
GET /api/invoice/List, filters in the query stringREAD
QUERY /api/invoice/Search, filters in the bodyREAD
POST /api/invoice/Create, parts includedWRITE
GET /api/invoice/{id}Read oneREAD
PUT /api/invoice/{id}Update (the whole record)WRITE
DELETE /api/invoice/{id}Delete, with its partsDELETE
GET /api/invoice/{id}/invoice_lines/The record's partsREAD
GET /api/invoiceline/{id}One partREAD on Invoice

An operation whose flow isn't set up answers 405. Records come back with their id first (invoice_id), then the fields in the artifact's order. Numbers are exact decimals.

Lists and filters

Filter on a field with field (equal), field__gte, field__lte or field__contains. Which filters an artifact supports depends on its list flow, and the API docs show them.

GET /api/invoice/?invoice_date__gte=2026-11-01&limit=100

QUERY /api/invoice/
{ "filters": { "invoice_date": { "gte": "2026-11-01" } }, "limit": 100 }

A list answers {"items": [...]}, plus next_cursor when there's more. Pass it back as cursor (in the query string or the body) for the next page. limit is 50 by default and at most 200. A cursor is valid for a day.

Errors

Every error has the same shape, and every response carries a OneAPI-Request-Id header. Include it when you contact support.

{
  "error": "invalid",
  "message": "Some fields aren't right.",
  "fields": [{ "field": "invoice_date", "message": "is required" }],
  "request_id": "…"
}
StatusMeans
400The request isn't valid: see message and fields.
401No key, or an unknown, expired or revoked one. sso_reauth_required: sign in through your company's provider again.
403You may use this artifact, but not this operation.
404No such record, or no such artifact for you.
405This operation isn't set up for the artifact.
410The record was deleted.
422The service refused the request (its reason is in message), or the flow stopped on purpose.
429Too many requests, from you or at the service. Try again later.
503A service is down or its sign-in needs renewing. The message names it.

Versions

Your company's admins can add to an artifact without breaking you: a new optional field just appears. When they make a breaking change (remove or retype a field, make one required), it becomes a new version at /api/v2/invoice/, and /api/invoice/ keeps working as before.

OpenAPI

GET /api/openapi.json describes the API as OpenAPI 3.1, limited to what your key may do. Use it to generate a client, or import it into Postman. People in the company can also browse it, with "Try it out", under API docs in OneAPI.