Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reference

The interactive reference and the raw spec are the source of truth — this page links to both and adds what a schema alone doesn’t carry: a quick operation index and error codes.

Both links are root-relative and work identically whether you’re reading this page from the app host’s /docs prefix or a dedicated docs host’s own root (see Run your own) — both hosts serve /api/docs and /api/openapi.json.

The spec covers the worker- and dispatcher-facing surface this guide walks through in prose: turns, the worker registry, and the hub’s own review and work-run queues. It does not cover the browser/UI surface (sessions, roots, search, the worker registry’s browser-facing half) — that surface is documented in Integrate as a UI instead, by design: it’s session-cookie gated, not a service contract meant for machine-to-machine consumption the way an OpenAPI document implies.

Every operation

GroupMethodPathScopePurpose
CapabilitiesPOST/api/agent/capabilitiesagent:reportReports what a root’s harness can currently do — tools, MCP servers, skills, commands, and subagents — replacing any prior report for the same root_id.
IndexGET/api/agent/index/fingerprintsagent:reportPer-native_id [fingerprint, message_count] pairs for one root — what a worker diffs its own local sessions against before deciding what POST /api/agent/index/sessions needs to publish.
IndexPOST/api/agent/index/sessionsagent:reportOne publish batch of sessions — the write path a worker calls after diffing its own sessions against GET /api/agent/index/fingerprints.
IntegrationsPOST/api/integrations/turnsreview:runQueues one read-only idea-review turn, idempotently re-reporting an identical resubmission under the same request_id.
IntegrationsGET/api/integrations/turns/{request_id}review:runPolls the state of a previously queued idea-review turn.
IntegrationsPOST/api/integrations/work-runswork:runQueues one service work run against a hub-configured work profile, idempotently re-reporting an identical resubmission under the same request_id.
IntegrationsGET/api/integrations/work-runs/{request_id}work:runPolls a queued or completed service work run, including the state of its own result callback to WORK_REPORT_URL.
JobsGET/api/agent/jobs/nextagent:claimClaims one pending generic job for the polling worker, or 204 when none is ready for the given roots.
JobsPOST/api/agent/jobs/{id}/resultagent:reportReports the terminal outcome of a claimed job.
TurnsGET/api/agent/reservationagent:reportReads the reservation the calling worker belongs to.
TurnsGET/api/agent/turnsagent:reportLists turns, newest-first, optionally filtered by status.
TurnsGET/api/agent/turns/nextagent:claimClaims one pending execution turn for the polling worker, or 204 when none is ready.
TurnsPOST/api/agent/turns/{id}/doneagent:reportReports success, failure, an ordinary capped requeue, or an uncapped parked requeue when park_until_ms is supplied.
TurnsPOST/api/agent/turns/{id}/eventsagent:reportAppends one batch of events to a claimed turn’s stream.
TurnsGET/api/agent/turns/{id}/historyagent:reportEvery recorded state transition for one turn, oldest-first (pending → claimed → done/expired, including any reclaims/requeues in between).
TurnsGET/api/agent/wakeagent:claimWaits for new claimable work, or for the caller’s reservation to end.
WorkersPOST/api/agent/workers/self/commands/claimexecution:controlClaims one pending control command for this principal’s resolved self instance, or 204 when none is pending.
WorkersGET/api/agent/workers/self/commands/{id}/codeexecution:controlReads a one-time code exactly once.
WorkersPOST/api/agent/workers/self/commands/{id}/completeexecution:controlReports the terminal outcome of a provider-auth-control command.
WorkersPOST/api/agent/workers/self/commands/{id}/eventsexecution:controlReports progress for a claimed provider-auth-control command.
WorkersPOST/api/agent/workers/self/commands/{id}/heartbeatexecution:controlRenews a provider-auth-control command’s lease.
WorkersPUT/api/agent/workers/self/heartbeatexecution:heartbeatUpserts this principal’s worker-registry row.
enrollmentPOST/api/enroll/v1/enroll—Enrolls a freshly provisioned worker against its reservation.
enrollmentPOST/api/enroll/v1/static/checkin—A static-pool machine collects the enrollment token of its assigned reservation.
issuerGET/.well-known/aya-webhook-keys.json—The Ed25519 public keys a provisioner verifies the hub’s signed webhooks against (Standard Webhooks v1a).
issuerGET/.well-known/jwks.json—The public keys that verify tokens this hub issued: the active key, any key published ahead of activation, and retiring keys.
issuerGET/.well-known/oauth-authorization-server—The same document as /.well-known/openid-configuration, for RFC 8414 clients.
issuerGET/.well-known/openid-configuration—The workload issuer’s OpenID Connect discovery document.
issuerGET/oauth/authorize—Always refused: this issuer only supports the client credentials grant.
issuerPOST/oauth/token—Exchanges client credentials for a short-lived access token for one resource.
provisioningPOST/api/provision/v1/reservations/{id}/enrollment-tokenworkers:provision:{pool}Fetches the single-use enrollment token for a reservation.
provisioningPOST/api/provision/v1/reservations/{id}/statusworkers:provision:{pool}Reports a provisioning status change.
relayGET/.well-known/aya-relay-keys.json—The Ed25519 public keys (JWKS) that verify relay tickets.
relayPOST/api/relay/auditrelay:auditStores a batch of relay audit events.
relayGET/api/relay/revocationsrelay:syncThe append-only revocation log after a cursor, 500 entries per page.
relayPOST/api/relay/sessions/logoutrelay:syncRevokes a relay session the relay logged out.
relayPOST/api/remote/v1/relay/ticketsrelay:openMints a short-lived bearer ticket for opening a worker service through the relay.
remoteGET/api/remote/v1/auth-info—Names the issuer, token resource and scopes a client needs.
remotePOST/api/remote/v1/chatschat:driveStarts a new chat on a root, idempotently per request_id.
remoteGET/api/remote/v1/machineschat:readLists machines, their roots and whether each is online, plus the known harnesses.
remoteGET/api/remote/v1/roots/{root_id}/projectschat:readLists a root’s project directories with session counts.
remoteGET/api/remote/v1/searchchat:readSearches message text across sessions.
remoteGET/api/remote/v1/sessionschat:readLists sessions.
remoteGET/api/remote/v1/sessions/{pk}chat:readFetches one session.
remoteGET/api/remote/v1/sessions/{pk}/messageschat:readReads a page of a session’s messages, newest first.
remotePOST/api/remote/v1/sessions/{pk}/messageschat:driveQueues a message as a session’s next turn, idempotently per request_id.
remoteGET/api/remote/v1/turns/{id}/eventschat:readReads (and long-polls) a turn’s events.
reservationsGET/api/remote/v1/reservationsworkers:reserveLists the caller’s reservations, newest first, at most 200.
reservationsPOST/api/remote/v1/reservationsworkers:reserveRequests an ephemeral worker from a pool.
reservationsGET/api/remote/v1/reservations/{id}workers:reserveReads one of the caller’s reservations.
reservationsDELETE/api/remote/v1/reservations/{id}workers:reserveCancels or releases a reservation.
reservationsPOST/api/remote/v1/sessions/{pk}/movechat:drive, workers:reserveMoves a session to an active reservation.
workers-adminGET/api/remote/v1/poolsworkers:adminLists pools.
workers-adminGET/api/remote/v1/pools/{id}workers:adminReads a pool document with its version.
workers-adminPUT/api/remote/v1/pools/{id}workers:adminCreates or replaces a pool (GitOps style: the whole document, optimistic version).
workers-adminDELETE/api/remote/v1/pools/{id}workers:adminRetires a pool: no new reservations, existing ones run to their end.
workers-adminPOST/api/remote/v1/principals/{sub}/deprovisionworkers:adminEnds everything a departed principal holds: reservations, workers, pending turns and tokens.
workers-adminPOST/api/remote/v1/principals/{sub}/reinstateworkers:adminLifts a deprovisioning so the principal can reserve workers again.
workers-adminGET/api/remote/v1/workers/clientsworkers:adminLists the issuer’s clients (never their secrets).
workers-adminPOST/api/remote/v1/workers/clientsworkers:adminRegisters a service or static-machine client of the workload issuer.
workers-adminPOST/api/remote/v1/workers/clients/{id}/disableworkers:adminDisables a client and revokes every token it holds.
workers-adminPOST/api/remote/v1/workers/clients/{id}/rotate-secretworkers:adminReplaces a service client’s secret; the old one stops working at once.
workers-adminPOST/api/remote/v1/workers/issuer/keys/rotateworkers:adminRotates the issuer’s signing key: the staged next key becomes active and a new one is staged.
workers-adminGET/api/remote/v1/workers/place-alias-historyworkers:adminEvery alias set, rename and remove, newest first.
workers-adminPUT/api/remote/v1/workers/place-aliases/{alias}workers:adminGives a bound machine an alias (a display and input name; the id never changes).
workers-adminDELETE/api/remote/v1/workers/place-aliases/{alias}workers:adminRemoves an alias.
workers-adminPOST/api/remote/v1/workers/place-aliases/{alias}/renameworkers:adminRenames an alias.
workers-adminGET/api/remote/v1/workers/placesworkers:adminLists every machine place the hub holds a binding, alias or conflict for.
workers-adminGET/api/remote/v1/workers/places/{name}workers:adminResolves a machine id, name or alias to its canonical place.
workers-adminPUT/api/remote/v1/workers/places/{name}/bindingworkers:adminBinds a machine name to an enrolled identity (the operator override of first-report binding).
workers-adminDELETE/api/remote/v1/workers/places/{name}/bindingworkers:adminForgets a machine name’s binding and its conflicts; the next report binds it again.
workers-adminPUT/api/remote/v1/workers/pools/{id}/machines/{mid}workers:adminRegisters or updates a machine of a static pool.
workers-adminPOST/api/remote/v1/workers/pools/{id}/machines/{mid}/reset-completeworkers:adminMarks a machine that needed a reset as clean and available again.
workers-adminPUT/api/remote/v1/workers/root-bindings/{root}workers:adminRebinds an ordinary root to a principal (the operator override of first-come binding).
workers-adminPUT/api/remote/v1/workers/teams/{principal}workers:adminAssigns a principal to a team, which the pool limits and budgets count against.
workers-adminDELETE/api/remote/v1/workers/teams/{principal}workers:adminRemoves a principal’s team assignment, and with it any pool access the team gave.

