API

GraphQL

Every signed-in API route as a GraphQL field, an organization's own part, batches, persisted queries and limits.

GraphQL runs inside the platform API, with the same authentication: every route you can call with a token is also a GraphQL field, checked by the same scopes and gates and recorded the same way. The GraphQL Explorer sends documents from your browser with your session or a key.

Two parts

AddressWhat it serves
https://api.cactive.com.au/v1/graphqlThe platform's part: every signed-in route as a field, and operations defined for GraphQL, MCP and REST at once. A field for an organization's route takes that organization in its orgId argument.
https://api.cactive.com.au/v1/orgs/:orgId/graphqlThe organization's own part: its objects and actions, for its members only, each field available where the organization's plan includes its app.

Each path validates against its own part alone: a platform field sent to the organization's path is unknown there. A screen that needs both sends them together, as a batch.

Fields from routes

Each route is a field named from its method and path: no verb for a GET (a Query field), the method for anything else (a Mutation field), then the path's words, orgs/:orgId as org, and its last parameter as by…. Names never change once published.

RouteField
GET /v1/meme
GET /v1/orgs/:orgId/membersorgMembers(orgId:)
GET /v1/orgs/:orgId/issues/:issueKeyorgIssuesByIssueKey(orgId:, issueKey:)
POST /v1/orgs/:orgId/pagespostOrgPages(orgId:, body:)
  • Arguments: the path's parameters, its query parameters (one named as a path parameter becomes query<Name>), and the JSON body whole in body. Every field takes purpose, the reason a marked read asks for, sent as the purpose header.
  • Answers: the route's own body, typed from the API's source; any field of it may be null. A route that answers nothing gives true. A route answering a file or a stream stays REST only (406 rest_only).
  • Errors: a refused field is null, with its error's extensions holding the route's status and code (and retryAfter when there is one). Other fields of the document still answer.
  • Routes with a credential of their own (provider webhooks, shared links, SCIM, agent devices, pipeline runners) aren't fields.

Batches

Send a JSON array to an organization's path, with one document for each part: the organization's, and the platform's marked "part": "platform".

[
  { "query": "{ objectSearch(type: \"vehicle\", first: 20) { id } }" },
  { "part": "platform", "query": "query($org: String!) { orgMembers(orgId: $org) { members { userId name } } }", "variables": { "org": "org_…" } }
]

Each runs against its own part, with its own checks, in one request; the answer is an array in the same order. The GraphQL Explorer sends one from its Platform Document box.

Persisted queries

On an organization's path, send a document's SHA-256 instead of its text, as Apollo's automatic persisted queries do:

{ "extensions": { "persistedQuery": { "version": 1, "sha256Hash": "…" } } }

The first time, send the text with its hash: once it has run without an error it's kept for the organization for 30 days, and later requests send the hash alone. An unknown or expired hash answers PersistedQueryNotFound: send the text again, as Apollo's clients do. A persisted query can be sent as GET, and its answer carries an ETag, so your client revalidates with If-None-Match. Hashes are per organization, and each keeps up to 1 MB of new text a day; past that, documents still run from their text.

Limits

LimitDefault
Depth of a document (a type's ofType chain doesn't count)10
Cost of a request's documents together: 10 points a root field, 1 a nested field (__typename too), a page's fields times its first or limit5,000 points
Routes a request's documents call together50
Largest first500

A request past one is refused with limit_exceeded, status 413, and so is a document that repeats one response key or spreads fragments in the hundreds in one selection, or nests past 64 levels. Mutations are sent as POST with content-type: application/json only.

An answer past 6 MB is refused with too_large, status 413: ask for fewer fields or smaller pages. It says applied if a mutation ran, so don't send it again, mayHaveApplied if one may have, so check first, and notSent if one never started. A standard introspection of the platform's part is past that, so read it a type at a time with __type(name:).

Errors and time

A variable that isn't what its type asks for answers invalid_input, status 400, naming it. A request has 30 seconds. Near the end, fields that haven't started answer unavailable, status 503, with notSent; a field still running answers the same, with mayHaveApplied if it's a change, and the fields that finished still answer.

Caching

Every GraphQL answer depends on who asks, refusals included, so it's Cache-Control: private and never kept by a shared cache; a GET's ETag covers the organization and what you may see there.