The developerz.ai REST API is served at https://api.developerz.ai.
Most of what it does is also reachable over the
MCP server, so use whichever fits your client. Claude Code and
Claude Desktop connect over MCP; scripts and CI workflows typically use REST. The
two surfaces are not yet a mirror image of each other: the Capability column
below is the id they share, so comparing it against the
MCP verb list tells you which of the two serves what you need.
Authentication
Create a personal access token (PAT) in the dashboard under
Settings → API tokens, then pass it as a bearer token:
curl https://api.developerz.ai/v1/me \
-H "Authorization: Bearer dev_pat_…"
Tokens are scoped at creation time. See Scopes below.
PAT capability asymmetries
Multi-org context: The dashboard UI session can switch organizations, toggling which org a request sees via the X-Dz-Account header. PATs ignore that header: a token minted in one account stays bound to that account for its entire lifetime. The header is membership-fenced before any route runs on UI sessions, never trusted from a PAT request. If you call REST across multiple organizations, issue a separate PAT in each one. MCP is different: one connection reaches every account you belong to through the per-call account argument (see Several accounts).
Personal-only surfaces: The subroutes under /v1/me/ (personal keys, preferences, system prompt) and the routes under /v1/notifications* (inbox, preferences) need a human behind the credential, because "me" has to resolve to somebody. What decides that is whether the token names a user, not that it is a token: a PAT you mint while signed in carries your user id and reaches your own personal data as you, while a token with no human behind it (a box connection token, or a PAT minted before tokens recorded their minter) returns 403 Forbidden on all of them. GET /v1/me is not in that set and always answers: it is the self-check, and it reports the calling credential's own scopes.
Base URL
https://api.developerz.ai
Every path below is absolute and carries its own prefix. The capability surface
is versioned under /v1; the handful of routes that are not (/join,
/unsubscribe, /gh/installed) are the unversioned legs a
browser, a mail client or a fresh box hits without a bearer token.
Collections
Every endpoint that returns a list answers one envelope, so you write one pager
and it works everywhere:
{ "data": [ ... ], "next_cursor": "b3AxMDA" }
Send next_cursor straight back as ?cursor= and never parse it: it is opaque
and its internals will change. ?per_page= sets the page size, and a value above
a collection's maximum is refused rather than quietly clamped, so you always know
what you asked for is what you got.
Paging is keyset. A cursor names a position in the collection, not a row count to
skip, so it carries the order it was minted under and the sort keys of the last
row it gave you. Two things follow. A bare ?cursor= is enough: you do not have
to repeat the sort or the per_page that produced it, and changing per_page
mid walk continues from the same row instead of rebasing. And rows written while
you page never shift the ones you have not read yet, which is what an offset
could not promise.
There is no ?page=. A page number is an offset by another name, and on a
collection anything is appending to it re-serves rows you already have. Sending
one is refused by name rather than ignored, and the error points at
next_cursor. Re-sending the same ?sort= alongside a cursor is fine, since a
generic pager appends its base parameters to every request; sending a different
one is a 400, because the keys you are holding address a place in the old order.
next_cursor: null means there is nothing after this page. That is a promise, not
a placeholder. Some collections are always served in full (your org roster, the
connectors on an account, the notification category matrix) and those answer
null every time and take no paging parameters at all. Any collection that could
truncate hands you a real cursor instead, so a null never hides rows you have
not seen.
Two endpoints are the exception and say so in their own description: GET /v1/sessions
and GET /v1/prs/pending-approvals are bounded summary views behind ?limit=, so a full
page there can mean more rows exist and no cursor reaches them. Narrow the request rather
than paging it. Everything else keeps the promise above.
?per_page= is the page-size parameter. ?limit= was an older spelling of it on
the endpoints that published both, and it is gone: send it and the call is a 400
whose detail names per_page as the replacement, rather than being quietly
ignored. Three reads spell their page size limit and keep it, because they never
had a ?per_page= beside it and it is their own canonical knob:
GET /v1/sessions, GET /v1/prs/pending-approvals and GET /v1/digests.
Endpoints
Generated from the route table the app mounts, so this list cannot drift from
what is running. It covers every capability endpoint; the browser login legs
(/auth/* and the OAuth callbacks) are not here because they mint a credential
rather than spend one.
The Scope column carries what a caller must present. A scope in backticks is
asserted by the route. no bearer marks a route mounted before the token guard,
whose description names what authorizes it instead (a signed link, a one-time
enrollment token, a webhook signature). per request marks a route that
authorizes each call inside its handler, so it publishes no single floor.
POST /v1/sessions/:id/replay (under Sessions) has a page of its own, with a
runnable example, the diff it returns and when it refuses:
Policy replay.
Account
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/me |
account.me |
read:account |
Identity + self-check: the scopes this credential holds, plus user (with the declared region, ISO 3166-1 alpha-2), every membership (each with reachable, whether THIS session may act there; the signIn leg that adds an unreachable one to the session, and the org's linkable sso IdP with whether the human holds that identity), active account, tos, whats_new (latest_day, seen_day and unseen_days, the What's new release days after the person's seen mark), approved (the closed-beta TRI-STATE: true cleared it, false is waitlisted, null means this credential names no human to approve; absent or null is never a refusal), sso_pinned (true when this session is pinned to the SSO org it signed in through, so /v1/me/github-token refuses it: sign in with GitHub instead), and cross_border_consent (the SEPARATE PIPL consent a CN user owes: missing is the SERVER's verdict that this session is capped for it). |
POST |
/v1/me/active-account |
account.active_account_switch |
read:account |
Repoint the live user session at a member account. |
POST |
/v1/me/accept-tos |
account.accept_tos |
read:account |
Record the signed-in user's Terms of Service consent. |
POST |
/v1/me/region |
account.region_set |
read:account |
Declare the signed-in person's region (ISO 3166-1 alpha-2). CN (mainland China) owes the separate cross-border consent. Browser session only. |
POST |
/v1/me/consents |
account.consent_set |
read:account |
Grant or withdraw one of the signed-in person's separate consents (cross_border_cn), echoing the notice version shown. A withdrawal with no live grant is a 409. Browser session only. |
GET |
/v1/me/identities |
account.identity_list |
read:account |
The signed-in user's logins: the GitHub anchor (id github, never removable) and each linked SSO identity, with the org whose connection verified it, the asserted email, when it was linked, and removable (unlinking it would leave the user at least one credential, and this session may unlink it). Never the IdP subject. |
DELETE |
/v1/me/identities/:id |
account.identity_unlink |
write:self:identity |
Unlink one of the signed-in user's SSO logins, from a signed-in browser session only. 204 on success; 404 when it is not this user's; 409 problem+json with code: 'last_credential' when it is the user's only way to sign in, or code: 'github_anchor' for the GitHub login. A session an org's SSO signed in may unlink only that org's logins. |
GET |
/v1/me/link-candidates |
account.link_candidates |
read:account |
Users the signed-in user may bind to their own by email proof: SSO-only users of an organization the caller already belongs to, holding one login through that organization's SSO and no membership elsewhere, whose verified email equals one of the caller's GitHub- or platform-verified emails. Each with its id, login handle, the matching address (the caller's own), provider (oidc or saml) and org (the shared organization's login). Nothing about any other organization, and never an IdP subject. |
POST |
/v1/me/link-requests |
account.link_request |
write:self:identity |
Mail a single-use link, valid 30 minutes, to the address the caller shares with one of their link candidates ({ user_id }); opening it from this same signed-in browser merges that user into the caller inside the shared organization. Signed-in browser session only. 202 { sentTo, expiresAt }; problem+json with a code: 404 not_a_candidate, 429 rate_limited (per: requester, 5 an hour per user, or per: address, 3 a day per address across requesters), 502 send_failed. |
GET |
/v1/accounts/:id/posture |
account.posture_get |
read:account |
The account’s maintenance posture: standard (a repo with no committed policy is hands-off) or maintain (every installed repo is served on the maintain default). 404 for any account but the caller’s. |
PUT |
/v1/accounts/:id/posture |
account.posture_set |
write:merge:gate |
Set the account’s maintenance posture, {"posture": "standard" | "maintain"} (owner or admin). Enables no repo by itself. Answers changed: false on a no-op set, which is still audited (account.posture_changed). |
GET |
/v1/admin/overview |
account.platform_overview |
admin:read:platform |
Platform radar rollup (staff read). |
GET |
/v1/admin/hive |
account.platform_hive |
admin:read:platform |
What every fan-out lane reports about itself over the trailing window (staff read): how often a lead dispatched more than one member, how much of the round it then spent idle, how many members it could steer and how many it did, and what it falsified. A graded rate carries its own n / d, and a rate over an empty denominator carries the same counts with d at zero rather than reading 0%; a metric the lane payload does not carry is not_on_contract, which carries no counts at all, and a row an older runner wrote lands in unparseable with the keys it could not satisfy and the time it was last written. |
GET |
/v1/admin/audit |
account.platform_audit |
admin:read:platform |
Platform-wide audit feed (staff read). The account-scoped feed is /v1/audit/events. |
GET |
/v1/admin/platform-audit |
account.platform_trail |
admin:read:platform |
The platform-admin trail: every operator read of a tenant’s data, naming who looked, whose data, which run or account, and when. The other half of account.platform_audit, which records what the platform did FOR a tenant; this records what it did TO one. Keyset-paged, newest-first. |
GET |
/v1/admin/goals |
account.platform_goals |
admin:read:platform |
The platform's own goal board (staff read): every milestone and type/epic issue, graded from live GitHub state with a status, an item-weighted percent, and days since anything last closed. Answers 503 with a named reason rather than an empty board when it cannot be read. |
PATCH |
/v1/admin/goals/:id |
account.platform_goal_rename |
admin:goals |
Rename one goal, writing THROUGH to GitHub: the milestone or type/epic issue is retitled at the source, and nothing is stored here. Its own scope, so a staff radar session can read the board without being able to retitle it. 422 on an id this board never mints, 404 on one GitHub does not have, 503 when GitHub cannot be reached. |
GET |
/v1/admin/accounts |
account.orgs_list |
admin:read:orgs |
All org accounts (staff read), newest-first. q searches the GitHub login; filter=billing:paying|comped|paused narrows to the paying, comped or paused accounts, and omitting it reads every org. |
GET |
/v1/admin/accounts/:id |
account.org_get |
admin:read:orgs |
One account in detail (staff read). |
GET |
/v1/admin/users |
account.users_list |
admin:read:users |
All users (staff read), newest-first. q searches the login; filter=status:approved|waitlisted narrows by approval state, and omitting it reads the whole roster. |
GET |
/v1/admin/oss-verifications |
account.oss_verify_list |
admin:read:orgs |
The queued OSS-verified applications (staff read). Defaults to filter=status:pending (the queue proper); filter=status:all reads decided history, and an unknown value is a 400 rather than a silent fallback. Ruling on one is operator-only, over MCP. |
GET |
/v1/admin/users/:id |
account.user_get |
admin:read:users |
One person in detail (staff read): the registry row, when they were last active (the later of their newest sign-in and newest token use), every org they belong to with their role and the org’s kind, and the first page of their grant history with each grant’s resolved active. Trailed as a tenant read. |
PATCH |
/v1/admin/accounts/:id/members/:userId |
account.set_member_role |
admin:accounts |
Operator only: set one member’s role in any org. Staff need no membership there, but an org never loses its last owner: demoting it answers 409 with reason: last_owner. 404 when the account does not exist or the user is not a member of it. Audited on the org’s own feed as org_member.role_changed, naming the operator and the previous role. |
PUT |
/v1/admin/accounts/:id/tier |
account.set_tier |
admin:accounts |
Operator only: set any account’s tier. oss_verified stamps the OSS review date (an existing one is kept); any other tier clears it. Requires confirm: true. 404 when no account has the id. Audited on the account’s own feed as account.set_tier, naming the operator. |
PUT |
/v1/admin/accounts/:id/seats |
account.set_seats |
admin:accounts |
Operator only: set any account’s paid AI-dev seat count (an integer, 0 or more). Requires confirm: true. 404 when no account has the id. Audited on the account’s own feed as account.set_seats, naming the operator. |
PUT |
/v1/admin/accounts/:id/spend-cap |
account.set_spend_cap |
admin:accounts |
Operator only: set any account’s monthly spend cap in USD. Positive, or null to reset to the default; 0 is refused. Requires confirm: true. 404 when no account has the id. Audited on the account’s own feed as account.set_spend_cap, naming the operator. |
POST |
/v1/admin/oss-verifications/:id/decide |
account.oss_verify_decide |
admin:accounts |
Operator only: rule on a pending OSS-verified application. approve also moves the account to oss_verified in the same transaction and mails the applicant; reject requires a note, which the applicant is shown. Requires confirm: true. 404 when no PENDING application has the id: unknown and already-decided are one answer. Audited on the applicant’s feed as account.oss_verify_decide, naming the operator. |
POST |
/v1/admin/accounts/:id/repos/:owner/:repo/backlog-import |
account.backlog_import |
admin:accounts |
Operator only: run the GitHub backlog import again for a repository the account has ENABLED. Each open issue not already filed becomes an ask for triage, under the same bounds and opt-in as the first-enable import. Requires confirm: true. 202 with job_id. 409 with reason: import_in_flight when a run is already queued or running at the time of the call; two calls racing in the same instant can both answer 202 with the same job_id, and one job runs. 404 when the account holds no repository by that name; 409 with reason: repo_disabled when it is switched off. Audited on the account’s own feed as backlog.import_requested, naming the operator, before the job is queued. |
GET |
/v1/admin/fleet/runs/:runId |
account.platform_run_get |
admin:read:runs |
One agent run’s pulse, whichever account owns it; the owning org is resolved server-side and returned. The cross-tenant debugging read: an ordinary run read is fenced to your own account, and platform staff need to diagnose a run belonging to a customer they are not a member of. A run this platform does not hold is a 404 that discloses nothing and trails nothing; every call that RESOLVES an owner appends a trail row before it answers. |
GET |
/v1/admin/fleet/runs/:runId/events |
account.platform_run_tail |
admin:read:runs |
SSE: one agent run’s durable event transcript, whichever account owns it. Backfill, tail, terminate, the same stream task.run_tail serves a tenant, with the owner resolved server-side. Not resumable: Last-Event-ID is refused rather than ignored, and that 400 is answered before the run is resolved. Every call that RESOLVES an owner appends a trail row before the first frame. |
GET |
/v1/next-steps |
account.next_steps |
per request |
What still stands between this credential and a first scout call, as an ordered ladder of rungs. Each rung carries the fact it was decided from and WHERE it clears, so a rung no verb can move is never retried. Pass ?repo=owner/repo to ask about ONE repo: the same ladder narrowed to it, plus whether it is onboarded and whether its stored secrets sit where a lane is handed them. With repo the answer also carries a maintenance block (absent without it): whether that repo is fully AI-maintained, graded as its own ordered rungs that never move ready, and once it is, the next enabled repo to bring there. Every rung is reported every time, passing ones included; a rung whose fact sits behind a scope you do not hold reports unknown naming that scope rather than passing. The same answer the next_steps MCP verb serves, from the same implementation. |
GET |
/v1/oss/verification |
account.oss_verification_get |
read:billing |
This account's latest OSS-verified application, or null. |
POST |
/v1/oss/verification |
account.oss_verification_apply |
write:billing |
Apply for OSS-verified. Amends the open ask while pending, 409 once approved. It grants nothing by itself: the verdict is operator-only. |
GET |
/v1/external-bans |
account.ban_list |
read:account |
Outside GitHub authors banned on this account, each with what the ban rests on: the item, the digest of the text read, the model and the profile signals. Keyset-paged by next_cursor. |
POST |
/v1/external-bans |
account.ban_add |
write:merge:gate |
Ban an outside GitHub author on this account, by numeric id, with an audited reason. Their future pull requests and issues close unread on repos the bot maintains. Their merged pull requests are queued for a second look. A repo developer is never closed, whatever a list says. |
GET |
/v1/external-bans/rereviews |
account.ban_rereviews |
read:account |
This account's banned authors' merged pull requests and the ask each became: raw_task_id is null while it waits. Keyset-paged by next_cursor. |
DELETE |
/v1/external-bans/:githubUserId |
account.ban_remove |
write:merge:gate |
The appeal door: lift this account's ban, naming why in reason, which goes on the audit trail. The verdict stops counting toward the shared list. 409 when only the shared list holds the author. |
GET |
/v1/admin/external-bans |
account.ban_shared_list |
admin:read:orgs |
Staff: the ban list shared across accounts. Each entry is an id and a mechanism, and holds nothing of any account. |
POST |
/v1/admin/external-bans |
account.ban_shared_add |
admin:accounts |
Staff: enter an author on the shared list directly, naming them by numeric id with an audited reason. Every account's maintained repos then close their items unread. |
DELETE |
/v1/admin/external-bans/:githubUserId |
account.ban_shared_remove |
admin:accounts |
Staff: the shared list's appeal door, with an audited reason. Its witnesses go too, so the next verdict starts a fresh count. |
Overview
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/overview/counts |
overview.counts |
read:prs |
Account-wide headline counts: enabled repositories, open pull requests, pull requests merged since the most recent 14:00 UTC (22:00 Asia/Manila, the daily standup cutoff), pending ask-before-acting approvals, and open blockers (null without read:tasks). Takes no query parameters; any is a 400. |
GET |
/v1/overview/burn |
overview.burn |
read:sessions |
Recorded agent-session cost over the last hour, account-wide: a decimal USD string summing only prices that may be shown as a cost (null when no displayable cost exists in the window; a client may show that as zero only when the session count is 0, never when sessions ran), the session count, and how many of those sessions spent without such a price. A recorded estimate on your own keys, not a bill. Takes no query parameters; any is a 400. |
GET |
/v1/overview/trends |
overview.trends |
read:tasks |
How dz performed per UTC day over the last 7, 14 or 30 days and the window of the same length before it: pull requests merged (ours, other bots, people), tasks landed, rework, wasted and still pending, failed tasks, cost on two named bases (billed, list price), tokens and prompt-cache reads, run-duration and dispatch-wait medians, open-to-merge median and blockers raised; plus each window’s totals with the landed share over graded tasks (pending excluded), and the current window’s mix by status, failure kind, lane and model. |
GET |
/v1/overview/scoreboard |
overview.scoreboard |
read:tasks |
The account’s usefulness scoreboard over the 14 UTC days the nightly rollup re-grades: landed, rework, wasted and pending, tokens, recorded cost, first-gate reds and the dispatch-wait median per ask source, lane and repository language, each with its denominator; plus merged pull requests (bot share, open-to-merge median), incidents fixed with no person and the first-claim dispatch wait split by phase, over the same days; merged pull requests and the person touches on them over the last 7 of those days (human touches per 100 merges, the share of our merges no person touched); post-deploy fence grades by verdict and the share of the agent’s shell commands that exited non-zero, over the window; our review findings graded per lens on pull requests settled from the first day through now; and open work past the 60-day stale default, now, its pull requests split into ours and everyone else’s. |
GET |
/v1/overview/security |
overview.security |
read:repos |
The account’s open security exposure: one finding per vulnerability the security watch holds open, exploited first and then by first-tier severity, each with the repositories it is open on, the version each runs (a committed file or a running workload), the fixed version or that none is published, the fix ask when one is filed, and how long it has stood. counts.unknown are products a repository runs at a version nothing could place: not clean and not confirmed. truncated says more rows are open than were read. |
Post-deploy fence grades
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/fence-grades |
fence_grade.record |
write:fence:grades |
Store one post-deploy ## Live test fence verdict on a repository of the account (the CI grader’s door). Idempotent per (repo, issue, sha): 200 { outcome: "written" } stores and audits it; 200 { outcome: "kept_newer" } when a newer grade of that sha is already stored, changing nothing; 404 for a repository the account does not hold. |
Personal settings
| Method |
Path |
Capability |
Scope |
Description |
PATCH |
/v1/me/keys/:id/capacity |
self.key_capacity_set |
write:self:keys |
Declare a personal key’s concurrency capacity: model streams it sustains at once, an integer in [1, 256]; null clears it (the default for its kind applies). |
PATCH |
/v1/me/keys/:id/agents |
self.key_agents_set |
write:self:keys |
Set which agents may never use the caller’s personal key (disabled_agents, [] = every agent on). Same body, dry run and 409 byok-key-agents-last-key as the org door, over the caller’s own pool; pinned_routes_affected is always empty here (route pins name org keys). |
PATCH |
/v1/me/keys/:id/active |
self.key_active_set |
write:self:keys |
Pause or resume the caller’s personal key, the org door’s body and answers over the caller’s own pool. |
GET |
/v1/me/keys |
self.keys_list |
write:self:keys |
List the caller’s PERSONAL BYOK keys, masked. The org pool is /v1/billing/keys. |
POST |
/v1/me/keys |
self.key_add |
write:self:keys |
Add a personal BYOK key, sealed on write and never echoed back. |
POST |
/v1/me/keys/models |
self.provider_models |
write:self:keys |
List the models a provider key can address, before a PERSONAL key is captured. The key rides in the body and is never stored; the org pool’s door is /v1/billing/providers/models. |
POST |
/v1/me/keys/:id/verify |
self.key_verify |
write:self:keys |
Verify a personal key against its provider (live probe). |
POST |
/v1/me/keys/:id/rotate |
self.key_rotate |
write:self:keys |
Replace a personal key’s secret in place, keeping its id. |
DELETE |
/v1/me/keys/:id |
self.key_delete |
write:self:keys |
Delete a personal BYOK key. |
PATCH |
/v1/me/keys/:id/kind |
self.key_kind_set |
write:self:keys |
Re-stamp a personal key’s billing nature (subscription ⇄ metered). |
PATCH |
/v1/me/keys/:id/priority |
self.key_priority_set |
write:self:keys |
Set a personal key’s pool priority: an integer in [0, 10000], LOWER is tried first (new keys rank last). |
GET |
/v1/me/llm-pref |
self.llm_pref_get |
write:self:keys |
The caller’s personal model preference. |
PUT |
/v1/me/llm-pref |
self.llm_pref_set |
write:self:keys |
Set the caller’s personal model preference. |
DELETE |
/v1/me/llm-pref |
self.llm_pref_clear |
write:self:keys |
Clear it, back to the account default. |
GET |
/v1/me/github-token |
self.github_token_get |
write:self:keys |
Whether a personal GitHub token is connected, its expiry and repo grants. Status only; the token is never echoed. |
POST |
/v1/me/github-token |
self.github_token_set |
write:self:keys |
Connect a personal GitHub token, sealed on write. |
DELETE |
/v1/me/github-token |
self.github_token_clear |
write:self:keys |
Disconnect it. |
GET |
/v1/me/repo-bindings |
self.repo_binding_list |
write:self:keys |
The repos on this account you drive with your own GitHub token (the user-token lane). |
POST |
/v1/me/repo-bindings |
self.repo_binding_set |
write:self:keys |
Drive a repo with your own connected GitHub token instead of the GitHub App. The repo must be in the token’s allowlist and writable by it. |
DELETE |
/v1/me/repo-bindings/:owner/:repo |
self.repo_binding_clear |
write:self:keys |
Stop driving a repo with your own GitHub token. |
GET |
/v1/me/ui-settings |
self.ui_settings_get |
read:account |
Your own dashboard view choices on this account: keys_view, the view the AI keys page opens in, or null for no setting (the legacy page). |
PUT |
/v1/me/ui-settings |
self.ui_settings_set |
write:self:ui |
Save your own view of the AI keys page on this account (legacy, cards, chain or split); null clears it. Every role may, viewers included. |
POST |
/v1/me/whats-new/seen |
self.whats_new_seen |
write:self:ui |
Mark the What's new release of day seen by you: your watermark moves forward to it and never back, and via (reload, skip or archive) says how. Answers the stored seen_day, which may be later than day. A day with no published release is refused. |
GET |
/v1/me/system-prompt |
self.system_prompt_get |
write:self:prompt |
The caller’s personal system prompt. |
PUT |
/v1/me/system-prompt |
self.system_prompt_set |
write:self:prompt |
Set it. |
DELETE |
/v1/me/system-prompt |
self.system_prompt_clear |
write:self:prompt |
Clear it. |
What's new
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/admin/whats-new/:day/regenerate |
whats_new.regenerate |
admin:whatsnew |
Platform operator only (admin:whatsnew): run the What's new release-notes session for one closed UTC day again, for every user. Any closed day, including days before the nightly lane began. Publishing replaces the day atomically. 202 with job_id. 400 for a value that is not a real day; 409 day_not_closed while the UTC day is still open, 409 day_in_flight while that day's run is queued or running. Audited on the platform trail as whats_new.regenerate_requested. |
DELETE |
/v1/admin/whats-new/:day |
whats_new.withdraw |
admin:whatsnew |
Platform operator only (admin:whatsnew): withdraw one published day of What's new release notes, for every user. In one transaction it removes the day, its items and every locale's text, and records the day as settled so the nightly run does not write it again; a later regenerate can republish it. 200 with the count of items removed. 400 for a value that is not a real day; 404 when the day has no published release. Audited on the platform trail as whats_new.withdrawn. |
GET |
/v1/whats-new |
whats_new.list |
read:account |
The dashboard's daily release notes, newest day first, in the asked locale (required: en, es or zh). Each day carries version (v plus the UTC day), build_sha, shipped_at, headline, counts per group and its items in group order, each naming who it came from and who built it. A member of the platform org also gets each item's origin_issue, pr_numbers and task_refs (each platform task that opened one of its PRs: task_id, run_id, account_login). |
GET |
/v1/whats-new/:day |
whats_new.get |
read:account |
One release day (YYYY-MM-DD, UTC) in the asked locale (required: en, es or zh), the same shape as a row of GET /v1/whats-new. A day with no published release is a 404. |
API tokens
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/tokens |
token.mint |
write:tasks |
Mint a dev_pat_… PAT with scopes ⊆ mintable_scopes. The plaintext is returned exactly ONCE; only its hash is stored. Body-less mints the caller’s whole mintable set. name is an optional human label: every PAT carries the same prefix, so it is the only field that CAN tell two apart afterwards. Absent leaves the token unnamed; names need not be unique. |
GET |
/v1/tokens |
token.list |
read:account |
PATs THIS caller reaches (an owner: the account’s; anyone else: its own), masked, revoked rows included, each with its expires_iso (null ⇒ permanent) and can_manage (may this caller rename/revoke it), plus mintable_scopes: the exact vocabulary this caller may mint. Empty ⇒ it cannot mint. |
PATCH |
/v1/tokens/:id |
token.rename |
write:tasks |
Relabel a PAT. Moves the human name and nothing else (no scope, no expiry, no revocation state), and a revoked row is renameable so a roster stays readable. |
DELETE |
/v1/tokens/:id |
token.revoke |
write:tasks |
Revoke a PAT (idempotent). An owner revokes any of the account’s; anyone else only its own, and another person’s id answers 404. |
Operator credentials
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/admin/operator-tokens |
operator_token.issue |
admin:read:platform |
Issue a short-lived platform-operator credential carrying one or more of the admin:* WRITE scopes (users, accounts, grants, goals, releases, whatsnew), or admin:bugs (the staff bug-report scope a staff session already holds, issued here so a CLI can use it). The only door to them on a token: no role ceiling grants one and POST /v1/tokens mints none. Requires a signed-in platform admin, because a token cannot issue another, which is what makes the TTL a bound rather than a formality. The session must have signed in within the last hour (step-up): an older one is refused 403 reauth-required and must sign in again, because a stolen cookie is replayed later than its login. scopes and name are both REQUIRED (there is no "give me the operator token" request, and a credential nobody can account for is worse than none). The plaintext is returned exactly ONCE; the row lands on the issuer’s own token roster, so GET /v1/tokens lists it and DELETE /v1/tokens/:id revokes it. |
Agent credentials
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/admin/agent-tokens |
agent_token.mint |
admin:users |
Mint a token an agent holds on a person’s behalf: bound to the person named by login (a github.com login), user_id (any forge; the only way to name a GitLab / JiHu person, and the way out of an ambiguous_login), or both (the id names the person, the login must be theirs or it is login_mismatch), capped by that person’s role, labelled, and dying at the required expires_at, at most 24 hours out. Every audit row the token writes says "agent <label> for <login>". scopes is required and admin:* is refused. The mint and its audit row are one transaction; the plaintext is returned exactly once. Refusals are a 422 naming refusal. A token held by an agent cannot mint another. |
Org members
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/org/members |
member.list |
read:account |
The org’s members and their roles. |
POST |
/v1/org/members |
member.invite |
write:members |
Invite someone to the org by login (an already-registered user, added to the roster at once) or by email (anyone: a one-time invitation link, also mailed to them). |
PATCH |
/v1/org/members/:userId |
member.set_role |
write:members |
Change one member’s role. |
DELETE |
/v1/org/members/:userId |
member.remove |
write:members |
Remove a member from the org. |
GET |
/v1/org/members/invitations |
member.list_invitations |
read:account |
The org’s org_member invitations, every status, newest first. |
DELETE |
/v1/org/members/invitations/:invitationId |
member.revoke_invitation |
write:members |
Withdraw one PENDING invitation (idempotent). Refuses an already-accepted one; remove the member instead. |
Access requests
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/access-requests |
access_request.create |
no bearer |
Record a waitlist application (the marketing form’s write path, over the shared service bearer). The row is written first, then the applicant is mailed a confirmation; a mail failure never loses the application. A live address applies once: a re-submission folds onto its pending row and answers 200 with the same id. |
GET |
/v1/admin/access-requests |
access_request.list |
admin:read:users |
The waitlist applications, newest first (staff read). filter=status:pending is the queue and the default; invited, declined or all read the decided history. q searches email, name and org. |
GET |
/v1/admin/access-requests/:id |
access_request.get |
admin:read:users |
One waitlist application by id (staff read), with its derived status. |
POST |
/v1/admin/access-requests/:id/invite |
access_request.invite |
admin:grants |
Operator only (admin:grants AND admin:users): let one applicant in. Mints or re-arms their platform invitation and mails it, approves them if they already signed in, and books the starter bundle: ai_devs free AI developers for expires_in_days days (the box budget follows from that count). Every knob defaults to the standard bundle, so {} is the one-click path. Answers the provision result: the accept link is shown ONCE, here. |
POST |
/v1/admin/access-requests/:id/decline |
access_request.decline |
admin:users |
Operator only: decline one pending application. Stamps the decision; an optional reason lands on the audit row only. Nothing is sent to the applicant. An already-decided request answers 409 naming the standing decision. |
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/admin/users/:userId/approve |
user.approve_by_id |
admin:grants |
Operator only (admin:grants AND admin:users): grant one user the default invite bundle unless they hold a live capacity grant, THEN lift their closed-beta waitlist cap. grants answers what they hold and boxes the box budget it buys. A refused bundle is a 422 and approves nothing. Idempotent: an already-approved, already-funded user answers already_approved with their live grants; a fresh approval mails them. |
POST |
/v1/admin/users/:userId/suspend |
user.suspend_by_id |
admin:users |
Operator only: drop one user back to the closed-beta waitlist cap by id (clears their approval; their sessions read read:account on the next request). Idempotent: an already-waitlisted user answers already_waitlisted. The caller’s own user row is refused with a 409 self-suspend problem and nothing is written. |
Invitations
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/invitations/accept |
invitation.accept |
read:account |
Redeem an invitation token for the signed-in identity. Grants platform access or the invited org membership, and answers a named reason when it grants nothing. |
GET |
/v1/admin/invitations |
invitation.list |
admin:read:users |
Platform invitations, newest first, with their derived status and never a link (staff read). Keyset-paged (per_page, cursor); filter=status:<pending|accepted|revoked|expired> narrows it before the page is cut, all (the default) reads every status, and q searches the address. |
POST |
/v1/admin/invitations/:invitationId/revoke |
invitation.revoke |
admin:users |
Operator only: withdraw one platform invitation. An already-revoked one answers 200 revoked: false with the earlier stamp; an accepted one is a 409, since revoking it would not take the access back. |
POST |
/v1/admin/invitations/:invitationId/resend |
invitation.resend |
admin:users |
Operator only: a fresh link and a fresh mail for a pending or expired platform invitation: the same address and the same promise, re-armed, so the old link dies. The accept link is shown ONCE, here. An accepted or revoked invitation is a 409. |
Org SSO
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/org-sso |
org_sso.get |
read:account |
The org’s SSO configuration. |
PUT |
/v1/org-sso |
org_sso.set |
write:account |
Set the org’s OIDC configuration. A SAML body is refused with a 400: those connections are seed-provisioned for now. The browser login legs are separate, unversioned routes. |
DELETE |
/v1/org-sso |
org_sso.delete |
write:account |
Delete it; the org falls back to platform login. |
Repositories
| Method |
Path |
Capability |
Scope |
Description |
GET |
/gh/installed |
project.install_landing |
no bearer |
The GitHub App Setup URL, where GitHub drops the human after an install. No bearer, and it provisions nothing: the install webhook stays the only writer of accounts and repos. |
GET |
/v1/public/oss/:owner/:repo/stats |
project.public_stats |
no bearer |
Public activity and agent-authored counts for ONE enabled, public repo with donations on and/or public_stats_enabled (the owner consent). No bearer. The donation fields need the donations opt-in; agent_authored needs the public-stats consent. The gate is re-run on every positive hit of the in-process cache, so the API stops serving a repo that goes private or loses its last gate flag at once; the response carries Cache-Control max-age 60, so a browser or shared cache can hold one body that long. agent_authored counts merged and reverted pull requests opened by a platform task or by the plan-files documents lane over the last 30 days; release-bump pull requests are not counted. human_approved_30d counts those merged pull requests whose merge ask was approved on the approvals plane (any write:prs credential). days_since_human_commit is the age of the newest merged pull request with a non-bot author flag that no platform task authored, so a direct push to the default branch is not seen. |
GET |
/v1/repos |
project.list |
read:repos |
The account’s repositories with enabled state; rows carry policy_valid and last activity. |
POST |
/v1/repos |
project.create |
write:repos |
Mint a brand-new repo under the account org from the versioned gold-standard template, then dispatch the setup session that scaffolds it. Answers the created repo, the artifact manifest and a scaffold_task_id which may be null: the repo exists either way, so a failed dispatch is reported rather than thrown. Present only where the deployment holds GitHub App credentials. |
GET |
/v1/repos/:owner/:repo |
project.get |
read:repos |
One repository by owner/repo, or a GitLab path with ?forge= + ?instance=. |
PATCH |
/v1/repos/:owner/:repo{.+} |
project.update |
write:repos |
Flip a repo’s owner switches: enabled, donations_enabled, ai_first, canary_enabled, public_stats_enabled, mcp_stdio_trusted (owner role only, else 403). At least one is required and an absent field is untouched state. Enabling a private repo on a plan that does not cover it is a 402 naming the way out, never a 403. A connected GitLab project is addressed by its full path (/v1/repos/group/sub/project) with forge: "gitlab" and its instance in the body; only enabled is served for it. |
GET |
/v1/repos/:owner/:repo/policy |
project.policy_get |
read:repos |
The effective maintainer.yml policy, plus fallback: null, or why it fell back. |
GET |
/v1/repos/:owner/:repo/merge-override |
project.merge_override_get |
read:repos |
The repo’s platform-side merge hold: auto_merge: false with set_by / set_at when a person held its merges for review, auto_merge: null when it follows its .maintainer.yml; file_allows says whether the file itself would auto-merge. |
PUT |
/v1/repos/:owner/:repo/merge-override |
project.set_merge_override |
write:merge:gate |
{ "auto_merge": false } holds the repo’s merges for review (a second hold keeps the first setter); { "auto_merge": true } clears it and asks babysit for a pass of each PR the hold parked. The hold only tightens: clearing where the file would not auto-merge is a 409 override_cannot_loosen naming why. |
GET |
/v1/repos/:owner/:repo/overview |
project.overview |
read:repos |
Activity rollup for one enabled repo (the repo-detail Overview tab). |
GET |
/v1/repos/:owner/:repo/settings |
project.settings |
read:repos |
Settings view for one enabled repo (the repo-detail Settings tab). |
POST |
/v1/repos/:owner/:repo/policy/validate |
project.policy_validate |
write:repos |
Check a maintainer.yml body: {yml} in, ok or errors out. Stores nothing. |
POST |
/v1/repos/:owner/:repo/setup |
project.setup |
write:tasks |
Point a box at a repo that already exists and have it audit the project and establish its base (stack detect, the one-command DX scripts, .mcp.json, a project brain). 202 with the dispatched task_id. It rides write:tasks, not write:repos: a credential that may enable a repo is not thereby allowed to spend the account’s inference budget on it. |
POST |
/v1/repos/:owner/:repo/ask |
project.ask |
read:repos |
Ask a question about one enabled repo, answered from grounded evidence with citations. A body of {question}; the answer is never uncited, so {refused: true, reason} at 200 is the capability working rather than a failure. |
GET |
/v1/repos/:owner/:repo/health |
project.health |
read:tasks |
One repo’s graded health over a window: every SLO ok / warn / bad / no_data with its numerator, denominator and window, and the single worst bottleneck. Also needs read:prs; the live key pool rides with read:runners. |
Repo enablement (where and how, at scale)
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/repo-enablement |
repo_enablement.list |
read:repos |
Every repository the account holds, on or off, in full_name order: a keyset page with search (q) and filters (language, topic, visibility, enabled, active_within_days). The first page also answers matching, how many repositories the filter selects. |
GET |
/v1/repo-enablement/facets |
repo_enablement.facets |
read:repos |
The languages and topics this account’s repositories carry, with their counts. |
POST |
/v1/repo-enablement/bulk |
repo_enablement.bulk |
write:repos |
Enable or disable a selection as one act, each repository gated and audited on its own. dry_run: true counts and changes nothing; acting takes expected_count, and a selection that no longer holds that count is a 409. An enable takes a recipe and queues setup at the answered pace. A call that answers next_cursor stopped at its time bound: re-send it with act_id until it answers none. |
Squads (groups of repositories)
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/squads |
squad.list |
read:repos |
Every named squad with its repos (an empty one included), then each enabled repo in no squad as its own squad, flagged implicit: true with id: null. key is sq_<id> or repo_<repo id>. members lists repos again with each one's forge and instance. The whole set on every read: next_cursor is always null. |
POST |
/v1/squads |
squad.create |
write:squads |
Create a squad { name, repos }; a repo is a full name, or { full_name, forge, instance } for exactly that forge pair. 409 repo_in_another_squad names the squad already holding a repo (a repo sits in one squad); 409 squad_name_taken; 422 squad_name_invalid; 422 squad_repos_too_many over 200 repos; 404 for a repo not on this account. A refusal changes nothing. |
PATCH |
/v1/squads/:id |
squad.update |
write:squads |
Rename a squad, replace its repos, or both in one transaction ({ name?, repos? }, at least one). Refusals as POST /v1/squads, plus 404 for an unknown squad; a refusal of either half changes neither. |
DELETE |
/v1/squads/:id |
squad.delete |
write:squads |
Delete a squad; its repos become their own squads again. 204 on success, 404 for an unknown squad. |
Issues
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/repos/:owner/:repo/issues |
issue.list |
read:issues |
One enabled repo’s tracked issues newest-first, with triage state. |
GET |
/v1/issues/:id |
issue.get |
read:issues |
One issue by id. |
POST |
/v1/issues/:id/handoff |
issue.handoff |
write:issues |
Force-fire the issue to the coding-agent webhook (queued delivery; reason plus an optional webhook_ref). |
POST |
/v1/issues/:id/escalate |
issue.escalate |
write:issues |
Force-pull a human in: category + reason → an escalation row and a notification. |
Escalations
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/escalations/:id/ack |
escalation.ack |
write:issues |
Close one escalation by its id: it was read or acted on. Idempotent: a repeat keeps the first ack and answers changed: false. 404 for an id this account does not own, which is also the answer for one that does not exist. |
Person approvals
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/person-approvals |
person_approval.list |
write:merge:gate |
The account's human-only acts waiting for a person, soonest to expire first, in full: each {id, act, target, plan, action_digest, expires_at, created_at}. action_digest is the ?digest= a decision names. A signed-in dashboard session of an owner or admin only: every token is refused 403. |
POST |
/v1/person-approvals/:id/decision |
person_approval.decide |
write:merge:gate |
Approve or refuse one human-only act, {"action": "approve" | "refuse"} with ?digest= naming the plan shown. A signed-in dashboard session of an owner or admin only: every token is refused 403. Idempotent: the same person repeating the same answer gets the stored decision with replayed: true. 409 when the digest names another plan, the request expired, or it was decided otherwise. |
Ops runs
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/ops-runs |
ops_run.start |
write:tasks |
Start an ops run from the repo's committed .dz/ops-runs/<name>.yml at its default branch, or revise the run already there after the file changed. A revision keeps the steps before the first changed one (matched by definition hash), proofs included, and re-pends every step from it on. Mints no task: the worker's driver runs the steps in order. 201 started; 200 revised (with kept and repended) or unchanged; 404 no enabled repo; 422 no manifest, or one that does not parse (errors by path); 409 a step to re-pend has a task in flight, or a concurrent start; 503 GitHub unreadable. Audited (ops_run.started, ops_run.revised). |
GET |
/v1/ops-runs |
ops_run.list |
read:tasks |
The account's ops runs (migrations and cutovers run from a repo's committed .dz/ops-runs/<name>.yml), newest first, 25 a page by default (cursor pages older): each {id, repo_id, name, title, status, manifest_sha256, window_id, created_at, updated_at, finished_at}. status is running, parked (a step failed or waits on an agent) or completed. Writes nothing. |
GET |
/v1/ops-runs/:id |
ops_run.get |
read:tasks |
One ops run and every step in manifest order: each step's key, phase, status (pending, running, proved, failed, parked), reason when parked or failed, its current task_id and task_purpose (act or prove), attempt, the person approval it waits on, and for a proved step the recorded proof (the command, its output, when it ran). 404 for an unknown id or another account's. Writes nothing. |
Shared playbooks
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/shared-playbook-reviews |
shared_playbook.review_list |
write:merge:gate |
The shared playbook candidates this person may decide now, each {id, step, candidate_text, text_digest, expires_at, created_at}. step is consent (an owner or admin of the source account) or approval (a platform owner, once the account consented). text_digest is the ?digest= a decision names. No row names an account. A signed-in dashboard session only: every token is refused 403. |
POST |
/v1/shared-playbook-reviews/:id/decision |
shared_playbook.review_decide |
write:merge:gate |
Take ONE step on a shared playbook candidate, {"action": "approve" | "refuse"} with ?digest= naming the text shown. The step is the row's: consent from an owner or admin of the source account, then approval from a platform owner who is a different person. No call takes both, and nothing is published before both. A signed-in dashboard session only: every token is refused 403. 409 when the digest names another text, the candidate lapsed or was decided, or the leak scan refuses the stored text. |
GET |
/v1/shared-playbooks/retire-review |
shared_playbook.retire_review_list |
write:merge:gate |
The published shared playbooks contradicted at least twice, which a platform owner decides whether to retire: each {id, slug, version, stack, symptom_class, symptom, checks, cause_class, what_worked, what_to_avoid, served, helped, contradicted}, most contradicted first, then by id. The counts are across every account; no row names one. The whole queue in one response. Reading it retires nothing. A platform owner in a signed-in dashboard session only: every token, and every other person, is refused 403. |
POST |
/v1/shared-playbooks/:id/retire |
shared_playbook.retire |
write:merge:gate |
Retire one published shared playbook, {"reason": "..."}. It is served to no run from the next claim. A platform owner in a signed-in dashboard session only: every token, and every other person, is refused 403. |
Pull requests
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/approvals |
pr.pending_approvals |
read:prs |
The account-wide queue of outstanding ask-before-acting approvals. |
GET |
/v1/approved-prs |
pr.approved_open |
read:prs |
The account-wide list of open pull requests a maintainer has approved for merging, longest-approved first, with the stored waiting facts (CI, mergeability, GitHub's own block) and the refusal the stored row proves. |
GET |
/v1/repos/:owner/:repo/prs |
pr.list |
read:prs |
One enabled repo’s PRs newest-first. |
GET |
/v1/prs/:id |
pr.get |
read:prs |
One PR by id. |
POST |
/v1/prs/:id/approve-pending |
pr.approve_pending |
write:prs |
Approve the PR’s outstanding ask-before-acting action, OF the head the caller saw: body {head_sha}. A push since answers 409 with reason: head_moved and current_head_sha; re-read and decide again. |
POST |
/v1/prs/:id/skip-pending |
pr.skip_pending |
write:prs |
Decline the PR’s outstanding ask-before-acting action, OF the head the caller saw: body {head_sha}. A push since answers 409 with reason: head_moved and current_head_sha. |
POST |
/v1/prs/:id/undo-decision |
pr.undo_decision |
write:prs |
Take back a recorded approve or skip: body {head_sha, reason}. The PR returns to its ask-before-acting ask, cause decision_undone, and the act is audited with what it undid and why. A PR nobody decided, or one already merged or closed, is a 409 with reason: nothing_decided; a push since answers 409 with reason: head_moved and current_head_sha. |
POST |
/v1/prs/:id/rearm-babysit |
pr.rearm_babysit |
write:prs |
Re-arm the PR’s spent babysit CI self-fix budget, body {reason}: the ladders count only rounds after this, and the act is audited with what it forgave. 202 with forgiven and sweep, which says whether a babysit pass was queued: only enqueued means one is queued now; enqueue_failed queued none (the babysit reconciler re-reads escalated PRs within the hour); no_installation is a GitHub PR whose account holds no live GitHub App installation, so nothing is queued until one is installed; not_github is a GitLab or Gitee merge request, so nothing is queued from here: a GitLab MR’s pass comes from the GitLab babysit reconciler’s next tick, and only while a connected GitLab source names its project; a Gitee PR gets no pass from either. A merged or closed PR is a 409 with reason: pr_not_open, a disabled repo a 409 with reason: repo_disabled. |
POST |
/v1/prs/:id/try-merge |
pr.try_merge |
write:tasks |
Ask for one babysit pass of a stuck PR now. It is never a merge: the pass merges only if the merge gate passes, and otherwise records the refusal on its own hop, which the PR’s Blockers row shows as last_action (and the escalation it files) once that hop is later than requested_at_iso. No body. 202 with requested_at_iso and sweep (enqueued, or enqueue_failed when the queue refused the pass; the request stays recorded and babysit’s scheduled pass still reaches the PR). The request is audited before the pass is queued. Refused 409, nothing written, with reason: pr_not_open (and state), not_ai_authored (and author_login: neither our App nor a dependency bot opened it), pr_held (and park_class, park_reason: a park only a person, the forge or the repo clears, including the account’s own merge hold, not_ai_managed with merge_hold), not_github (and forge: the PR is not on github.com, the one host this pass supports, as a GitLab or Gitee merge request or a GitHub Enterprise pull request with forge github; no pass is queued for it, whatever GitHub App installation the account also holds; a GitLab MR’s pass comes from the GitLab babysit reconciler while a connected GitLab source names its project) or no_installation. Send an Idempotency-Key to make a retried click one request. |
POST |
/v1/prs/:id/report-problem |
pr.report_problem |
write:tasks |
Report a problem with a PR, body {note}: files one ask with the note, the PR’s link and its park, which triage decides like any other (GET /v1/asks/:askId). Taken on a held, merged or closed PR too, since it moves nothing on the PR. 200 with kind (filed, or existing when this exact note was already reported on this PR at its current head: a double submit files one ask, and the same words after a new push file again), ask_id, ask_status and dedupe_key. 503 when the ask is filed but could not be handed to triage, with reason not_handed and its ask_id. |
POST |
/v1/prs/:id/escalate-now |
pr.escalate_now |
write:tasks |
Ask the next babysit pass to run the stuck-PR rescue NOW, without waiting out its idle clock: one more round on the escalation model for the park, with the note leading its brief (or, for a hung or cancelled check, the one cancel-then-rerun). Everything else the rescue checks stands: once per (PR, reason) since the re-arm, plus one retry when the last round missed the stronger model on capacity. Past that, a request carrying a note buys one round of its own, once per request, its note leading the brief (a hung or cancelled check’s re-run stays once). Body {} or {note} (up to 2,000 characters; refused 400 when it carries a credential shape). It never merges: guardedMerge stays the one merge egress. One pr.unstick_requested row is written on its own transaction, then one babysit pass is queued. 202 with action, request_id, requested_at_iso and sweep (enqueued, or enqueue_failed: the request stays recorded and the next pass on the PR still answers it, because the request lives in the audit trail, not in the job). The pass that answers it writes ONE babysit.transition unstick_consumed row naming request_id, outcome applied (with what the hop executed), inapplicable (with why) or superseded (a newer request on the PR was answered); the act shows as the Blockers row’s last_action once its at_iso is later than requested_at_iso. Refused 409, nothing written, with reason: pr_not_open (and state), not_ai_authored (and author_login), pr_held (and park_class, park_reason), not_github (and forge: the PR is not on github.com, the one host this pass supports, as a GitLab or Gitee merge request or a GitHub Enterprise pull request with forge github; no pass is queued for it, whatever GitHub App installation the account also holds) or no_installation. Send an Idempotency-Key to make a retried click one request. |
POST |
/v1/prs/:id/rerun-checks |
pr.rerun_checks |
write:tasks |
Ask the next babysit pass to run the CI re-run rescue NOW, without waiting out its idle clock: on a PR parked on a hung (ci_wait_timeout), cancelled (ci_cancelled) or infrastructure-held (ci_infra_held) check, cancel any run of it still going and re-run it, once per (PR, reason) since the re-arm. On any other park the request is answered inapplicable. Body {} or {note} (up to 2,000 characters; refused 400 when it carries a credential shape). It never merges: guardedMerge stays the one merge egress. One pr.unstick_requested row is written on its own transaction, then one babysit pass is queued. 202 with action, request_id, requested_at_iso and sweep (enqueued, or enqueue_failed: the request stays recorded and the next pass on the PR still answers it, because the request lives in the audit trail, not in the job). The pass that answers it writes ONE babysit.transition unstick_consumed row naming request_id, outcome applied (with what the hop executed), inapplicable (with why) or superseded (a newer request on the PR was answered); the act shows as the Blockers row’s last_action once its at_iso is later than requested_at_iso. Refused 409, nothing written, with reason: pr_not_open (and state), not_ai_authored (and author_login), pr_held (and park_class, park_reason), not_github (and forge: the PR is not on github.com, the one host this pass supports, as a GitLab or Gitee merge request or a GitHub Enterprise pull request with forge github; no pass is queued for it, whatever GitHub App installation the account also holds) or no_installation. Send an Idempotency-Key to make a retried click one request. |
POST |
/v1/prs/:id/close-refile |
pr.close_refile |
write:tasks |
Ask the next babysit pass to close our own bot’s PR NOW and hand its goal back to triage, without the 72h standing-close clock: the same close (one comment quoting the note, the parks acked, the goal re-filed once per lineage), at most once per PR. Also refused not_our_pr (and author_login) on a dependency bot’s PR, which we never close. Body {} or {note} (up to 2,000 characters; refused 400 when it carries a credential shape). It never merges: guardedMerge stays the one merge egress. One pr.unstick_requested row is written on its own transaction, then one babysit pass is queued. 202 with action, request_id, requested_at_iso and sweep (enqueued, or enqueue_failed: the request stays recorded and the next pass on the PR still answers it, because the request lives in the audit trail, not in the job). The pass that answers it writes ONE babysit.transition unstick_consumed row naming request_id, outcome applied (with what the hop executed), inapplicable (with why) or superseded (a newer request on the PR was answered); the act shows as the Blockers row’s last_action once its at_iso is later than requested_at_iso. Refused 409, nothing written, with reason: pr_not_open (and state), not_ai_authored (and author_login), pr_held (and park_class, park_reason), not_github (and forge: the PR is not on github.com, the one host this pass supports, as a GitLab or Gitee merge request or a GitHub Enterprise pull request with forge github; no pass is queued for it, whatever GitHub App installation the account also holds) or no_installation. Send an Idempotency-Key to make a retried click one request. |
POST |
/v1/prs/:id/suggestions/:sid/pick |
pr.pick_suggestion |
write:tasks |
Pick one of a stuck PR’s suggested answers (suggestion_id and the choices on its GET /v1/blockers/prs row), body {choice} (a choice’s key) or {other} (the person’s own words, up to 2,000 characters, refused 400 when they carry a credential shape). The server runs the door the choice’s action names, never one its words name: rearm re-arms the PR (POST /v1/prs/:id/rearm-babysit, and so also needs write:prs, else 403), report_problem files a report (POST /v1/prs/:id/report-problem), rerun_checks and close_refile record that hop, and note_to_next_round and other record Escalate now carrying the words (POST /v1/prs/:id/escalate-now). It never merges: guardedMerge stays the one merge egress. The door runs first and writes its own record; then the pick is stored once on the set with one pr.suggestion_picked audit row. 200 with picked (key, note, action, at_iso, door_ref: the hop’s urq_ request or the report’s rtk_ ask), ran (what the door did; a report filed but not yet handed to triage, which the report door alone answers 503, is stored and answered here as kind not_handed with its ask_id) and replayed (true when this exact pick was already stored: no second audit row; ran is null then, unless this request’s door ran before the identical pick landed). Refused 409 with reason, nothing written: pr_not_open, not_ai_authored, pr_held, not_github (and forge: the PR is not on github.com, the one host the babysit pass supports, so no door runs for it, whatever GitHub App installation the account also holds) or no_installation (as the unstick doors refuse), a door’s own refusal (not_our_pr), stale_suggestion (and head_sha, current_head_sha: the PR moved since the set was written) or unknown_choice (and choices). Refused 409 already_picked (and the stored picked) when another pick is on the set: nothing is written on the set, and ran is null unless another pick landed while this request’s door ran, in which case that door already recorded its own act (its request or ask, and its audit row). 404 for a set that is not this PR’s or this account’s, or a PR whose repo is disabled. |
Code review
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/prs/:id/review-runs |
review.status |
read:prs |
The PR’s AI code-review runs, newest-first. Each run carries delivery, its review outbox: posting with posted of total comments while a finished review is still being posted (the verdict posts last), saving, delivered or retired; null for a run that posted without an outbox. Each also carries models, every model that served its current run in order (recorded with items of reason, requested_model, provider and served, or not_recorded with a reason), and findings, the posted findings count with unattributed and omitted. ?run_id= names one run of this PR, and that run alone also lists each finding with the model that wrote it (written_by); a run older than the list is added at its end, and a run id that is no review run of this PR is a 404. |
POST |
/v1/prs/:id/review-runs |
review.rerun |
write:prs |
Re-run the PR’s latest code review on the same commit (a fresh push already auto-reviews). 202 with the revived task; rerun: false means one was already queued, which is an idempotent no-op. A PR with no review run yet is a 409, not a 404: the PR is fine, there is simply nothing to re-run. Also refused as a 409 when the run’s OWN plan is already done, since reviving it would restart a slice plan cancel can no longer stop, and as a 409 with reason: pr_settled and state when the PR is already merged or closed (nothing is dispatched). |
GET |
/v1/repos/:owner/:repo/reviews |
review.list |
read:prs |
The newest 50 AI code review runs on one enabled repo, newest-first, with no cursor to older runs: which pull request, the run’s status, the findings it KEPT (those that survived anchoring and verification, counted when the findings step ends, so it can be set before any of them is posted; delivery says what has been posted), the verdict it posted on the project’s forge, and whether a model ran. brain is a three-way verdict, never a boolean: model (a credential resolved, with the provider and model id when the run recorded them), blind (the brain reported no model, with gap naming which one, no_credential or unresolved; that review settles the check neutral and says so), or unknown (the run never reached the brain, which is not evidence either way). models is the separate, honest answer to "what did the box actually drive": every model that served the task’s current run, in order (recorded with items of reason, requested_model, provider and served), or not_recorded with a reason. provenance is its last item, and null when models is not recorded. findings_kept: null means the run never reached the findings step, never zero findings. delivery is the run’s review outbox: posting with posted of total comments while a finished review is still being posted, saving, delivered or retired, and null for a run that posted without one. A fixed head of the newest runs, ordered by creation time and then by task id so two identical requests cannot disagree, with no page size to ask for and no cursor to follow, so any query parameter other than the forge pair is a 400. A GitLab project is addressed by its full path (subgroups percent-encoded in :repo) with forge=gitlab and its instance. 404 when the repo is not enabled for this account. |
Asks (work for triage to decide)
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/asks |
ask.file |
write:tasks |
File an ask the platform decides on: the object triage judges, not a task. Triage reads it against the LIVE fleet and either mints executable tasks (it decides their order, their file sets and which box runs each), drops it as noise, cross-links it to work already in motion, or escalates it to a human; GET /v1/asks/:askId carries that verdict. Idempotent on dedupe_key per account: filing again with the same key answers kind: "existing" with the ask already filed, never a second one. A caller that has already decided the schedule wants POST /v1/tasks instead, which mints one executable task and runs no triage. |
GET |
/v1/asks/:askId |
ask.get |
read:tasks |
One filed ask and what triage decided about it: pending (nobody has looked yet), triaged with a schedule verdict naming the task_ids it minted (poll each with GET /v1/tasks/:id), dropped (noise, or a duplicate naming the task that covers it) or escalated (a human decides; not a failure). 404 for an id this account does not own, which is also the answer for one that does not exist. |
POST |
/v1/asks/:askId/redrive |
ask.redrive |
write:tasks |
Re-drive one ask the platform failed to decide: an ask escalated with a machine-failure reason (judge_unavailable, attempts_exhausted, claim_missing, intake_saturated, coverage_unknown, model_unavailable_stale, screen_unavailable_stale, schedule_named_nothing, needs_info_questions_invalid, supersede_target_already_superseded, supersede_target_unknown) goes back to pending and the admission drain is nudged for a fresh pass. That escalation was a machine failing to answer, not a decision, so re-deciding it is safe; any other escalation reason (or a non-escalated ask) is refused 409 in the verb’s own words, and GET /v1/asks/:askId shows what the row actually is. 404 for an id this account does not own, which is also the answer for one that does not exist. The body carries nudged: false means the row IS pending but the hand-off was refused, and the stale-pending sweep re-nudges it. |
POST |
/v1/asks/:askId/release |
ask.release |
write:tasks |
Release one ask triage put on hold: the condition its release names is met, so it goes back to pending and the admission drain is nudged for a fresh pass. why (one sentence) is recorded on the raw_task.released audit row beside who released it. An ask that is not on hold (already released, never held, held again since) is refused 409 and nothing is written, so a retry is safe. 404 for an id this account does not own, which is also the answer for one that does not exist. The body carries nudged, as the re-drive does. |
Tasks
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/fleet/runs/:runId/events |
task.run_tail |
read:tasks |
SSE: one BYOVM run’s durable event timeline (the NATS→SSE bridge). Backfill, tail, terminate. Resumable: each frame’s id: is the row’s seq, so a reconnect carrying Last-Event-ID continues from it instead of replaying the run. |
POST |
/v1/tasks/:id/pause |
task.pause |
write:tasks |
PAUSE one job at a safe point: it finishes its current step, saves its work, drops to 0% CPU and keeps its slot on the same machine. No body. A running job answers 202 {task_id, kind: "pause_requested"}: the pause is sent to its machine and the task reads paused once the machine has stopped (pressed again, the same 202, nothing re-sent). A job its machine has not started yet answers 200 kind: "paused" at once. Already paused: 200 kind: "already_paused". Refused as 409 pause-refused with reason: lane_not_pausable (only the coding lane that saves its work can pause), task_not_running, task_stopping, presence_unknown, machine_offline, or machine_cannot_pause (its runner build does not read the pause verb; the detail names the version). 429 pause-rate-limited with Retry-After past 6 changes in 30 s. 404 for another account’s task. A refusal changes nothing. |
POST |
/v1/tasks/:id/resume |
task.resume |
write:tasks |
RESUME a paused job from its saved work. Body {anywhere?: boolean}. A paused job whose machine is enrolled and live goes back to the queue pinned to it, so that machine claims it first: 200 {task_id, kind: "resumed", pinned_runner_id}. A machine that is revoked or deleted answers 409 machine_gone, one with no live heartbeat machine_offline, an unreadable heartbeat presence_unknown; with anywhere: true each of those resumes instead with the pin cleared (pinned_runner_id: null), so any eligible machine continues. A running job whose pause has not landed yet has the request withdrawn: 200 kind: "pause_withdrawn". Already back in the queue: 200 kind: "already_resumed". Anything else 409 task_not_paused. A parked goal resumes through its goal task (resume_with on GET /v1/goals/{id}; anywhere is ignored): 200 {task_id, kind: "goal_resumed", goal_id, checkpoint_version}, its session back to running and its task to the queue, so the next box that runs goals continues from that checkpoint, acting for the person who started it. Refused with kind: 403 goal_needs_a_person (the credential is bound to no user); 409 goal_not_parked with goal_status, goal_settled with settle_kind, no_goal_capacity with gap, capable_boxes and live_goals (the start rule), goal_run_not_ended with task_status (the parked goal’s task has not finished its last run: send it again in a moment), or goal_task_cancelled (its task was cancelled and is never revived). A goal’s own API token cannot call this. 429 pause-rate-limited with Retry-After past 6 changes in 30 s. 404 for another account’s task. |
GET |
/v1/tasks |
task.list |
read:tasks |
The account’s task queue, newest-first. |
GET |
/v1/queue/status |
task.stalls |
read:tasks |
Why is nothing moving: every reason holding a pending task, how many it holds, how long it has been true, and what clears it. |
GET |
/v1/tasks/:id |
task.run_status |
read:tasks |
One task: the queue row, its scoped-plan detail and its run pulse. 404 when unknown or foreign. |
GET |
/v1/tasks/:id/attempts |
task.attempts |
read:tasks |
Every attempt the task has burned, oldest first: one rung per run, each with its own outcome and its own re-derived failure kind. The task row records only the LATEST attempt’s classification, so this is the only surface that says what went wrong on attempts 1 and 2 of 3. 404 when the task is unknown or foreign. |
POST |
/v1/tasks/:id/reassign |
task.reassign |
write:tasks |
Pull one in-flight task off its box back to pending so the fleet assigner re-claims it elsewhere. Idempotent: a pending task answers reassigned: false. A terminal task is refused (409 task_terminal): it holds no box, and the verb that runs it again is redispatch. |
POST |
/v1/tasks/:id/cancel |
task.cancel |
write:tasks |
STOP one task: it moves to cancelled and the box holding it is interrupted. The destructive sibling of reassign, which only moves the work elsewhere. Idempotent: an already-terminal task answers kind: "already_terminal", not an error. A GOAL’s task is the goal’s stop: its teams stop, the pull requests they opened stay open and are no longer fixed or merged, and its API token is revoked; a merge already admitted before the cancel cannot be recalled and is named in merges_admitted (it may land), never reported as stopped; pressed on a goal task that had already ended while its goal had not, it answers kind: "goal_stopped". One kind of task is refused (409 not_cancellable_review): a PR review whose pull request is still OPEN, because terminating it would release the merge gate’s review hold and let the pull request merge with no review verdict. Once that pull request is merged or closed the hold is moot and the stop is accepted; the platform also retires such reviews itself. |
POST |
/v1/tasks/:id/redispatch |
task.redispatch |
write:tasks |
Re-drive one task back to pending so the fleet assigner claims it fresh (the operator trigger for a task whose retry ladder exhausted at failed, or one otherwise stuck). Resets attempt to 0 (an operator redispatch is a deliberate fresh try; the erased value is prior_attempt and rides the audit row) and keeps failure_kind. The next run resumes the diff the task saved as the tip commit of its own branch (dz/<slug>--<first 8 hex of the task id>); saved_wip names it (found, sha, paths, failures, ending) or says there is none. The tasks that failed BECAUSE this one did go back to pending with it (released_dependents). An optional { guidance } body (at most 2,000 chars, secrets scrubbed) rides the next run’s brief as an operator note; guidance_chars (present only then) is its scrubbed length. Refused as a 409: a task already pending has nothing to redispatch, one an operator cancelled stays cancelled, since that was a decision, not a failure, one a person paused is continued with Resume (not_redispatchable_paused), not redispatched, and one whose PR already shipped (merged, or completed/awaiting_ci/awaiting_review/mergeable under the babysit watch) is not run a second time against that PR. |
GET |
/v1/tasks/:id/events |
task.run_events |
read:tasks |
The same run timeline as plain JSON, paged on ?since_seq= for a client that cannot hold the SSE tail open. An unstarted task answers run_id: null and an empty page, never a 404. Send ?wait_ms= to WATCH it: the request is held open until the first new event lands (or the wait expires), so one call covers what 25 polls would, and the wait also spans the gap before a box starts the task. An empty page after a wait is not an error, it means nothing happened in that window: re-send with the same cursor. A run that has already ended settles the wait at once, so an instant empty page means the run is over rather than idle. |
GET |
/v1/tasks/:id/report |
task.result |
read:tasks |
What the run DELIVERED, folded off the task’s durable events: the report markdown with the source it came from (report_md = the file the brief asked for, final_turn = the run’s closing prose taken in its place, none = neither, no_work = a pr run that opened no pull request because its team disproved the ask, its markdown the disproved premises and their path:line facts), the artifacts it attached by reference, every raw task any attempt filed, the access blocker any attempt declared, the devops lane’s own summary, and scout_context, a return_context scout’s survey (its repo, its one-line summary, the files it grounded with their citations, its split hints, the handoffs it noticed beside the question, and the access it needs or the blocker it hit), which is the ONLY deliverable that lane leaves. runs_seen > 1 means the task was retried: the report and the survey are the LATEST run’s, while filings and blockers span every attempt. A task that has delivered nothing yet answers 200 with report: null, not a 404: the 404 is reserved for a task this account does not have. report_missing: true is the run saying it produced no deliverable and failed for it. |
POST |
/v1/tasks |
task.create |
write:tasks |
Dispatch one scoped task to a sink (linear | gh | direct | queued). A fleet enqueue (direct/queued, one admitted sink) answers {task_id, sink, queue_position, queue_depth, queue_depth_cap}; refusals name the REST problem type: a full backlog is a 429 queue-full with Retry-After, an account with no AI devs a 403 no-capacity, a problem that is only GitHub issue or pull-request links a 422 problem-is-only-link (a run may have no way to open them: paste their text), a body naming a key only the platform writes (plan_context, babysit and the like; the body schema lists each as a field no value satisfies) a 400 naming that key; below the confidence threshold → an escalation. |
Blockers
| Method |
Path |
Capability |
Scope |
Description |
GET |
/blocker-fix/:jwt |
blocker.fix_link_form |
no bearer |
Show a blocker’s form to a human: each field it asks for (env secrets, service URLs, MCP servers, OAuth connections), with the fields that already landed marked and closed to edits. Reads the blocker and stores nothing, so a mail scanner or link prefetcher changes nothing: 400 malformed, 410 expired or no longer matching the blocker. Needs no login: the signed JWT in the path is the whole credential. |
POST |
/blocker-fix/:jwt |
blocker.fix_link_redeem |
no bearer |
Land the fields that were filled in: vault values are sealed into the repo’s vault, an MCP server’s token into the account vault, and the page hands back the .maintainer.yml stanza for each MCP server. Fill any subset; each field is write-once, and the link stays valid for its hour while fields remain. A live run that asked is woken, and the submit that lands the last field closes the blocker. The JWT is the whole credential and the CSRF token; it can never read a stored value back. 400 nothing filled in, 409 already landed or closed, 410 expired, 413 a form over 1 MiB. |
GET |
/v1/blockers |
blocker.list |
read:tasks |
The answerable holds: the questions the platform is waiting on a human for, newest ask first, in pages (50 by default, up to 200; cursor pages on until next_cursor is null). open=false widens to the closed record, in the same order. A missing_credential row carries its form (the field NAMES it asks for, and which have landed) and, for a caller holding write:secrets, a signed hour-long fix_url a human can fill in without the agent plane ever holding a value. The link fills the form as a bearer, so a caller who may not write the vault reads null. A row may name the pull request it relates to (related_pr, {repo_full_name, number}: the PR of the task that raised it, or the one a triage ask names in its origin) and the one question a triage round asked, in its own words (question, up to 500 characters, model text to render as plain text); each is null when nothing linked it. A row names its repo’s forge (forge, instance), derived from the task it holds or the run that raised it (only a task of that run on the row’s own repo path counts), and null when nothing ties it to exactly one: repo_full_name alone is not forge-unique, so a reader matching a repo compares path, forge and instance when the pair is known, and otherwise keeps the row as a path-only match. It never carries the answer text. |
POST |
/v1/blockers/:blockerId/answer |
blocker.answer |
write:tasks |
Supply what was missing, as exactly one of answer (words), choice (a key of the blocker’s options, with an optional note, required when that choice is note_required) or done: true (the blocker’s guidance steps are done, with an optional note). Closes the blocker and files a raw task carrying both the ask and the answer, so the answer is durable and admitted rather than lost with the stopped run. It does NOT restart that run: triage decides the raw task on the account’s own key and may schedule, drop, cross-link or escalate it. Two kinds of blocker file nothing. A held task’s blocker releases that task with fresh attempts, as task redispatch does (409 when it can no longer be released). A blocker tied to a live task answers that task, which resumes on its own (kind: "linked" with its task_id). Answering twice is refused with a 409, never doubled: one blocker mints at most one raw task. A pick the blocker cannot take is a 422 whose detail opens with the reason: no_options, unknown_choice or note_required for a choice; no_steps or decision_needs_answer for done. The optional llm names which of the account’s own keys the triage judge decides this answer’s ask on, and never the work’s model. It is vetted against the account’s live key pool first, exactly as the key-outage pick vets a key: 422 unknown_key_label / key_not_usable (naming the unserved steps in detail) when no key could serve it, 422 no_judgement on a held task’s blocker or a live-linked one, where no judge reads the answer, and 503 when the cooldown Redis read faulted. A refused answer changes nothing: the blocker stays as it was. Needs a credential that names a human, since the answer is attributed to the person who gave it. Send the LOCATION of a credential, never the credential itself. |
POST |
/v1/blockers/:blockerId/withdraw |
blocker.withdraw |
write:tasks |
Retire an ask that went away, closing it with no answer and minting no work. 404 when this account has no OPEN blocker with that id, which is also the answer for one that is already resolved. |
GET |
/v1/blockers/:blockerId/spec |
blocker.spec |
read:tasks |
The form a missing_credential blocker asks a human or an agent to fill: every field NAME, its kind (env_secret, service_url, mcp_server, oauth_connection), its environment where it has one, whether it has landed, and whether a value can be submitted for it. Never a value. Also accepts the blocker’s own fix-link token as the bearer, for this blocker only. 404 for an id this account does not own. |
POST |
/v1/blockers/:blockerId/submit |
blocker.submit |
write:secrets |
Fill some of a blocker’s open fields: {fields: {NAME: "value", "mcp:<server>": {url, transport, token}}}. Each vault value is sealed into the repo’s vault (sealed, never readable back); an MCP server’s token goes to the account vault under its token_ref, and its url and transport come back as the .maintainer.yml stanza to add. Each field is write-once, so a landed field is a 409. A live run that raised the ask is woken; the submit that lands the last field closes the blocker and files the follow-up work. Also accepts the blocker’s own fix-link token as the bearer. 404 for an id this account does not own, 409 once the blocker is closed, 422 for a name the form does not have or a value it cannot store. |
GET |
/v1/blockers/prs |
blocker.prs |
read:tasks |
The account's stuck AI-managed pull requests, longest idle first (100 a page by default, cursor pages on): every open PR by our App or a dependency bot idle past the stuck clock or open past 12 hours, the same rows and park classes the Escalation agent's queue serves, plus a PR on a repo that does not auto-merge, parked not_ai_managed with park_reason auto_merge_off (or merge_hold while a person holds the repo's merges). Each row carries what a person needs to check it in place, all from stored rows: who opened it (author_login: our App's login or a dependency bot's), the current head's CI grade and failing check names, the findings our newest review of that head raised, babysit's newest hop (last_action: what it decided, did, and when), the newest 20 stuck-PR rescue decisions, each with the model it ran on or why it got no stronger one, and cooling_until_iso for a dependency PR waiting out its release cooldown, which is waiting by design and not stuck. Once the automatic rescue is spent, suggestions offers two to four model-written next moves to pick from, and suggestions.next_move says what babysit does anyway if nobody picks: a machine re-arm, the 72-hour close and re-file of our App's PR, or nothing (with why), and when, where the rule fixes a time. No diff size: none is stored. Paging is keyset on the idle clock, and that clock can move while you page (later on a new head or a re-arm, earlier once a hop sees the head a base update pushed), so across pages a row can repeat or be skipped; each page is consistent, the walk is not, and a client that needs a consistent snapshot re-reads from the first page. Writes nothing. |
Built-in dashboards
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/admin/builtin-dashboard-sync |
builtin_dashboard_sync.enqueue |
admin:accounts |
Operator only: enqueue one cron.builtin_dashboard_sync pass on demand, audited as a platform op. The lane's daily 04:10 UTC tick is the only other producer; nothing in the bot's normal path can reach this queue. Requires confirm: true and a why the maintainer typed. 202 with job_id. 409 with reason: import_in_flight (sic, code-mis-stem) when a manual run is queued or running at the time of the call; two calls in the same instant both answer 202 with the same job_id, and one job runs. Audited on the platform trail as builtin_dashboard_sync.enqueue_requested, naming the operator. |
Plans
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/plans/builds |
plan.builds |
read:tasks |
This account's long-horizon builds: one row per repository whose plan execute plans (milestones) live there, newest milestone first. 200 {builds: [{repoFullName, milestones: [{planId, status, leadTitle, createdIso, lastLandedIso, groupCount, landedCount, noWorkCount, stalledCount, heldCount, stopReason}], milestonesDone, slicesLanded, slicesTotal, lastLandedIso, verdict}]}. verdict.state is moving (an open milestone landed or started within 72 h), stalled (one has not: sinceIso is what last moved it, cause is the plan's stop reason or no_landing) or idle (no open milestone). Writes nothing. |
GET |
/v1/plans/board |
plan.board |
read:tasks |
This account's plans as the execution board. 200 {columns: {ready, in_progress, needs_you, done}, closed: {count}, repos}: each column is {count, cards, next_cursor}, its first page of cards newest-activity-first with the cursor for GET /v1/plans/board/{column}. Every count is over the filtered set (q, repo, initiated_by), and equals the matching GET /v1/plans bucket count for the same filters: Ready is awaiting_approval, Needs you is stalled, Done is completed, and closed.count is the History list. repos is every repo across the account's plans that initiated_by keeps, before repo and q narrow anything. A card is a plan summary plus closedIso, stalledByReason, pausedIso, llm, reviewLlm (the reviewer model, null for Automatic), modelLock (the lock verdict both model doors refuse on), its queue line on Ready and In progress, its open slices (role, machine, model with its basis) on In progress, and localSession, reserved for the person's own session that holds the plan and null on every card in this release. Writes nothing. |
GET |
/v1/plans/board/:column |
plan.board_column |
read:tasks |
One page of one board list: ready, in_progress, needs_you, done, or closed (the History list). 200 {data: [card], next_cursor}, newest-activity-first, keyset on (activity, plan id); follow next_cursor until it is null. Filters as GET /v1/plans/board, and the list holds exactly as many plans as that list's count there for the same filters. A malformed cursor is a 400, never a restart at the head; a well-formed cursor is not checked against the list or filters that minted it, so pass it back only with the same list and the same filters. Another list name is a 404. Writes nothing. |
GET |
/v1/plans |
plan.list |
read:tasks |
The account’s plans, newest-activity-first, in numbered pages: plan id, target repo, lead-slice title, the merged/total progress fraction, the held count, every repo the plan touches (repoFullNames; ?repo= matches a plan with ANY slice there) and goalState. The envelope carries total, counts per status bucket and the repos vocabulary; ?bucket=, ?repo= and ?q= filter, ?page= walks. |
POST |
/v1/plans |
plan.start |
write:tasks |
Start a scout planning session over one enabled repo: hand it a raw ask and a mailbox-capable box authors the plan (groups then tasks). 202 with the dispatched task_id plus queue_position (1-based, in claim order) and queue_depth_cap (-1 = uncapped); that task’s run_id is null until a box claims and starts it, and it is the id the mailbox steers. Name SEVERAL repos for one change across them: with return_context: true one sub-scout surveys each and the 202 adds fanout_id; without it the ask is filed for triage, which authors ONE plan with a slice per repository ordered by its dependencies, and the 202 carries raw_task_id INSTEAD of task_id: the same id GET /v1/plans/{planId} takes once triage settles. A scout_llm whose key switches the scout or the Planner off is accepted while the other is served, and the 202 adds switched_off_agents naming the agent (scout or planner) that will not run on that key; switched off for both, it is a 422. require_approval on that arm is a 400 naming the field: the triage lane mints unconditionally and has no held state to write. An account with no AI devs is a 403 no-capacity, a full backlog a 429 queue-full with Retry-After. A fleet with no online box able to hold a live session is a 409 naming the mode a box needs, not a 404: the repo is fine. |
GET |
/v1/plans/file-switch |
plan.file_switch_get |
read:account |
The org’s plan-file switch: whether scouts may file plan documents into its repos. Default on; an owner flips it with PUT /v1/plans/file-switch. |
PUT |
/v1/plans/file-switch |
plan.file_switch_set |
write:account |
Flip the org’s plan-file switch: {"enabled": false} opts the org OUT of scouts filing plan documents into its repos; true restores the default. Answers the flip it made: changed is false on a no-op set, which is still audited. |
GET |
/v1/plans/:planId |
plan.get |
read:tasks |
One plan’s full projection: the group → task → PR chain. Each group (a leg: one repo, one PR) carries its edges (release merged/deployed, hold start/merge, released now or not), deploy (one entry per environment: deployed/failed/pending/unknown) and mergeHeld (the upstream legs its merge waits on); the plan carries goalState, a derived label (building … cancelled), never stored. ?include=stopped adds stopped: one entry per stalled slice in plan order, with its stallReason, its task’s failure and model as task outcome reports them, its cancelReason, and a rerun verdict (queue, follows_upstream, repair_answered, cancelled or not_rerunnable) saying what Run it again will do with it (before the repair overlay, a cancelled slice on the safe list is eligible for queue: queue_dropped, queue_merged while its targets are pending and have no work in progress, and repo_disabled with its repo enabled and no pull request; an answering repair ask changes queue and follows_upstream to repair_answered). The plan id of a scout run is its run id, and until the Planner writes that plan the 404 names why in reason: plan_not_written (the Planner is writing it), planner_blocked (it returned BLOCKED, and stays so after the blocker closes) or planner_refused. An unknown id is a plain 404 with no reason. |
GET |
/v1/plans/fanouts/:fanoutId |
plan.context |
read:tasks |
The merged answer of a multi-repo scout fan-out, addressed by the fanout_id POST /v1/plans returned when several repos were named. One sub-scout surveyed each repo; this folds their findings into one answer with per-repo attribution, citations repo-qualified (repo:path:line) and a claim two repos both established collapsed once. A fan-out still running answers 200 too, naming the repos still surveying: poll again rather than reading a short answer as complete. 404 when this account owns no such fan-out, the same answer an unknown id gets. |
POST |
/v1/plans/:planId/cancel |
plan.cancel |
write:tasks |
STOP a whole plan: every non-terminal child of its groups moves to cancelled and the boxes holding them are interrupted. Always 200 when the plan exists, even when nothing moved. The answer is three id lists: what was stopped, what had already finished, and the PR-review children that were not stopped (the same merge-gate carve-out task.cancel refuses on). |
POST |
/v1/plans/execute |
plan.execute |
write:tasks |
Execute a COMMITTED plan directory (the /planx layout: overview.md, NN-*.md slices, status.yml) on an enabled repo. The platform reads it at the default branch, cuts one unit per pull request with the dependencies and file sets the plan states, and records ONE plan: each unit starts when every unit it depends on has MERGED, work units never touch the plan directory, except that when the plan ships a status.yml a final unit updates it, and a one-unit plan is one pull request whose unit carries the plan directory and records its own completion there; a plan with no status.yml records no completion in the tree. 202 with the plan_id to poll at GET /v1/plans/{plan_id}. dry_run: true records it held for review (POST /v1/plans/{plan_id}/approve starts it). The same directory is always the same plan; revision re-reads a corrected one as a new plan. 404 for a repo this account has not enabled, 422 for a path that is not a plain repo-relative directory. |
POST |
/v1/plans/file |
plan.file |
write:tasks |
File a plan DIRECTORY inline (the /planx layout: overview.md, NN-*.md slices, status.yml): validate every document, check each scout citation against GitHub at the default branch, write plan_documents, then dispatch onto the SAME plan.execute lane POST /v1/plans/execute uses. 202 with the plan_id to poll at GET /v1/plans/{plan_id}. 409 when the org has the plan-file switch off; 404 for a repo this account has not enabled; 422 for every other refusal (a done or cancelled plan, a read of it running, a stale re-file conflict, or every collected problem, slug, documents, scouts or GitHub, named in the body). dry_run: true records the filing held for review (POST /v1/plans/{plan_id}/approve starts it). |
POST |
/v1/plans/:planId/regroup |
plan.regroup |
write:tasks |
Replace unfinished group(s) of an open plan with the tasks that replace them: the tasks a SCHEDULED ask was cut into (ask_id), or task_ids. One new group per task takes the old slot; every group and task that waited on the old one waits on ALL the new ones, and a dependent the old one killed is revived. Every rewired edge keeps its kind; edges landing on one upstream keep the strictest, and two deployed edges of different environments on one upstream are refused (409, naming the groups and upstreams; plan unlink one first). Nothing is minted and the superseded task is not stopped (the answer names it). 200 with the new groups, 404 for no such plan, 422 for an unknown group, ask or task, 409 for a plan, group, ask or edge set whose state forbids it. |
POST |
/v1/plans/:planId/unlink |
plan.unlink |
write:tasks |
Remove named upstream edges (upstream_group_ids) from ONE group (group_id) of an open plan, with a stated reason: the group's stored edges lose them, every other edge keeps its kind, and its task's depends_on loses their tasks, unless an edge that remains still names that task. For edges that are ordering only, not code dependencies; never adds an edge or touches another group. Audited with both edges before and after. 200 with the before/after, 404 for no such plan, 422 for an unknown group or an id that is not an edge, 409 for a plan that is not open or a group already settled. |
POST |
/v1/plans/:planId/rerun |
plan.rerun |
write:tasks |
Run it again: redispatch each root failed slice of the plan (the same redispatch POST /v1/tasks/{id}/redispatch runs), and the slices that failed because of it come back with it. A cancelled slice on the safe list is revived too: a queue judge’s queue_dropped, queue_merged while its targets are pending and have no work in progress, and a repo_disabled cancel whose repo is enabled again and which has no pull request. Every other cancel, an operator’s stop included, stays cancelled. Body {} or {"guidance": "..."} (at most 2,000 chars after secret scrubbing; it rides each revived slice’s next run). 200 {plan_id, queued, stopped, slices}: queued of stopped is what this call put back in the queue; each stopped slice, in plan order, is queued, queued_with_upstream or skipped with a reason (follows_upstream, repair_answered with the answering ask’s repair state, cancelled, pr_closed, delivered, paused, already_pending, no_task, plan_done, plan_cancelled). A cancelled plan, or one a repair ask answers, redispatches nothing. Never a 409: each slice says why it did not move. 404 when the account owns no such plan; 400 for an unknown body key or a guidance too long. |
POST |
/v1/plans/:planId/approve |
plan.approve |
write:tasks |
Release a held plan stamped when POST /v1/plans carried require_approval: true. Flips every held group back to dispatched and mints its tasks in one transaction. Body optional: {"reason": "<why>"} (trimmed, then 1 to 500 characters), stored with the approval and read back as approval.reason on GET /v1/plans/:planId; no body is the same as {}. 200 on every plan still releasable: kind: "approved" carries the freshly-minted task ids, kind: "already_approved" is the idempotent re-approve answer (and carries the ids the FIRST call minted; it stores no reason). 400 for an unknown key or a blank or too-long reason, 404 when no such plan, 409 when every group was already stopped by plan cancel (that plan exists and can never be released), and 409 repo_not_enabled when a held group targets a repo no longer enabled for the account: nothing is released until it is re-enabled. |
PUT |
/v1/plans/:planId/model |
plan.set_model |
write:tasks |
Set the epic’s model: each slice claimed from now on runs on it unless the slice pins its own; a slice already running keeps its model. Body {"llm": {provider?, model?, key_label?, reasoning_effort?}}, or {"llm": null} for Automatic. A plan-pinned slice is pinned for its whole claim: no model escalation and no fallback key on another provider. 200 {plan_id, llm, previous_llm}, plus switched_off_steps when the named key_label has some step’s agent switched off (those slices run on the rest of the pool); the same model again is a 200 with no audit row; 404 when the account owns no such plan; 400 llm_names_nothing for an llm naming no axis; 422 unknown_key_label; 422 effort_needs_model or effort_refused when reasoning_effort has no model or no serving key takes the level; 422 key_not_usable (with unserved_steps) when no key the account could run now serves the pin on any step of the plan’s slices; 409 plan_not_open for a done, cancelled or ended plan; 409 plan_approved for an approved plan waiting to start (disapprove it first) or plan_running for one with work running or queued (pause it first): its model is locked; 503 when the live key-pool cooldown read faulted. A refusal changes nothing. |
PUT |
/v1/plans/:planId/reviewer-model |
plan.set_review_model |
write:tasks |
Set the plan’s reviewer model: the model each review of the plan’s pull requests runs on. Body {"llm": {provider?, model?, key_label?, reasoning_effort?}}, or {"llm": null} for Automatic (the account’s review route). 200 {plan_id, review_llm, previous_review_llm}; the same model again is a 200 with no audit row; 404 when the account owns no such plan; 400 llm_names_nothing for an llm naming no axis; 422 unknown_key_label; 422 key_not_usable with unserved_steps: ["review"] when no key the account could run now serves the pin for the Reviewer (a key that switches the Reviewer off included); 422 effort_needs_model or effort_refused when reasoning_effort has no model or no key serving the model for the Reviewer takes the level; 409 plan_not_open for a done, cancelled or ended plan; 409 plan_approved or plan_running: locked exactly as the plan’s model is; 503 when the live key-pool cooldown read faulted. A refusal changes nothing. |
POST |
/v1/plans/:planId/disapprove |
plan.disapprove |
write:tasks |
DISAPPROVE a plan that has not started: it stays open with its groups as they are, and every waiting slice is held by the plan’s pause stamp until POST /v1/plans/:planId/approve lifts it; POST /v1/plans/:planId/resume refuses it. Allowed on a plan waiting for approval and on an approved plan none of whose slices has started. Body optional: {"reason": "<why>"} (trimmed, then 1 to 500 characters); no body is the same as {}. 200 {plan_id, approval: "disapproved", approval_at, approval_reason, paused_at}, also for a second disapprove, which records the new reason and time. 409 plan-disapprove-refused: reason: "plan_not_open" with status for a done, cancelled or ended plan; reason: "slices_started" when a slice has started or the plan never asked for approval (Pause is its button). 400 for an unknown key or a blank or too-long reason; 404 when the account owns no such plan. A refusal changes nothing. |
PUT |
/v1/plans/:planId/title |
plan.rename |
write:tasks |
Give the plan a display name, shown wherever the plan’s headline is, in place of its lead slice’s title. Body {"title": "<name>"} (trimmed, then 1 to 120 characters), or {"title": null} to clear it so the lead slice’s title shows again. Any plan the account owns can be renamed, whatever its status; nothing runs on a rename. 200 {plan_id, title, previous_title}; the same title again is a 200 with previous_title equal to title and no audit row; 400 for a missing title or one that is blank or too long after trimming; 404 when the account owns no such plan. |
POST |
/v1/plans/:planId/pause |
plan.pause |
write:tasks |
PAUSE a whole epic: its waiting slices are held (each reads hold_reason: plan_paused after the next dispatcher pass) and each running slice is paused as POST /v1/tasks/:id/pause would. No body. 200 {plan_id, paused_at, already_paused, pause_requested, paused, held, skipped: [{task_id, reason}]}: held is the waiting slices, skipped the running ones refused, with the task door’s 409 reason. Pressed on a paused plan: the same shape with already_paused: true. A done or cancelled plan: 409 plan_not_open. 429 pause-rate-limited with Retry-After past 6 changes in 30 s (one per call). 404 for another account’s plan. |
POST |
/v1/plans/:planId/resume |
plan.resume |
write:tasks |
RESUME a paused epic: the hold on its waiting slices is released and each paused slice is resumed on its own machine, as POST /v1/tasks/:id/resume would (a running slice whose pause has not landed has it withdrawn). No body. 200 {plan_id, already_resumed, resumed, pause_withdrawn, skipped: [{task_id, reason}]}. A slice whose machine is gone, offline or unreadable stays paused under skipped, and next_step says to resume it alone with anywhere: true. A disapproved plan: 409 plan_disapproved, and nothing changes; only POST /v1/plans/:planId/approve lifts its hold. 429 pause-rate-limited with Retry-After past 6 changes in 30 s (one per call). 404 for another account’s plan. |
Goals
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/goals |
goal.start |
write:tasks |
Start a GOAL: one coordinator on one of the account’s boxes works brief for hours across repos ("owner/name", or a whole bare name on a credential tied to a person; on GitLab or JiHu, forge: "gitlab" with its instance and one or more "group/project" paths on that instance, whose teams open merge requests), or in a NEW repo project names, made with your GitHub token and scaffolded with the brief first (the goal waits for that scaffold to merge; project in the answer names it), in waves, starting teams that each open a pull request, until every done_when item is measured. 201 with Location: /v1/goals/{goal_id} and {goal_id, task_id, conversation_ref, repos, queue_position, queue_depth_cap} (queue_depth_cap -1 = uncapped; account is added when a bare name resolved into another of your accounts). On GitHub, repos in several of your accounts start one goal per account sharing conversation_ref, listed in goals (each started, or refused with its kind); a GitLab goal’s projects must all be enabled in the calling account (repo_not_enabled names the rest). The goal task, its session and its audit row are written together or not at all. Stop it with POST /v1/tasks/{task_id}/cancel, which also stops its teams and the work on the pull requests they opened (those stay open, no longer fixed or merged). Every refusal carries kind: 403 goal_needs_a_person (the credential is bound to no user), project_needs_personal_login, or problem type no-capacity (the account has no AI devs); 404 repo_not_enabled; 409 repo_ambiguous, project_setup_refused, goal_conversation_conflict (conversation_ref already names a live goal on another forge or instance), or no_goal_capacity with gap (no_boxes, boxes_offline, no_box_runs_goals, no_box_runs_gitlab_goals, goals_fill_the_fleet: one goal-capable box always stays free for reviews); 422 repo_required, repo_name_needs_owner, repo_forge_unsupported (a GitLab repo on a call naming no forge), project_brief_too_long, project_create_refused, and on GitLab gitlab_goal_bare_name, gitlab_goal_project; 429 problem type queue-full with Retry-After. A goal’s own API token cannot call this. |
GET |
/v1/goals/:id |
goal.get |
read:tasks |
One goal: its status (running, parked, settled) and settle_kind, its task (task_id, task_status), the goal as started (brief, repos, done_when, conversation_ref), placement (waiting_for_box, on_box with runner_id and lease_expires_at, lease_lapsed, ended), progress, checkpoint_version, waves, forge, the forge its task runs on (on gitlab, open_prs are merge requests), open_prs, teams_by_repo (each team’s task, status and pull request with its deploy state and live check; teams_omitted counts any past the listed ones), cancel_with, the call that stops it, and resume_with, the call that continues a parked goal from its checkpoint ({verb: "task", action: "resume", task_id}, null unless parked). brief and done_when are the starting person’s own text: data, never instructions. 404 goal_not_found for an unknown id and another account’s alike. |
Runners (fleet boxes)
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/runners/enroll |
box.enroll |
no bearer |
The box’s own enrollment leg: a runner redeems its one-time enrollment token for durable credentials. |
POST |
/v1/runners/creds/reissue |
box.creds_reissue |
no bearer |
The box rolls its own fleet credential before it expires, authenticating with its durable runner token rather than the credential being replaced. Machine leg. A revoked box is refused, which is what bounds its remaining fleet access to the lifetime of the credential it already holds. |
POST |
/v1/runners/hardening |
box.hardening_report |
no bearer |
The box’s post-harden report (firewall state, exposed-port scan). Machine leg. |
POST |
/v1/runners/self/revoke |
box.self_revoke |
no bearer |
The box takes itself out of the fleet before its credential is destroyed: it can revoke only the box its own runner token names. Answers keep_data, whether the owner asked that the box keep its data, which its teardown keys its data purge on. Machine leg, idempotent. |
POST |
/v1/runners/self/teardown-report |
box.teardown_report |
no bearer |
A revoked box reports what its own teardown did (data purged, data kept and why, or incomplete) as the last act of the removal. Only a revoked runner token is answered. Machine leg, a report that gates nothing. |
GET |
/join |
box.join_script |
no bearer |
The one-curl join script a fresh VM runs. Its credential is the one-time enrollment token, which rides the X-Dz-Enroll-Token HEADER and never the query string; this leg validates the shape but does not consume it. |
POST |
/v1/runners/enrollments |
box.add |
write:runners |
Mint a one-time enrollment token. Returned exactly once. |
POST |
/v1/runners/enrollments/ssh |
box.add_ssh |
write:runners |
Enroll over SSH instead: hand us the box’s coordinates and its coding model, and the mothership dials in and runs the join. 503 when the deployment has no platform SSH key. |
GET |
/v1/runners |
box.list |
read:runners |
The fleet boxes enrolled under this account, each with live presence: presence_read tags every row present, absent (offline), or unknown. Unknown is a presence transport fault or no presence store wired: a statement about the read, never that the box is offline. |
POST |
/v1/runners/:id/revoke |
box.revoke |
write:runners |
Cut a box off: the box is told to halt over its control channel (its in-flight run is released back to the queue as it drains), its presence key is dropped, its credential is refused at the next dial and its gateway tokens are cascaded dead. The reversible half is POST /v1/runners/:id/drain, which evacuates a box and leaves it enrolled. |
GET |
/v1/runners/versions |
box.versions |
read:runners |
The fleet’s dz-runner build spread right now: how many boxes run each version, live beat first and the last recorded version as fallback. |
GET |
/v1/runners/releases |
box.releases |
read:runners |
The dz-runner release ledger per build target. A tenant reads the installable builds their own boxes may be pointed at (view: installable); a platform operator holding admin:releases reads the whole ledger, halted rows and build provenance included (view: ledger). Canary builds are read only by the platform account and operators: anyone else is served stable, and channel=canary is refused 403 canary_platform_only. |
POST |
/v1/runners/releases/:channel/:version/unyank |
box.unyank |
admin:releases |
Restore a halted release so it re-enters the installable read. Platform-wide, so it rides the operator scope no account role grants; reports the artifact count it actually cleared. |
POST |
/v1/runners/update |
box.update |
write:runners |
Start a staged self-update rollout of THIS account’s fleet (canary, soak, bounded waves, halting itself on failure). Reports what it started, not an outcome. A second trigger joins the running rollout rather than racing it. The canary channel rolls on the platform account only; anyone else is refused 403 canary_platform_only, and the platform is refused 409 canary-candidate-soaking while its soak candidate is in flight unless supersede_soak is true with a reason (a hotfix, audited with the reason; 400 supersede-reason-required without one). The 202 of a supersede carries supersede: the replaced candidate and earliest_stable_promote_at, the earliest instant stable can next be promoted once the soak restarts. |
GET |
/v1/runners/:id |
box.get |
read:runners |
One box in full: its row plus live presence (online, active sessions, reported version, telemetry); presence: 'unknown' + presence_error when the presence KV could not be read, never an offline box. 404 when unknown or foreign. |
POST |
/v1/runners/:id/drain |
box.drain |
write:runners |
Take a box out of the assignable pool, in one of two modes ({"mode": …}, optional body). evacuate (the default): re-queue its in-flight work now. graceful: let its in-flight task finish, hand it nothing new, and answer cordoned_iso; 409 for a revoked box. Either way it stays out, heartbeat or not, until POST /v1/runners/:id/undrain, and stays enrolled. Killing one is POST /v1/runners/:id/revoke. |
POST |
/v1/runners/:id/decommission |
box.decommission |
write:runners |
Take a box OUT of the fleet in one act: drain (in-flight work re-queued now) → revoke (row, gateway tokens, the halt over its control channel, presence dropped) → audit runner.decommissioned. 404 when unknown or foreign; a cascade_failed token kill is a 200 carrying the detail (the box is gone, one idempotent retry owed). The box-side half is sudo dz-decommission on the machine. |
POST |
/v1/runners/:id/creds/reissue |
box.reissue_creds |
write:runners |
Operator-initiated credential re-issue for a healthy box: mint a fresh fleet credential on demand. Convenience, not recovery. The verb rides the NATS control plane, which is exactly what a box with a lapsed credential has lost, so a locked-out box is systemctl restart dz-runner. A foreign id, an unknown id, and a revoked box all answer 404 (under a MEMORY resolver, refusing the roll-forward is the mechanism that makes revocation converge, and distinguishing it would tell a caller a box exists when it does not); a deployment without a NATS account signing key answers 503, the same posture the box-initiated leg carries. |
PUT |
/v1/runners/:id/owner |
box.set_owner |
write:runners |
Retarget which work a box claims: org (this account) or user (one member, across their orgs). 422 when the target cannot own a box here. |
PUT |
/v1/runners/:id/prompt |
box.set_prompt |
write:runners |
Set or clear the box’s concise operator briefing (what this VPS runs, how to dispatch on it). Max 2000 characters; send null to clear. |
PATCH |
/v1/runners/:id |
box.rename |
write:runners |
Rename a box, or send display_name: null to restore its generated name. 1-64 characters after trimming, one line; answers the GET /v1/runners/:id shape. 404 when unknown or foreign; 409 for a revoked box. |
PUT |
/v1/runners/server-label |
box.server_label |
write:runners |
Name the physical server a set of machines runs on, or send server_label: null to clear it. All named machines are labelled in one transaction, or none: 404 when any id is unknown or foreign, 409 when any is revoked. One audit row per machine. |
GET |
/v1/runner-groups |
box.group_list |
read:runners |
Every machine group of the account, by name ignoring case (an empty group included). The whole set on every read: next_cursor is always null. A machine in no group is Ungrouped. |
POST |
/v1/runner-groups |
box.group_create |
write:runners |
Create a machine group { name }: 201 { group }. 409 group_name_taken when the account already has the name, ignoring case. Audited as runner_group.created. |
PATCH |
/v1/runner-groups/:id |
box.group_rename |
write:runners |
Rename a machine group { name }: { group, previous_name }. 404 group_not_found for an unknown group; 409 group_name_taken. Audited as runner_group.renamed with the old and new name; the same name writes nothing. |
DELETE |
/v1/runner-groups/:id |
box.group_delete |
write:runners |
Delete a machine group; its machines go to Ungrouped, and no machine is deleted. Answers { id, name, moved }, moved the live machines sent to Ungrouped. 404 group_not_found for an unknown group. Audited as runner_group.deleted. |
PUT |
/v1/runners/group |
box.set_group |
write:runners |
Move machines into a group, or send group_id: null for Ungrouped. All named machines move in one transaction, or none: 404 group_not_found, 404 runner_not_found when any id is unknown or another account’s, 409 revoked when any is revoked. Answers { runner_ids, group_id, moved }, moved the ids whose group changed; one runner.grouped audit row each. |
POST |
/v1/runners/:id/work |
box.send |
write:tasks |
Send a GitHub pull request or issue to ONE machine under one role (needs write:tasks and write:runners). Reviewer takes pull requests; Coder (worker), Scout and Escalation take issues. Answers 201 with the task, whose target_runner_id holds it on this machine for ten minutes. 404 when the machine is unknown or not this account’s; each refusal (409/422) carries reason and role, and mints nothing. |
POST |
/v1/runners/:id/moves |
box.move |
write:tasks |
MOVE jobs from this machine to another (needs write:tasks and write:runners, and an Idempotency-Key header: 400 idempotency_key_required without it). Body {items: [{kind, id}], target_runner_id, undo_of?}; an item is a task, an epic (id a plan id: its slices here move and its queued slices are sent to the target for 10 min, at most 8 tasks a batch) or a group (id a mode key: its jobs here that can move). A running job checkpoints through the pause verb (only off a machine whose build reads it), saves its work and resumes on the target from it; a paused job re-pends to the target at once. Limits: 4 moves per machine per rolling 60 s (a request costs one per job here, at most 4, charged to both machines), each moved job rests 20 s, 2 transfers in flight per org. 201 {batch: {id, from_runner_id, to_runner_id, cost, items: [{task_id, state}]}, budget: {source, target: {left, free_at}}}. Refused as 409 move-refused / 429 move-rate-limited (with Retry-After), each with reason, side, machine_id, item and, for a limit, left, needs, free_at. A refusal changes nothing. 404 when either machine is not this account’s. |
POST |
/v1/runners/:id/moves/preview |
box.move_preview |
write:tasks |
PREVIEW a move off this machine (needs write:tasks and write:runners). Body {items}. Writes nothing and spends nothing. 200 {cost, source: {left, free_at, refusal?, cpu}, targets: [{runner_id, refusal?, left_after, cpu, memory}]} for every other machine of the account. cpu is {before, after} busy percent and memory {before, after} free bytes, projected from the beats’ real readings only, null when any reading is unknown. 404 when the machine is not this account’s. |
GET |
/v1/box-grants |
box.grant_list |
read:runners |
The grants this account is on either side of: boxes it lends and boxes lent to it, keyset-paged by next_cursor. |
POST |
/v1/box-grants |
box.grant_offer |
write:runners |
Offer one of this account’s boxes to another account, as an owner. It moves no work until an owner of that account accepts. 422 isolation_unattested when the accounts have different owners. |
POST |
/v1/box-grants/:id/accept |
box.grant_accept |
write:runners |
Accept a grant offered to this account, as an owner of it, naming the terms_version you read. The box’s owner has root on the machine, and can read this account’s source, tokens and keys during a run. |
POST |
/v1/box-grants/:id/revoke |
box.grant_revoke |
write:runners |
End a grant, as an owner of either side. Running jobs finish; the box claims nothing new under it. |
POST |
/v1/runners/max-slots/reset |
box.max_slots_reset |
write:runners |
Set every live box of the account to 1 job at once, the undo for multi-job. Body exactly { confirm: true }. Answers each box with its previous cap; one audit row. |
PUT |
/v1/runners/:id/max-slots |
box.max_slots |
write:runners |
Set the most jobs this box runs at once (1-8). 404 when unknown or foreign; 409 for a revoked box. Answers the previous cap. |
GET |
/v1/runners/:id/stats |
box.history |
read:runners |
One machine’s cpu, memory and disk over the last 1h, 24h or 7d: each bucket’s maximum percentage, only buckets that hold a sample, plus when the range’s data starts and ends. 404 when the machine is unknown or another account’s. |
POST |
/v1/runners/:id/undrain |
box.undrain |
write:runners |
Re-enable a drained box, either mode: clear its evacuate mark (it rejoins the fleet on the next presence sweep after a live heartbeat; this does not mark it online itself) and its graceful cordon (an online box is assignable again at once). drain_cleared / cordon_cleared say which were set; cleared: false when neither was. |
POST |
/v1/runners/:id/pause-jobs |
box.pause_jobs |
write:runners |
PAUSE every job this machine holds for the account, each as POST /v1/tasks/:id/pause would. The machine keeps taking new work (that is the drain). No body. 200 {box_id, pause_requested, paused, resumed, pause_withdrawn, skipped: [{task_id, reason}]}, where reason is the task door’s 409 reason. Only this account’s jobs on the machine are touched or listed. 429 pause-rate-limited with Retry-After past 6 changes in 30 s (one per call). 404 for an unknown, foreign or revoked machine. |
POST |
/v1/runners/:id/resume-jobs |
box.resume_jobs |
write:runners |
RESUME every job paused on this machine for the account, each as POST /v1/tasks/:id/resume would without anywhere (and withdraw a pause a running job has not honoured yet). A job whose machine cannot take it is listed under skipped; next_step names the way out. No body. 200 {box_id, pause_requested, paused, resumed, pause_withdrawn, skipped: [{task_id, reason}]}, where reason is the task door’s 409 reason. Only this account’s jobs on the machine are touched or listed. 429 pause-rate-limited with Retry-After past 6 changes in 30 s (one per call). 404 for an unknown, foreign or revoked machine. |
POST |
/v1/runners/releases/:version/promote |
box.promote |
admin:releases |
Ask for the promote of a soaked canary dz-runner build to stable, for EVERY tenant. Records who asked on the platform audit log, then starts the release run that publishes it; refused until the build has soaked 24 h on canary. Platform owner only (admin:releases, a credential naming a person). |
POST |
/v1/runners/releases/:channel/:version/yank |
box.yank |
admin:releases |
Withdraw a broken canary dz-runner build: no wave installs it and the canary soak grades it failed, so the next canary pass goes out with no supersede. Canary only; a required reason is stored on the audit row. Idempotent (yanked: false when already withdrawn); 404 for a version the canary ledger does not hold, 409 when it is the only installable canary build. |
GET |
/v1/fleet/utilization |
box.utilization |
read:runners |
The one read the command center polls: per-box load, BYOK key pool heat and per-lane backlog depth, in one call. key_room names the AI keys holding a free slot beside waiting work long enough to be a dispatch fault; with read:tasks, queue splits the backlog into ready and held work and names the top reasons holding it. presence: 'unknown' + presence_error on the body (and presence: 'unknown' on every box) when the presence KV could not be read or none is wired (a deployment without NATS), never an offline fleet. Each machine row carries roles: for one of the account's own org machines, one entry per role a machine switch can set, in the card's order, with machine_enabled (its own switch), effective, running (tasks it holds for this account under that role) and blocked (org_off, cannot_converse or needs_update, the first that holds; needs_update only with write:prompts); null on a user-owned or cross-org row. Writes nothing. |
GET |
/v1/fleet/live |
box.fleet_live |
read:runners |
The org's live pipeline, from stored rows only: up to 100 items (coding tasks and asks not yet tasks, newest activity first), each with its stage (Ask, Triage, Plan, Picked up, Pull request, Fixed until green, Merged, Shipped), state, machine, open blocker and squad; stage counts; the 16 busiest online machines of the fleet utilization rows; merges and deploys since 00:00 UTC; the median cycle; the merge gate; commits per minute; live agents per squad; up to 8 squads ranked by live agents then commits; and the 14 newest events. A number with no stored source is absent from the body, never 0. The same body streams as the fleet_live topic of GET /v1/streams. Writes nothing. |
GET |
/v1/fleet/sizing |
box.sizing |
read:runners |
Which boxes this account needs, from its own repos' measured memory and run times. 200 {minRamGb, largest, jobsPerBox, jobsPerBoxBasis, suggestedBoxes, extraBoxes, extraBoxesToRunAllAtOnce, backlogJobHours, clearHours, waitingWithoutDuration, jobsOverHorizon, boxesWithoutCap, demand: {waiting, running, boxes, slots}, reason, repos: [{repo, lane, reservationMib, basis, runs, minRamGb, reason}]}. A lane reserves what the claim reserves for it (its p99 x 1.25 over 30+ runs, else the repo's pooled runs, else the fleet-wide estimate: basis says which); minRamGb is the smallest common box size whose per-task cap holds the largest reservation. extraBoxes is the recommendation: the fewest new boxes on which every job waiting only for a box, placed whole by memory and slots beside the current boxes, finishes within clearHours (8) at its measured run time; jobsOverHorizon counts jobs longer than that alone, never in it; extraBoxesToRunAllAtOnce is context only. Writes nothing. |
Agent templates
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/templates |
template.list |
read:runners |
Every agent template on this account. |
GET |
/v1/templates/:name |
template.get |
read:runners |
One agent template by name. |
PUT |
/v1/templates/:name |
template.set |
write:runners |
Create or REPLACE a template by name. A full replace: an omitted field resets to its default, and a compatible backend must carry a base_url. |
DELETE |
/v1/templates/:name |
template.delete |
write:runners |
Delete a template by name. Idempotent. |
Prompt variables
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/prompt-vars |
config.list |
read:runners |
The account prompt variables, optionally narrowed to one scope and ref. |
GET |
/v1/prompt-vars/:scope/:key |
config.get |
read:runners |
One prompt variable at (scope, ref, key). The ref is a repo id or template name, and only repo/template scope takes one. |
PUT |
/v1/prompt-vars/:scope/:key |
config.set |
write:runners |
Set one prompt variable. Plaintext, so NEVER a credential: a secret-shaped value is refused, and sealed secrets belong in /v1/repos/:owner/:repo/secrets. |
DELETE |
/v1/prompt-vars/:scope/:key |
config.delete |
write:runners |
Clear one prompt variable. Idempotent. |
CI runs
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/ci/runs |
ci.runs |
read:runners |
Self-hosted CI runs, newest-first. Filter by repo and status through the shared list grammar (?filter=status:failed), not bare query params. |
GET |
/v1/ci/runs/:id/log-url |
ci.log_url |
read:runners |
An authenticated API path serving one run’s archived log, redacted at download time (text/plain). The path has no link TTL; expires_in_seconds is retained for compatibility only. Logs are retained for 3 days. One 404 covers unknown/foreign, log not landed, log expired and storage unconfigured. |
GET |
/v1/ci/runs/:id/log |
ci.log_download |
read:runners |
The full archived log for one run, redacted at download time (text/plain). One 404 covers unknown/foreign, no log landed, expired log and storage unconfigured. |
Artifacts
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/artifacts |
artifact.list |
read:artifacts |
Artifacts this account produced, newest-first, in pages (50 by default, up to 200; cursor pages on until next_cursor is null). Narrow with run_id, task_id or repo_id. |
POST |
/v1/artifacts |
artifact.put |
write:artifacts |
Record an artifact and mint a presigned PUT for its bytes. You upload to upload_url yourself; our bucket credentials never leave the control plane. Visibility is run or account only, a repo_id, run_id or task_id outside your account is a 404, and 503 means there is no bucket to write to: none on the deployment, or the account’s connected S3 integration cannot be opened. |
GET |
/v1/artifacts/:id/url |
artifact.get |
read:artifacts |
A short-lived presigned GET for one artifact, alongside its metadata. One 404 covers unknown/foreign, bytes that never landed and an object already reaped; 410 means it existed and expired; 503 means the bucket it was stored in cannot be opened. |
POST |
/v1/artifacts/:id/share |
artifact.share |
write:artifacts |
Flip an artifact to public-link and hand back a URL. Audited and outward-facing: it notifies the account, and it refuses an artifact whose bytes are missing, because a share must produce a live link. 403 with reason preview_members_only means it is a plan draft preview, which is members only and never published as a storage link; 410 means it expired and will not be published; 503 means the bucket it was stored in cannot be opened. |
DELETE |
/v1/artifacts/:id |
artifact.delete |
write:artifacts |
Delete the object and its row. Idempotent. 503 when the bucket it was stored in cannot be opened, and 503 when the object itself could not be deleted; the row is kept in both cases, so the bytes can still be removed. |
Sessions
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/sessions |
session.list |
read:sessions |
Recent agent sessions, account-wide. |
GET |
/v1/repos/:owner/:repo/sessions |
session.list_by_project |
read:sessions |
One repo’s sessions. |
GET |
/v1/sessions/:id |
session.get |
read:sessions |
One session: repo, trigger, outcome, model. |
GET |
/v1/sessions/:id/events |
session.events |
read:sessions |
SSE: one session’s audit events. Backfill, tail, terminate. Resumable: each frame’s id: is that row’s keyset cursor, so a reconnect carrying Last-Event-ID continues from it instead of replaying the session. |
GET |
/v1/sessions/:id/events.jsonl |
session.events_export |
read:sessions |
The same events as a JSONL download, one event per line. An export cut short by the connection’s duration cap, or by a read failure after rows were sent, ends with a trailer line {"truncated":true,"next_after":"<cursor>"} instead of an event; send that cursor back as ?after= for the rest. A complete export has no trailer. |
POST |
/v1/sessions/:id/replay |
session.replay |
read:sessions |
Dry-run a candidate policy against a finished session. Read-only: it changes nothing. |
POST |
/v1/fleet/runs/:runId/message |
session.message |
write:tasks |
Send a message to a LIVE run and wait for the agent’s reply: an interactive session (scout, setup) or an autonomous run (coding, team, babysit or devops; not review), whose agent reads it at its next turn boundary. Addressed by the fleet run id, the same id GET /v1/fleet/runs/:runId/events streams, not by a session id. Without write:sessions, only a run whose task you dispatched: any other is a 403 with reason: not_run_dispatcher (user_required for a credential with no human). A run that holds no live channel is a 409. A 200 carries status: replied with the agent’s reply; or, with reply: null and a note, queued (the box holds the message for its next turn, do not resend), read (the agent read it and has not replied yet, do not resend), unconfirmed (no reply, and the box did not confirm it holds the message) or dropped (the run ended before reading it). |
Audit log
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/audit/events |
audit.tail |
read:sessions |
The account-wide audit feed, newest-first. |
Org console
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/terminal/events |
terminal.tail |
read:sessions |
The org console backfill: rendered audit lines, newest first, keyset-paged. |
GET |
/v1/terminal/events/stream |
terminal.stream |
read:sessions |
SSE: the org console’s live tail. 1s poll, resumable via Last-Event-ID, recycles every 10 minutes. |
GET |
/v1/terminal/status |
terminal.status |
read:sessions |
The org console’s status line: worker/key/queue health, from the same reads Fleet’s utilization card and the overview strip use. |
Live streams
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/streams |
stream.subscribe |
per request |
ONE SSE connection multiplexing several topics (?topics=tasks,ci,…), each patch frame upserting or removing one row by id. Every topic is authorized in-handler, so the opening ready frame names which were subscribed, ignored (unknown) and unauthorized; the request 403s only when nothing survives. Not resumable: it patches derived rows rather than appending, so it issues no id: and a reconnect takes a fresh snapshot. |
Knowledge base
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/kb/:repoId/pages |
kb.page_list |
read:kb |
One repo’s knowledge-base pages, the agent-maintained wiki. |
GET |
/v1/kb/:repoId/search |
kb.search |
read:kb |
Trigram-rank the repo wiki (?q=, ?limit= 1..25). Each hit carries slug, score, cross-links and a preview excerpt; pull a full body with the page read. |
GET |
/v1/kb/:repoId/pages/:slug{.+} |
kb.page_get |
read:kb |
One KB page verbatim by slug: body, cross-links, provenance. |
PUT |
/v1/kb/:repoId/pages/:slug{.+} |
kb.page_upsert |
write:kb |
Create or replace one page by slug: a FULL replace, so an omitted links clears the page’s cross-links. Idempotent by (repo, slug). The repo must be enabled: writing into an offboarded repo’s wiki is a 409 naming the fix, not a silent no-op. |
GET |
/v1/kb/status |
kb.status |
read:kb |
Per-repo knowledge-base freshness for this account: one row per enabled repository, with its wiki page count, when the wiki was last imported, when it was last consolidated, and whether background knowledge-base work is enabled for it. A repository with no wiki reads as zero pages and no dates. Writes nothing. |
Dashboards
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/dashboards |
dashboard.create |
write:dashboards |
Create a named board (201). A name already in use is a 409 naming the board it would have destroyed; replace: true is the only consent to rebuild one, and a seeded built-in is never replaceable. |
GET |
/v1/dashboards |
dashboard.list |
read:dashboards |
The boards this caller may see: the account-shared ones plus their own personal boards. |
GET |
/v1/dashboards/:id |
dashboard.get |
read:dashboards |
One board with all its widget specs. |
PATCH |
/v1/dashboards/:id |
dashboard.update |
write:dashboards |
Rename a board and/or change its layout. Widgets are untouched. |
DELETE |
/v1/dashboards/:id |
dashboard.delete |
write:dashboards |
Delete a board and cascade its widgets. An id this account does not own, or one already deleted, is a 404; a seeded built-in is a 409 (duplicate it to customize). |
POST |
/v1/dashboards/:id/widgets/:wid/page |
dashboard.widget_page |
read:dashboards |
Page one widget’s data without re-running the whole board. |
Digests
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/digests |
digest.list |
read:digests |
Digest header rows, newest-first. |
GET |
/v1/digests/:id |
digest.get |
read:digests |
One digest, with its rendered HTML. |
GET |
/v1/digests/:id/questions |
digest.questions |
read:digests |
A weekly report's questions with their live state: open, answered, marked done, closed, or a note. |
POST |
/v1/digests/:id/questions/:entryId/answer |
digest.question_answer |
write:tasks |
Answer one open question of a weekly report, in words (answer) or by one of its choices (choice, with an optional note). The answer is sent to the AI: it files a new request carrying the question and the answer, which triage reads and decides on (it may schedule work, link it, drop it or escalate it). It does not resume the session that asked. An older question with no linked blocker yet is raised first and answered in words. Answers 200 with the question as it now stands. 409 when the question is not open any more (answered, marked done or closed), naming its state; 422 for a note, which has nothing to answer, or a choice the question cannot take. Needs a credential that names a person. |
POST |
/v1/digests/:id/questions/:entryId/done |
digest.question_done |
write:tasks |
Mark one open question of a weekly report done. Nothing is sent to the AI. It is permanent and for the whole team: the question closes for everyone and cannot be answered afterwards. Closes its linked blocker and acks the escalation it stands for, in one transaction; an older question with no linked blocker only acks the escalation. Answers 200 with the question as it now stands. 409 when the question is not open any more, naming its state; 422 for a note. Needs a credential that names a person. |
Notifications
| Method |
Path |
Capability |
Scope |
Description |
GET |
/unsubscribe |
notification.unsubscribe_page |
no bearer |
The confirm page behind an email footer link, authorized by the signed token in that link. It NEVER mutates, because mail scanners and link prefetchers issue GETs. |
POST |
/unsubscribe |
notification.unsubscribe |
no bearer |
Perform the opt-out, on the same signed token. Serves both the confirm form and RFC 8058 one-click. A person's link changes ONE person's own settings; a shared route copy's link stops the weekly summary to that route address for the whole account and changes nobody's settings. Escalations can never be silenced. 400 tampered, 410 expired, 413 a body over 16 KiB. |
GET |
/v1/me/notification-preferences |
notification.prefs_list |
read:account |
Your whole notification settings page: the resolved kind × channel matrix with tiers and locked/available flags, your email cadence, the preset your overrides equal, and your delivery address. |
PUT |
/v1/me/notification-preferences |
notification.prefs_replace |
write:self:notifications |
Replace your whole settings page in one atomic write: a preset, your email cadence (instant or hourly; daily is not served), and cell overrides on top. One locked or unavailable cell anywhere refuses the whole request with nothing written. |
PUT |
/v1/me/notification-preferences/:kind/:channel |
notification.pref_set |
write:self:notifications |
Override one kind/channel pair. |
DELETE |
/v1/me/notification-preferences/:kind/:channel |
notification.pref_clear |
write:self:notifications |
Clear an override, back to the default. |
POST |
/v1/me/notification-test-email |
notification.test_email |
write:self:notifications |
Send one test email to your own address. |
GET |
/v1/notifications |
notification.inbox_list |
read:account |
The in-app notification inbox. |
POST |
/v1/notifications/:id/read |
notification.mark_read |
read:account |
Mark one notification read. |
POST |
/v1/notifications/read-all |
notification.mark_all_read |
read:account |
Mark the whole inbox read. |
GET |
/v1/me/notification-estimate |
notification.estimate |
read:account |
About how many emails a week your current settings mean, replayed from your own last 7 days, with the total each preset would give. truncated means the 7 days held more events than one read replays. |
GET |
/v1/me/notification-deliveries |
notification.deliveries_list |
read:account |
Your own email notifications from the last 7 days, newest first, each with a why code saying why it was or was not sent. |
Web push
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/push/public-key |
push.public_key |
read:account |
The VAPID public key a browser needs before it can subscribe. |
GET |
/v1/push/subscriptions |
push.subscriptions_list |
read:account |
The Web Push endpoints registered for this user. |
POST |
/v1/push/subscriptions |
push.subscribe |
read:account |
Register a Web Push endpoint. |
DELETE |
/v1/push/subscriptions |
push.unsubscribe |
read:account |
Forget one Web Push endpoint. |
Email routes
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/email-routes |
email_route.list |
read:account |
The resolved notification category → address matrix. |
PUT |
/v1/email-routes/:category |
email_route.set |
write:account |
Override one category’s route. |
DELETE |
/v1/email-routes/:category |
email_route.delete |
write:account |
Clear an override, back to the default. |
DELETE |
/v1/email-routes/:category/opt-out |
email_route.resume |
write:account |
Mail the weekly summary again to a route address that stopped it from the email link. |
Email bounce status
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/me/email-status |
email_status.get |
read:account |
Whether notification email to the signed-in user's current address is suppressed after a hard bounce: bouncing, and when true the address and the ISO-8601 since. |
POST |
/v1/me/email-status/retry |
email_status.retry |
read:account |
Lift the hard-bounce suppression on the signed-in user's current address so the next notification is mailed again. Idempotent: cleared is false when nothing was suppressed. A further bounce suppresses it anew. |
Outbound webhooks
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/webhooks |
webhook.list |
read:webhooks |
The outbound webhook subscriptions. |
GET |
/v1/webhooks/deliveries |
webhook.deliveries |
read:webhooks |
The delivery ledger: what we sent and what answered, newest first. Narrow it to one endpoint with ?filter=webhook_id:<uuid> rather than paging the whole account. |
POST |
/v1/webhooks |
webhook.create |
write:webhooks |
Subscribe a URL to a set of events. The signing secret is minted here and returned exactly ONCE; it is sealed at rest and never re-read. |
DELETE |
/v1/webhooks/:id |
webhook.delete |
write:webhooks |
Delete a subscription. |
POST |
/v1/webhooks/:id/test |
webhook.test |
write:webhooks |
Send a test delivery to one subscription. |
Integrations
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/integrations |
integration.list |
read:integrations |
The account’s connected integrations. Status only; credentials never cross the boundary. |
POST |
/v1/integrations |
integration.connect |
write:integrations |
Connect a service by pasting its credential, sealed on write and never echoed. |
DELETE |
/v1/integrations/:kind |
integration.disconnect |
write:integrations |
Disconnect a connector: drops the row and its vault secret. |
Inbound webhook sources
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/webhook-sources |
webhook_source.list |
read:integrations |
The account’s inbound webhook sources (tracker, CI, GitLab, Gitee), oldest first and paged: url, gesture, health, and for a forge source the instance host and project path. No secret is ever returned. |
POST |
/v1/webhook-sources |
webhook_source.connect |
write:integrations |
Connect an inbound webhook source. A gitlab (gitlab.com or jihulab.com) or gitee source takes the signing secret, an API token and the project path; the token is proven by one read of the project. A gitlab source may omit the signing secret: the platform then mints it and creates the project webhook itself, and the answer says whether it did (webhook_created: true, false, or null when GitLab gave no definite answer and the webhook could not be confirmed); when not true, webhook_reason and webhook_error say why and webhook_next_step gives the manual fallback. Secrets are sealed and never returned; a generic source’s minted secret is returned once. |
POST |
/v1/webhook-sources/:id/rotate |
webhook_source.rotate |
write:integrations |
Rotate a source’s signing secret: store the vendor’s new one (vendor_secret), or mint one for a generic source, returned once. The secret it replaces keeps verifying for the rotation window, and only until the next rotation: the overlap covers the one immediately previous secret, so rotating again ends it and a sender still on an older secret stops verifying. A new API token is POST /v1/webhook-sources/{id}/api-token, which keeps the url. |
POST |
/v1/webhook-sources/:id/api-token |
webhook_source.api_token |
write:integrations |
Replace a gitlab (GitLab or JiHu) or gitee source’s API token in place, when the forge expires or revokes it: same id, url, signing secret and project. The new token must read the source’s own project on its own instance (and on GitLab carry the api scope and at least the Developer role there: a Reporter token is refused with 422 even with api), or nothing changes. A read failure the old token left resets the source to connected. The token is sealed and never returned. |
PATCH |
/v1/webhook-sources/:id |
webhook_source.update |
write:integrations |
Replace a source’s drop rules and, on a Sentry source, its project routes, in place: same url, same secrets. |
DELETE |
/v1/webhook-sources/:id |
webhook_source.disconnect |
write:integrations |
Disconnect a source: deliveries stop verifying, and the row and its sealed secrets are deleted. |
Account secrets
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/secrets |
secret.list |
read:secrets |
The account’s named secrets: names and timestamps only, never a value. |
POST |
/v1/secrets |
secret.set |
write:secrets |
Store a named secret, sealed before anything else touches the value. |
DELETE |
/v1/secrets/:name |
secret.delete |
write:secrets |
Delete one named secret. Only the dashboard: namespace is deletable here; an integration’s secret is refused at the edge. |
Hosting-provider keys
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/provider-keys/:provider |
provider_key.get |
read:secrets |
How to mint the account’s hosting-provider API key (GET rules, plus POST on the two support-ticket routes and on each listed server’s reinstall) and whether one is stored. Never a key part. |
PUT |
/v1/provider-keys/:provider |
provider_key.set |
write:secrets |
Store or rotate the account’s hosting-provider API key and its region. Sealed on arrival, held by the control plane, never sent to a machine. |
DELETE |
/v1/provider-keys/:provider |
provider_key.delete |
write:secrets |
Remove the account’s hosting-provider API key. The provider broker refuses every read for the account after it. |
Repository secrets
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/repos/:owner/:repo/secrets |
project_secret.list |
read:secrets |
One repo’s stored secrets: name, exposure, environment and timestamps ONLY. A read never yields a value, because the ciphertext column is projected by exactly one query and this is not it. |
PUT |
/v1/repos/:owner/:repo/secrets |
project_secret.set |
write:secrets |
Store one repo’s sealed .env for one environment, as a whole pasted .env (parsed server-side) or as explicit rows. environment is required and never defaulted, and a malformed line refuses the WHOLE paste naming only its line number. |
DELETE |
/v1/repos/:owner/:repo/secrets/:name |
project_secret.delete |
write:secrets |
Delete one repo secret by name, optionally scoped to one environment. |
System prompts
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/system-prompts/org |
system_prompt.org_get |
write:prompts |
The org-wide system prompt. |
PUT |
/v1/system-prompts/org |
system_prompt.org_set |
write:prompts |
Set it. |
DELETE |
/v1/system-prompts/org |
system_prompt.org_clear |
write:prompts |
Clear it. |
GET |
/v1/system-prompts/repo/:repoId |
system_prompt.project_get |
write:prompts |
One repo’s system prompt. |
PUT |
/v1/system-prompts/repo/:repoId |
system_prompt.project_set |
write:prompts |
Set it; the repo layer wins over the org one. |
DELETE |
/v1/system-prompts/repo/:repoId |
system_prompt.project_clear |
write:prompts |
Clear it. |
LLM routing
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/agent-pauses |
llm_route.pauses |
read:billing |
The agents set to a key that are paused or running on a backup, as one whole page: data of {agent, kind, key_label, model, pinned_model, until_iso}. kind is held (every model on the key is out; model null; until_iso when the first model is back) or on_backup (a lower model of the key serves; until_iso when the set model is back). One entry per agent; empty when nothing is paused. The pause banner, the Fleet notices and the agent card read this. |
GET |
/v1/llm-routes |
llm_route.list |
read:billing |
The model-routing pins: the routing override each purpose carries (key_label, provider, model, any combination, plus its reasoning_effort), at org and repo scope. |
GET |
/v1/llm-routes/preview |
llm_route.preview |
read:billing |
What each purpose resolves to right now, over the claim's own resolver code: one entry per task lane plus gardener, each with the pick (provider, model, key label, source pin|pool) a task arriving now would get, a wait (reason saturated|cooling|credits_exhausted, the key it waits on, an optional retry_at_iso) when the lane cannot start now (its selected key is full or cooling, or higher-ranked work holds every key), a fallback when a pin exists but something else serves (pin_unserved: the selection names no working key), or a blocker with stalls / box_env. A purpose whose route has fallbacks also carries rungs: its pin, then each fallback, graded on the claim's own per-key verdict live, cooling (with retry_at_iso when a reset is stated) or unserved with a why (model_denied, structured_unproven, router_lacks_model, model_parked, not_listed, no_key); a live rung may carry note router_pool_unlisted (served on a key row the cached router listing does not name yet). omitted lists every route purpose with no entry and why (catch_all, pin_only, read_by_nothing), so absence never means no route. Coding lanes also report their online template boxes. Read-only; cached 15 s per account and repo. 404 for a repo_id outside the account. |
GET |
/v1/llm-routes/denied-models |
llm_route.denied_models_get |
read:billing |
The models this org never runs: {denied_models}, a list of model ids and vendor:<name> entries, empty when nothing is denied. A denied model is never picked on any route, fallback rung or key, even one that serves it. |
PUT |
/v1/llm-routes/denied-models |
llm_route.denied_models_set |
write:billing |
Replace the deny list: body {denied_models} (up to 50 unique model ids; [] clears). An id with no vendor/ prefix also denies the same model under any gateway namespace or :variant (gpt-6-luna denies openai/gpt-6-luna). A vendor:<name> entry denies every model that vendor makes, and every model of a key that reaches only that vendor (today: vendor:anthropic); an unknown vendor is refused. Answers the new list, the previous one and updated_at_iso; audited as llm_route.denied_models_set when the list moved. |
PUT |
/v1/llm-routes/org/:purpose |
llm_route.org_set |
write:billing |
Pin one org-wide routing override for one purpose: key_label, provider and model are each optional and at least one is required. A key_label whose key has the agent of this purpose switched off is refused 422 (default and escalation never are). Optional reasoning_effort (low|medium|high|xhigh|max) needs provider and model; 422 when that model cannot take it. Optional fallbacks (up to 8 {provider?, model?} rungs) is the ladder of the route: a lane walks it in order once the pin cannot serve, admitting only the first rung with a live model, so a rung below runs only when every rung above is cooling or parked. A key cooling until its reset proves a rung model it lists active or has served, so a subscription rung saves while it cools. Optional expect ({updated_at_iso} you read, or {absent: true}) makes the save conditional: 409 naming who saved first when the route changed. |
DELETE |
/v1/llm-routes/org/:purpose |
llm_route.org_clear |
write:billing |
Clear the org pin for one purpose. Optional ?expect_updated_at= (the updated_at_iso you read) refuses a clear of a route that changed since, 409 naming who saved it. |
PUT |
/v1/llm-routes/repo/:repoId/:purpose |
llm_route.project_set |
write:billing |
Pin one routing override for one purpose on one repo (same key_label / provider / model body as the org door); the repo pin wins over the org one. A key_label whose key has the agent of this purpose switched off is refused 422 (default and escalation never are). Optional reasoning_effort (low|medium|high|xhigh|max) needs provider and model; 422 when that model cannot take it. Optional fallbacks (up to 8 {provider?, model?} rungs) is the ladder of the route: a lane walks it in order once the pin cannot serve, admitting only the first rung with a live model, so a rung below runs only when every rung above is cooling or parked. A key cooling until its reset proves a rung model it lists active or has served, so a subscription rung saves while it cools. Optional expect makes the save conditional: 409 naming who saved first when the route changed. |
DELETE |
/v1/llm-routes/repo/:repoId/:purpose |
llm_route.project_clear |
write:billing |
Clear the repo pin for one purpose. Optional ?expect_updated_at= refuses a clear of a route that changed since you read it, 409 naming who saved it. |
Agent modes
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/maintenance-window |
agent_mode.window_status |
read:account |
The account's active maintenance window and what it is DOING, read from what ran (never the config): holding (no held-origin task claimed and no forge write by the App since it began, no enabled repo whose claim would take a held task now, none running), draining (runs claimed before it began, named, still finishing) or leaking (a held-origin task claimed, or a forge write, after it began, or a repo whose claim would admit one now, each named in leaking, forge_writes or repos). window: null when none is active. |
POST |
/v1/maintenance-window |
agent_mode.window_open |
write:merge:gate |
Open a maintenance window from now to ends_at (at most 72 h): every task origin but review is held at the claim, merges and babysit's forge actions are refused, and scheduled checkups skip, until it ends by itself or is closed. Writes no agent mode. 409 while one is open; 422 on an end in the past or past the cap. Audited (maintenance_window.opened). |
PATCH |
/v1/maintenance-window |
agent_mode.window_extend |
write:merge:gate |
Move the active window's end later, still within 72 h of its start. 409 with no active window; 422 on an end that is not later or past the cap. Audited (maintenance_window.extended). |
DELETE |
/v1/maintenance-window |
agent_mode.window_close |
write:merge:gate |
Close the active maintenance window now; held work resumes on the next claim pass. 409 with no active window. Audited (maintenance_window.closed). |
GET |
/v1/agent-modes |
agent_mode.org_list |
write:prompts |
The org's effective agent modes (scout, worker, reviewer, devops, ci_fixer): enabled, the code_tools allowlist (null = the full ceiling), floor, and which row won (source org | default) at which revision. |
PUT |
/v1/agent-modes |
agent_mode.org_set |
write:prompts |
Set the org override for one mode (mode_key): enabled (false holds its tasks until re-enabled) and an optional code_tools allowlist inside the mode ceiling. Replaces the row; 422 on a widening, a list below the floor, tools on reviewer, or a mode this scope cannot set. Optional expect ({revision} you read, or {absent: true}) makes the save conditional: 409 naming who saved first when the override changed. |
DELETE |
/v1/agent-modes/:modeKey |
agent_mode.org_clear |
write:prompts |
Reset one mode at org scope back to its code default (enabled, full ceiling). Optional ?expect_revision= refuses a reset of an override that changed since you read it, 409 naming who saved it. |
GET |
/v1/agent-modes/repo/:repoId |
agent_mode.project_list |
write:prompts |
One repo's effective agent modes: the repo override beats the org one, which beats the default (source repo | org | default), with each mode's ceiling, floor and revision. |
GET |
/v1/agent-modes/repos |
agent_mode.project_list_many |
write:prompts |
Many repos' effective agent modes in one read: ?repo_ids= is 1 to 100 comma-separated repository ids, and each row is {repo_id, modes} where modes is what GET /v1/agent-modes/repo/:repoId answers. An id that is not one of your repos is left out; rows keep the request order. |
PUT |
/v1/agent-modes/repo/:repoId |
agent_mode.project_set |
write:prompts |
Set one repo's override for one mode (same body as the org door); it beats the org override. 422 on a widening, a list below the floor, tools on reviewer, or a mode this scope cannot set. Optional expect makes the save conditional: 409 naming who saved first. |
DELETE |
/v1/agent-modes/repo/:repoId/:modeKey |
agent_mode.project_clear |
write:prompts |
Reset one repo's override for one mode, so the org override (or default) applies. Optional ?expect_revision= refuses a reset of an override that changed since you read it, 409 naming who saved it. |
GET |
/v1/agent-modes/machine/:runnerId |
agent_mode.machine_list |
read:runners |
One of this account's own org machines' role switches: each machine-writable mode (worker, ci_fixer, reviewer, scout, devops, escalation, gardener, planner, triage) with enabled, revision, updated_at, updated_by and source (machine, or default with no row: on). A machine switch is ANDed with the org/repo setting and never turns an org's or a repo's off back on. 404 for another org's machine or a user-owned one. |
PUT |
/v1/agent-modes/machine/:runnerId |
agent_mode.machine_set |
write:runners |
Switch one mode on or off on one of your own org machines ({mode_key, enabled}, nothing else). A switch already in effect answers 200 with the state and changes nothing. 409 last-role-on when it would leave every work mode off (worker, ci_fixer, reviewer, scout, devops, gardener, planner or triage; escalation decorates work and never counts); 429 with Retry-After on the 7th saved change for the machine within 30 s; 404 for another org's machine or a user-owned one. |
DELETE |
/v1/agent-modes/machine/:runnerId/:modeKey |
agent_mode.machine_clear |
write:runners |
Drop one mode's machine switch on one of your own org machines, so the mode reads on there again. 204 whether or not a switch was stored (only a removal is audited and counted); 429 with Retry-After on the 7th saved change within 30 s; 404 for another org's machine or a user-owned one. |
Agents
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/agents/activity |
agent.activity |
read:tasks |
Per platform agent (coder, reviewer, ci_fixer, planner, scout, devops, gardener, escalation, triage, screen, default): tasks running now, when it last ran, the last 7 days' worked and failed counts (cancelled counts neither way), and, on the agents a mode governs, whether that mode is switched on at org scope. machines is { on, total }: on how many of the account's own org machines the agent's role can run now (online, not drained, its machine switch and org mode on, a box role that runs it, and a build at the fleet's version floor), of how many; null for an agent no machine switch governs yet and on every agent when machine presence could not be read. null means the agent has no such record, never zero. Writes nothing. |
GET |
/v1/agents/history |
agent.history |
read:billing |
Who last changed one agent's model pin or on/off switch, and its timeline: the agent's llm_route and agent_mode changes newest first (5 a page by default, cursor pages older), each with the member who made it (actor: id, login, avatar), the credential kind (via: session | pat), and for a pin the value before and after. A mode change carries only enabled, never its tool lists. Writes nothing. |
GET |
/v1/agents/queue |
agent.queue |
read:tasks |
The pull requests and tasks one agent holds right now: the account's tasks in a live status whose origin is that agent's (for escalation, the stuck-PR rescue rounds), newest update first (25 a page by default, cursor pages older). Each row carries its state (queued: pending, with hold_reason and hold_until_iso when held; running: on a box, with runner_id and run_id; watching: its PR open under the babysit watch), the repo, the PR number and the title. For escalation the first page (no cursor) leads with its STUCK PRs, longest idle first and at most 100, outside the page size: open AI-managed PRs parked on what holds them, each stuck with who opened it (author_login), park_class, park_reason, blocker, its idle clocks (idle_since_iso, idle_basis), last_action, rescue_due_at_iso and the newest escalation's delivery_state. An agent that runs no task of its own (screen, default) is refused with agent-has-no-queue. Writes nothing. |
Billing
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/billing/stripe/webhook |
billing.stripe_webhook |
no bearer |
Stripe’s own callback. No bearer: the raw body is HMAC-verified against the endpoint secret, so nothing else can call it. A body over 1 MiB is a 413, refused before the HMAC runs. |
GET |
/v1/billing/keys |
billing.keys_list |
read:billing |
The ORG pool of BYOK keys, masked. The caller’s personal pool is /v1/me/keys. |
GET |
/v1/billing/usage |
billing.usage |
read:billing |
Usage rollup for the current billing window, plus the agent-hours band: used/cap in HOURS and the UTC instant they reset. null means no ceiling applies. |
GET |
/v1/billing/entitlements |
billing.entitlements |
read:billing |
The account’s tier entitlements. |
POST |
/v1/billing/portal |
billing.portal |
write:billing |
Mint a Stripe billing-portal URL. |
POST |
/v1/billing/checkout |
billing.checkout |
write:billing |
Buy AI devs: {tier: "pro", quantity} → a hosted Stripe Checkout URL. This is the FIRST subscription, which the portal cannot create; 503 when Stripe or the seat offer’s price is unconfigured. AI devs are sold only in pairs, so a quantity of 0 or an odd count is a 422 billing-seats-not-in-pairs. An account that already holds a seat subscription gets a 409 billing-seat-subscription-exists (plan and seat changes go through the portal). |
PATCH |
/v1/billing/cap |
billing.set_cap |
write:billing |
Set the monthly spend cap. |
POST |
/v1/billing/keys |
billing.key_add |
write:billing |
Add an org BYOK key, sealed and captured, never echoed. |
DELETE |
/v1/billing/keys/:id |
billing.key_delete |
write:billing |
Delete an org BYOK key. |
POST |
/v1/billing/keys/:id/verify |
billing.key_verify |
write:billing |
Verify an org key against its provider (live probe). |
POST |
/v1/billing/keys/:id/rotate |
billing.key_rotate |
write:billing |
Replace an org key’s secret in place, keeping its id. |
PATCH |
/v1/billing/keys/:id/kind |
billing.key_kind_set |
write:billing |
Re-stamp an org key’s billing nature (subscription ⇄ metered). |
PATCH |
/v1/billing/keys/:id/priority |
billing.key_priority_set |
write:billing |
Set an org key’s pool priority: an integer in [0, 10000], LOWER is tried first (new keys rank last). |
POST |
/v1/billing/providers/models |
billing.provider_models |
write:billing |
List the models a provider key can address, before it is captured. The key rides in the body and is never stored; the answer is model ids, so a maintainer picks one instead of typing it. |
GET |
/v1/billing/keys/:id/models |
billing.key_models |
read:billing |
The same list for an org key already in the pool. |
GET |
/v1/billing/log-sink |
billing.log_sink_get |
read:billing |
The LLM-log sink config. |
PUT |
/v1/billing/log-sink |
billing.log_sink_set |
write:billing |
Set it, validated and probed and sealed before it is stored. |
DELETE |
/v1/billing/log-sink |
billing.log_sink_clear |
write:billing |
Clear it. |
GET |
/v1/billing/capacity |
billing.capacity |
read:billing |
Key concurrency, the block MCP billing capacity serves: per key its running units, waiting tasks and effective capacity, plus the account line and totals (null capacity = unbounded). 503 when the capacity ledger is unreadable. |
PATCH |
/v1/billing/keys/:id/capacity |
billing.key_capacity_set |
write:billing |
Declare an org key’s concurrency capacity: model streams it sustains at once, an integer in [1, 256]; null clears it (the default for its kind applies). |
PATCH |
/v1/billing/keys/:id/agents |
billing.key_agents_set |
write:billing |
Set which agents may never use an org key (disabled_agents, [] = every agent on). dry_run: true writes nothing and answers, per agent whose switch moves, the usable-key counts and the key each of its lanes would resolve to, plus the embedding lane and any Agents-page pin that would stop being usable. A write answers the masked key; both answer pinned_routes_affected: [{purpose, scope, repo_full_name?}], each route pin naming this key for an agent this call switches off (the pin stays; its lane runs on its fallbacks). 409 byok-key-agents-last-key when an agent would be left with no usable key and confirm_last_key is not true. |
PATCH |
/v1/billing/keys/:id/active |
billing.key_active_set |
write:billing |
Pause (active: false) or resume (active: true) an org key without revoking it. A paused key keeps its status, switches and order and is still listed; no new work picks it, and running work finishes on it. A revoked key is 404. |
GET |
/v1/billing/keys/activity |
billing.key_activity |
read:billing |
Per org key that is not revoked, in the keys page order: jobs_started_7d and jobs_done_7d over today and the six UTC days before it (distinct fleet tasks first assigned to the key, plus in-cluster sessions that started on it; done = the work landed, or the session completed), moved_away_today (times work moved off the key to the next one since UTC midnight), and per_day, the same jobs by UTC day and agent (agent: null for in-cluster sessions whose row names no agent). stuck is the pending work held because every usable key has that agent switched off, per agent. Writes nothing. |
GET |
/v1/billing/keys/:id/history |
billing.key_history |
read:billing |
One org key’s change history: its billing.key.* audit rows (captured, verified, invalid, status, priority, capacity, agents, active, label, model parked or edited, …) newest first, 25 a page by default, cursor pages older. Each row carries kind, at_iso, the member (user_id, null for a platform lane), and where the row says them the model, the moved from / to values and a redacted reason. A revoked key keeps its history; a key outside the org pool is 404. Writes nothing. |
PATCH |
/v1/billing/keys/:id/label |
billing.key_label_set |
write:billing |
Rename an org key’s route-pin label (1-64 chars; null clears it). Every pin in the account naming the old label moves with it in one transaction. 409 label_taken when another key in the account holds the label, label_in_use while pending work names the old one, label_pinned when clearing a label a pin names. |
PUT |
/v1/billing/keys/:id/models |
billing.key_model_set |
write:billing |
Edit one model of an org key: body {model, tier?, active?}, tier fast|general|smart|heavy or null to untag. A model the key does not list yet is added (untagged and active unless told otherwise). active: true also undoes a catalogue-sync delist; cooling and parks are left alone. 200 with the model and its previous facts (null for an add); 404 for an unknown, personal or revoked key; 422 when an existing model is named with neither field, or a new one would pass the 50-model bound. |
GET |
/v1/key-outage |
billing.outage_get |
read:billing |
The account’s current key outage, or null. The dashboard banner and MCP status read the same projection over current held work. Recovery returns outage: null immediately; the retained episode and its drain grace are unchanged. |
POST |
/v1/key-outage/pick |
billing.outage_pick |
write:billing |
Pin every still-held task/ask of the account’s open outage onto the named key and close it picked. Body {key_label}. 200 with tasks/asks counts on picked; 404 no_open_outage when there is none; 404 unknown_key_label when no non-revoked ORG key carries that label; 422 key_not_usable (with unserved_steps) when the named key serves some but not every held step (a partial pick would break the always-pick-closes invariant); 409 outage_moved when the outage closed between this read and this write; 409 draining when the snapshot is empty and the outage will close drained on its own; 503 service_unavailable when the cooldown Redis read faulted (a pick blind to cooldowns would admit a cooling key). |
Donations
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/donations |
donation.list |
read:donations |
The caller’s own gifts, newest-first. A project gift carries target_repo_full_name, derived, because a donor funds repos they do not own. |
GET |
/v1/donations/received |
donation.received |
read:donations |
The MAINTAINER’s inbox: gifts pinned to repos this account owns, each naming its giver by login (never an email) and, for an llm gift, the resolved ceiling the picker may offer. Beside the page envelope the body carries model_options, the platform model catalogue as { provider, model } objects, so a picker has a vocabulary without importing the server registry. |
POST |
/v1/donations |
donation.create |
write:donations |
Give money | compute | llm, pinned to a project or to the pool, earmarking the resource oss-only. 402 without an active oss_donor subscription on a compute or llm gift; an optional models list is the ceiling the recipient picks within. |
DELETE |
/v1/donations/:id |
donation.cancel |
write:donations |
Detach a gift: parks the row and clears the earmark. The DONOR’s end. |
POST |
/v1/donations/:id/decline |
donation.decline |
write:donations |
Refuse a gift you were given: parks the row and releases the donor’s box or key. Authorized against the RECIPIENT, so the same id 404s for whichever side the caller is not. |
PATCH |
/v1/donations/:id/model |
donation.set_model |
write:donations |
The maintainer’s model pick on a received llm gift, inside the donor’s ceiling (null clears it). |
Entitlement grants
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/admin/grants |
grant.list |
admin:read:orgs |
A subject’s grant history, newest-first. Revoked and expired rows are included, each with its resolved active (staff read). |
POST |
/v1/admin/grants |
grant.issue |
admin:grants |
Operator only: give an account or a user free capacity, with a required reason and an optional expiry. |
DELETE |
/v1/admin/grants/:id |
grant.revoke |
admin:grants |
Operator only: stop a grant. It PARKS the row rather than deleting it, so an already-stopped grant answers 200 revoked: false. |
POST |
/v1/admin/provision |
grant.provision |
admin:grants |
Operator only: provision a friend in one call: invite them if they are new, grant the free devs, THEN approve them off the closed-beta waitlist (a refused grant approves nothing). A deliberate re-run reads the live grants first and issues no duplicate, reporting which effects it caused. Send an Idempotency-Key header to make a retry safe: without one, two concurrent calls can both pass that read and both grant. |
Onboarding
| Method |
Path |
Capability |
Scope |
Description |
GET |
/v1/onboarding/state |
onboarding.state |
read:account |
The onboarding funnel: new until GitHub, an org LLM key and a box are all present, then active. facts names which inputs are present. |
MCP
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/mcp |
mcp.rpc |
per request |
The MCP server itself: one JSON-RPC endpoint for the whole verb catalog. Every verb asserts its OWN scope inside the server, which is also what buckets it for rate limiting. A body over 4 MiB is a 413. |
GET |
/v1/mcp |
mcp.stream_refused |
per request |
Answers 405 + Allow: POST to the GET a Streamable HTTP client opens for the server-to-client SSE leg. This server is stateless single-request JSON-RPC and pushes nothing, and the transport spec requires exactly this status to say so. The official SDK client reads 405 as "POST-only, carry on" and treats every other status, a 404 included, as a fatal transport error. |
Client error reports
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/client-errors |
client_error.report |
read:account |
Report a dashboard crash (a render failure, an uncaught error or an unhandled rejection) under the signed-in session that hit it. A dashboard session only: no session is a 401, and a bearer is a 403. The body is capped at 32 KiB (413), each field has its own cap (400), and each session gets 30 reports a minute, with a cap of 600 a minute across all sessions (429). Answers 204. |
Alert responder
| Method |
Path |
Capability |
Scope |
Description |
POST |
/v1/alerts/alertmanager |
alert.respond |
no bearer |
Receive an Alertmanager webhook (a cluster's critical route, over that cluster's own service bearer). Every FIRING alert labelled severity=critical becomes a devops task on the account and repo of the cluster the bearer names, and so does a severity=warning one that has fired for at least 6 hours (at a lower priority), keyed by its fingerprint and start time so a repeat or a retry files nothing new; a resolved alert withdraws its task if that task is still queued and never ran; other severities and younger warnings are ignored. Each answer is audited on that account with its source. A firing Watchdog (the always-firing dead-man) files nothing: it records the source's heartbeat; only the source's first beat (it arms the dead-man) and the beat that ends a paged silence are audited. |
Service
| Method |
Path |
Capability |
Scope |
Description |
GET |
/ |
service.info |
no bearer |
Service card: name, status, docs URL. No bearer, and no account state. |
GET |
/healthz |
service.health |
no bearer |
Readiness probe for the kubelet. No bearer; the DB and cache are probed with a timeout, 503 while either is down or the pod is draining, and the response names the running build's git sha (sha, null on an unreleased build). |
GET |
/healthz/heartbeats |
service.heartbeats |
no bearer |
The git sha worker and agents-manager last reported and its age in seconds (heartbeats.<app>.sha, .age_s), so a release can prove the two apps with no route of their own live. No bearer; an app that has never reported is absent, and a failed read is a 503. |
GET |
/livez |
service.liveness |
no bearer |
Liveness probe for the kubelet. No bearer, and no dependency is consulted: it answers 200 whenever the process can serve, including while draining, so a Postgres or cache outage never restarts the pod. |
GET |
/v1/openapi.json |
service.openapi |
no bearer |
This document: the OpenAPI 3.1 description of every /v1 capability, generated from the same catalog the routes are mounted from. No bearer, so a client can be generated before a token exists; per-IP rate limited, and cacheable. |
GET |
/.well-known/oauth-protected-resource |
service.oauth_protected_resource |
no bearer |
OAuth 2.1 discovery (RFC 9728): names the MCP endpoint as a protected resource, which authorization server guards it, and the scope vocabulary a grant may carry. No bearer, since it is what a hosted client reads before it has one. The /v1/mcp suffixed twin is the URL the 401 challenge points at; both serve the same document. |
GET |
/.well-known/oauth-protected-resource/v1/mcp |
service.oauth_protected_resource_mcp |
no bearer |
The same RFC 9728 document at the path-inserted URL the spec derives from the MCP endpoint (/.well-known/oauth-protected-resource + /v1/mcp). This is the URL named by WWW-Authenticate on a 401 from POST /v1/mcp. |
GET |
/.well-known/oauth-authorization-server |
service.oauth_authorization_server |
no bearer |
OAuth 2.1 authorization-server metadata (RFC 8414): the authorize, token and dynamic client registration endpoints, plus the grant types and PKCE methods accepted. Authorization code with S256 only, and public clients with no secret. |
GET |
/oauth/authorize |
service.oauth_authorize |
no bearer |
The consent screen. A browser navigation, not an API call: it resolves the dashboard session cookie, lists the exact scopes the grant would carry, the account it defaults to and the other accounts the session can choose instead, and sends a signed-out visitor to the dashboard sign-in with this request as the return target, so a finished sign-in lands back on this screen rather than on a page asking them to open a second tab. PKCE with S256 is required, and a redirect_uri that was not registered is refused on the page instead of redirected to. |
POST |
/oauth/authorize |
service.oauth_consent |
no bearer |
The Authorize button's target. Takes one sealed consent ticket bound to the session that was shown the screen, re-checks the sealed account against the session's live memberships and the scopes against its live ceiling there, and redirects to the registered redirect_uri with a single-use authorization code (or error=access_denied on Cancel). |
POST |
/oauth/token |
service.oauth_token |
no bearer |
Exchange an authorization code plus its PKCE verifier for a token. The code is single-use and short-lived, and the result is an ordinary personal access token carrying the consented scopes, so it lists and revokes on the same Account tokens screen as one minted by hand. |
POST |
/oauth/register |
service.oauth_register |
no bearer |
Dynamic client registration (RFC 7591): hand in a client name and its redirect targets, get back a client_id. Anonymous by design, because a hosted connector registers before any human has proved anything, and it stores nothing: the registration is sealed into the identifier. Public clients only, so no client_secret is ever issued and PKCE is the whole client authentication. Requested grant and response types are narrowed to what this server implements and reported back in the response. A body over 16 KiB is a 413. |
Generated from REST_ROUTES, the route catalog the API mounts. Run bun run api:doc to regenerate.
Scopes
| Scope |
Grants |
read:account / write:account |
Account metadata + tokens |
read:repos / write:repos |
Repos + policy + KB |
read:issues / write:issues |
Issue triage + handoff |
read:prs / write:prs |
PR review + approvals |
read:tasks / write:tasks |
Fleet task queue |
read:runners / write:runners |
Runner enrollment + revoke |
read:sessions / write:sessions |
Audit log + interactive sessions |
read:billing / write:billing |
Billing portal + spend cap |
read:usage |
Token usage counters |
read:digests |
Weekly digest data |
Which scopes does my token hold?
Ask it. GET /v1/me answers a scopes array holding exactly what the credential
you called with may do, so a client reads its own limits once instead of
discovering them by collecting 403s. MCP callers get the same list from whoami.
That is not the same question as what a new token could carry: GET /v1/tokens
answers mintable_scopes, which is your own list minus the classes a self-minted
token may never hold, and empty when you can neither dispatch work nor administer
the account. Offer that one in a scope picker, and use /v1/me to decide which
calls to make.
Every error is an RFC 9457 problem
document, served as application/problem+json:
{
"type": "https://developerz.ai/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "repo not found",
"instance": "/v1/repos/acme/widgets",
"request_id": "4f0c2b8e-2b3a-4d1f-9a6e-6f6a0c2b8e4f"
}
Switch on type, never on title: the slug is a stable contract, the title is
prose. detail explains this particular occurrence, instance is the path, and
request_id is the correlation id described below. Some errors add extension
members: errors carries flattened field errors on a validation failure, and
retry_after carries seconds on a 429.
HTTP status codes follow REST conventions: 200 OK, 201 Created,
400 Bad Request (validation), 401 Unauthorized, 403 Forbidden (scope),
404 Not Found, 429 Too Many Requests, 500 Internal Server Error.
Request ids
Every response carries X-Request-Id, and the same value is the request_id
member of any problem body. It is the id your call was logged under, so it is the
one string worth quoting when something goes wrong. There is no answer without
one: successes, refusals, the unauthenticated endpoints and a 404 for a path that
matches no route all carry it.
Send your own and it is adopted verbatim:
curl -i https://api.developerz.ai/v1/repos \
-H "Authorization: Bearer dev_pat_…" \
-H "X-Request-Id: ci-run-4711"
A value that is not printable ASCII within 200 characters is not adopted, and one
is minted instead. That is deliberately not a 400: this header is often stamped
by a proxy you do not control, and a diagnostic must never fail the call it is
diagnosing. Nothing is hidden by that, because the id actually used comes back on
the same response. So the rule to build on is the narrow one: read the response
header to learn which id was used. Log it next to your own call, and a support
request becomes one lookup instead of a guess at a timestamp.
Rate limiting
Limits are per token or session, not per account: 600 reads a minute
(READ_CAPACITY) and 600 writes a minute (TOKEN_WRITE_CAPACITY), with writes
additionally fair-shared at 120 a minute per conversation (WRITE_CAPACITY),
plus a 1200-per-minute per-IP bucket applied before your credential is even
resolved (PREAUTH_CAPACITY). All four are on rate limits.
Every /v1 response the guard produces carries RateLimit-Limit,
RateLimit-Remaining and RateLimit-Reset (seconds, not a timestamp) for the
bucket that request was charged against, so a client budgets itself instead of
discovering the cap by being throttled. The two publicly cacheable /v1
documents that sit ahead of the guard, GET /v1/openapi.json and the public OSS
stats badge, send no such headers: a per-caller counter behind a shared cache
would be a wrong number for everyone reading it. Absent headers on those two are
the contract, not a protocol failure. A 429 is an RFC 9457 problem document and adds retry-after,
the same seconds as RateLimit-Reset. The full contract, including how MCP calls
are classified, is on rate limits.
Do not poll a run at 1 Hz. That is 60 reads a minute on one run, a tenth of
the read budget, and an agent run can last hours. GET /v1/tasks/:id/events
takes ?wait_ms= (up to 25000) and holds the request open until the first new
event lands, so watching a run costs well under 1% of your budget instead. The MCP task run_tail
verb takes the same argument. See
watching a run.
Idempotency
Every authenticated POST, PUT, PATCH and DELETE under /v1 accepts an
Idempotency-Key header. Accepting it is not opt-in per route; what a keyed
retry gets back is. Most calls replay the first answer, and a call that hands
back a credential runs again (below). Send one on a call your client might
retry (a phone app, a CI script, a flaky connection):
curl -X POST https://api.developerz.ai/v1/tasks \
-H "Authorization: Bearer dev_pat_…" \
-H "Idempotency-Key: 8e6a6c0e-1f2e-4b6a-9c3a-2e7a6c0e1f2e" \
-H "Content-Type: application/json" \
-d '{"title": "Fix flaky test"}'
- The first request with a key runs once. A call that succeeds (a
2xx) is
stored; a call that fails releases the key, so the retry runs it again. The
one exception is a refusal that arrives after the call already created work
(a plan that admitted some of its repos): it is stored too, so the retry
replays it rather than creating that work twice.
- A retry of the same request with the same key replays the stored response
(
X-Idempotent-Replayed: true) instead of running it again.
- The same key on a different request is a
409 Conflict. A key is bound to
the credential, method, path and body of the call it first ran, so reusing it
for anything else is a client bug, not only a changed body.
- Omit the header and the call goes through unconditionally, every time.
Two calls carrying the same key never run at once: the second waits for the
first. If the first is still running when that wait runs out, the second
answers a 409 with retry-after; send it again once that has passed. A key
belongs to the credential that sent it, so another token or session presenting
the same string never receives your stored response.
A call that answers a credential shown once never replays. Its response is
never stored, so there is nothing to replay. The key still makes same-key calls
take turns, but a retry runs the call again: it answers a fresh credential, or
the call's own "already done" refusal, never the first answer. Minting a token,
enrolling a runner or re-issuing its credentials, creating a webhook (its
signing secret), an invitation link and a billing link all work this way.
The rule follows the outcome, not the door and not the status code. The MCP
endpoint POST /v1/mcp takes the same header and behaves the same way, verb
by verb: a keyed retry of a call that succeeded replays the stored result, so
two identical keyed dispatches are one task, and a verb that answers a one-time
credential runs again exactly as its REST route does. A failed MCP call arrives
inside an HTTP 200, with the failure in the JSON-RPC body, and is still
treated as a failure: its key is released and the retry runs, with the same one
exception as above.
Treat those calls as non-replayable. When the outcome is unknown (a timeout, a
dropped connection), look the resource up before you retry: GET /v1/tokens,
GET /v1/webhooks, GET /v1/org/members/invitations, and GET /v1/runners
for a box that has already joined. Retry only if it is not there. A blind retry
can leave you holding a second token or webhook while the first one's secret is
gone for good, so revoke the one you cannot account for.
SDK
The OpenAPI 3.1 document is published at
https://api.developerz.ai/v1/openapi.json
and is accessible without authentication. Generate a client in any language that
supports OpenAPI tooling. For an agent, the MCP interface
(/docs/mcp-verbs) is the better target because it carries
schema validation by design. A REST client is appropriate for
scripts and CI workflows.