76 operations, generated from the OpenAPI document.

Error codes

StatusMeaning
400A field fails validation, a request isn’t valid JSON, or a semantically invalid combination (e.g. neither provider nor tier given on turn creation).
401Missing or invalid credential. See Authentication.
403Valid credential, insufficient scope, or (on either integration queue) a non-service-principal subject.
404The referenced turn, session, or job doesn’t exist — or, for either the review queue or the work-run queue, that neither is configured on this hub at all (checked before authentication, so this is the response with or without a token, independently for each of the two).
409A fencing conflict (claim_token/claim_generation mismatch) or a reused batch_id with a different payload — or, once a turn/command is already terminal, one of two different rules depending on the write: an events/progress write against it is 409 for EVERYONE, including its own winning claimant (the stream is closed, permanently); a completion write (done/complete) against it is 409 for anyone except an exact retry from its winning claimant, which stays a 200 no-op instead. On the review queue’s or the work-run queue’s own creation route, 409 also covers the same request_id resubmitted with different input.
413Request body over the route’s size cap.
415Missing or non-JSON Content-Type where a route requires one.
422Syntactically valid JSON that doesn’t match the expected request shape.
500Internal error.
503Two unrelated causes, telling apart which surface you’re on: on the worker-facing routes, agent authentication isn’t configured on this hub at all, and every one of them answers this unconditionally with no auth check performed; on the review queue’s or the work-run queue’s own creation route specifically, it means authentication already succeeded but no worker on this hub could ever execute the resulting turn/run (see Integrate as a dispatcher and Run work through the hub: work runs).

Body shape. An application-level or authentication error is JSON, {"error": "<message>"}. The one exception is a body-decoding failure (bad JSON syntax, a wrong Content-Type, or a body that doesn’t match the expected shape) on most worker-facing write routes: that class of failure answers with a plain-text body instead of JSON, before any application-level check runs — the review and work-run creation routes are the write routes that stay JSON even for a malformed body. The operation table above doesn’t carry per-status body types; the interactive reference and the raw spec do, declaring text/plain explicitly on exactly the status codes this affects, operation by operation.

Versioning

The spec carries a single version string covering the whole surface as one unit — there’s no per-operation versioning. Additive changes (a new operation, a new optional field, a widened response type) ship without notice; a breaking change bumps the spec’s own version. Re-read the spec whenever you upgrade against a new one.