{"slug":"api","title":"API reference","about":"Every /v1 endpoint, its scope, budget and wire shapes; generated from the API registry on main.","source":"docs/API.md","markdown":"# neoopensource agent API (v1)\n\n<!-- Generated from crates/jit-api/src/registry.rs and types.rs. Do not edit by hand:\nrun `cargo xtask docs` (or `JIT_UPDATE_DOCS=1 cargo test -p jit-api api_md`). A test fails when this file is stale. -->\n\nThe same information is served by a running instance: `/llms.txt` (a guide for agents), `/v1/openapi.json` (OpenAPI\n3.1) and `GET /v1` (the endpoint list). Wire conventions (the envelope, limits in every answer, bounded lists,\ncursors, errors, idempotency, events) are in `docs/contracts/jit-api.md` section 2 and are not repeated per endpoint.\nNote: `Idempotency-Key` answers are kept in memory only and do not survive a restart or a crash (every deploy\nrestarts the server); for a write that must not happen twice, use the conditional fields (`expect` on commits).\n\nBudgets are p50/p99 on a single warm node, measured by `cargo xtask bench` (see `docs/BENCHMARKS.md`); a regression\nfails CI.\n\n## Endpoints\n\n| Endpoint | What it answers | Scope | Budget p50/p99 |\n| --- | --- | --- | --- |\n| [`GET /v1/health`](#health) | Liveness and version. | none | 1/5 ms |\n| [`GET /v1`](#index) | What this service is: every endpoint with its scope and budget, and links to the guide. | none | 1/5 ms |\n| [`GET /v1/openapi.json`](#openapi) | OpenAPI 3.1 description of this API, generated from the same table as the routes. | none | 1/5 ms |\n| [`GET /v1/whoami`](#whoami) | Who the token is, for whom it acts, what it may do, and its limits. | none | 2/10 ms |\n| [`POST /v1/principals`](#principalsregister) | Make a principal's public key known to this instance, so tokens it mints are accepted. | admin | 10/50 ms |\n| [`PUT /v1/grants/{principal}`](#grantsinstance) | Set what a principal may do instance-wide (creating repositories needs `admin` here). | admin | 10/50 ms |\n| [`PUT /v1/repos/{repo}/grants/{principal}`](#grantsrepo) | Set what a principal may do on one repository. | admin | 10/50 ms |\n| [`POST /v1/repos/{repo}/tokens`](#tokensrunner) | Mint a runner's token: one principal, this repository only, read + change_write (push only if asked). | admin | 10/50 ms |\n| [`POST /v1/repos/{repo}/tokens/revoke`](#tokensrevoke_repo) | Revoke a runner token of this repository by its revocation id: it and what was narrowed from it stop at once. | admin | 10/50 ms |\n| [`POST /v1/tokens/revoke`](#tokensrevoke) | Needs a token. Revoke this request's token (no body), or as instance admin any token by revocation id; add `\"unseen\": true` for an id never seen here. | none | 10/50 ms |\n| [`POST /v1/repos`](#reposcreate) | Create a repository. | admin | 10/50 ms |\n| [`GET /v1/repos`](#reposlist) | List repositories the caller can read; `owner` for one account's (`u-…/…`). | read | 5/25 ms |\n| [`GET /v1/repos/{repo}`](#reposget) | One repository: default branch, head commit, clone URL, event cursor, ref-log size. | read | 2/10 ms |\n| [`POST /v1/repos/{repo}/withhold`](#reposwithhold) | Instance admin only: take part of a repository down, deleting nothing. `refs` covers the names and what only they reach, not what others reach; `record`, not its commits. | admin | 10/50 ms |\n| [`POST /v1/repos/{repo}/restore`](#reposrestore) | Instance admin only: lift one withholding by its `withheld` entry's `seq`, as a signed `restored` entry. Others stay in force: lifting a narrower one serves nothing a wider one covers. | admin | 10/50 ms |\n| [`GET /v1/repos/{repo}/withholdings`](#reposwithholdings) | The withholdings in force here, oldest first: `seq`, `scope`, `reason`, `reference`. Readable under any withholding, like the log. Lists every signer's; `binding` marks this host's, the only ones it enforces. | read | 10/50 ms |\n| [`GET /v1/admin/accounts/{account}`](#accountsadmin_get) | Instance admin only (an unnarrowed token): an account's state, handle and counts. No identity. Alive whatever JIT_SIGNUP says. | admin | 5/25 ms |\n| [`POST /v1/admin/accounts/{account}/suspend`](#accountssuspend) | Instance admin only: suspend an account. Its tokens are refused from the next request; its keys are retired for good. | admin | 10/50 ms |\n| [`POST /v1/admin/accounts/{account}/restore`](#accountsrestore) | Instance admin only: lift a suspension. No session, key or token comes back. | admin | 10/50 ms |\n| [`GET /v1/repos/{repo}/refs`](#refslist) | List refs, optionally under a prefix. | read | 2/10 ms |\n| [`GET /v1/repos/{repo}/refs/{name}`](#refsget) | Read one ref. | read | 2/10 ms |\n| [`GET /v1/repos/{repo}/commit`](#commitget) | Read one commit. | read | 2/10 ms |\n| [`GET /v1/repos/{repo}/log`](#log) | History from a revision, newest first, optionally only commits touching a path. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/tree`](#tree) | List a directory at a revision. | read | 5/25 ms |\n| [`GET /v1/repos/{repo}/blob`](#blob) | Read a file at a revision. | read | 5/25 ms |\n| [`GET /v1/repos/{repo}/diff`](#diff) | Diff two revisions. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/files`](#files) | Read a directory with its files and their content. | read | 10/50 ms |\n| [`POST /v1/repos/{repo}/commits`](#commitscreate) | Commit up to 1000 files to a branch without a clone: one commit on `base`; the branch is set to it. | push | 50/200 ms |\n| [`POST /v1/repos/{repo}/changes`](#changescreate) | Propose a change: a stable id over an evolving stack of commits. | change_write | 10/50 ms |\n| [`GET /v1/repos/{repo}/changes`](#changeslist) | List changes. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/changes/{change}`](#changesget) | The state of a change in one answer: revisions, diff stat, checks, reviews, conflicts, queue. | read | 10/50 ms |\n| [`POST /v1/repos/{repo}/changes/{change}/revisions`](#changesrevise) | Add a revision to a change (what a force-push becomes). Earlier revisions stay readable. | change_write | 10/50 ms |\n| [`PUT /v1/repos/{repo}/changes/for/{branch}`](#changesupsert) | The open change for a branch, or open one: revised when the branch moved, never retitled. Idempotent. | change_write | 10/50 ms |\n| [`GET /v1/repos/{repo}/changes/{change}/interdiff`](#changesinterdiff) | What changed between two revisions of a change. | read | 10/50 ms |\n| [`POST /v1/repos/{repo}/changes/{change}/checks`](#checksreport) | Report a check result on a revision of a change (the same name again replaces it). | change_write | 10/50 ms |\n| [`POST /v1/repos/{repo}/claims`](#claimscreate) | Claim a task or a set of paths for a while, so others see it before they start. | claim | 5/25 ms |\n| [`GET /v1/repos/{repo}/claims`](#claimslist) | Active claims. | read | 5/25 ms |\n| [`POST /v1/repos/{repo}/claims/{claim}/renew`](#claimsrenew) | Extend a claim's lease. | claim | 5/25 ms |\n| [`DELETE /v1/repos/{repo}/claims/{claim}`](#claimsrelease) | Release a claim before it expires. | claim | 5/25 ms |\n| [`GET /v1/repos/{repo}/sync`](#sync) | What changed since a cursor, folded into state: moved refs, touched changes, active claims. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/work`](#work) | What the caller could do next: its changes needing action, reviews it could give, claims to avoid. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/events`](#eventsrepo) | The repository's ordered event stream (SSE), resumable from a cursor; or one JSON page with `wait_ms`. | read | 5/25 ms |\n| [`GET /v1/events`](#eventsall) | The firehose: events of every repository the token can read, in one ordered stream. | read | 5/25 ms |\n| [`GET /v1/repos/{repo}/reflog/head`](#refloghead) | The signed head (checkpoint) of the repository's append-only ref log. | read | 5/25 ms |\n| [`GET /v1/repos/{repo}/reflog`](#reflogentries) | Entries of the signed ref log, oldest first: who moved which ref, for whom, with which token. | read | 5/25 ms |\n| [`GET /v1/repos/{repo}/reflog/proof`](#reflogproof) | Proof that one entry is in the signed log: its RFC 9162 audit path; readable whatever is withheld. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/reflog/consistency`](#reflogconsistency) | Proof that the signed log only grew between two sizes (RFC 9162); readable whatever is withheld. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/bundle`](#reposbundle) | The repository as one signed bundle file, verifiable offline. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/queue`](#queueget) | One target's landing queue: who is in line, and the candidates being checked. | read | 10/50 ms |\n| [`GET /v1/repos/{repo}/queue/candidates`](#queuecandidates) | Candidates that still need a check, front first: what a rule's reporter runs next. | read | 10/50 ms |\n| [`POST /v1/repos/{repo}/queue/candidates/{candidate}/checks`](#queuereport) | Report a rule's check on a candidate; `passed` lands it in its turn. | change_write | 10/50 ms |\n| [`GET /v1/repos/{repo}/landing-rules`](#landing_rulesget) | The repository's landing rules: which changes land by themselves, and on which check. | read | 5/25 ms |\n| [`PUT /v1/repos/{repo}/landing-rules`](#landing_rulesset) | Replace the repository's landing rules (the whole list). | admin | 5/25 ms |\n| [`DELETE /v1/repos/{repo}/landing-rules`](#landing_rulesdelete) | Remove every landing rule of the repository: nothing lands by itself any more. | admin | 5/25 ms |\n| [`POST /v1/feedback`](#feedbackcreate) | Send feedback about this instance: stores the text, CLI version and diagnostics if sent, and the token's principal. Its id is the only way to read its status. | none | 10/50 ms |\n| [`GET /v1/feedback/{id}`](#feedbackget) | What became of one feedback item: its state, kind, the change it led to and a one-line reply. | none | 5/25 ms |\n| [`GET /v1/admin/feedback`](#feedbackadmin_list) | Feedback items, oldest first. Needs instance `review` (feedback triage) or instance admin. | review | 5/25 ms |\n| [`GET /v1/admin/feedback/{id}`](#feedbackadmin_get) | One feedback item in full. Needs instance `review` (feedback triage) or instance admin. | review | 5/25 ms |\n| [`PATCH /v1/admin/feedback/{id}`](#feedbackadmin_set) | Triage a feedback item: state, kind, the change it led to, a reply. Needs instance `review` (feedback triage) or instance admin. | review | 10/50 ms |\n| [`DELETE /v1/admin/feedback/{id}`](#feedbackadmin_delete) | Delete a feedback item for good: its id names nothing from then on. Instance admin only. | admin | 10/50 ms |\n| [`POST /v1/batch`](#batch) | Up to 32 reads in one round trip. | none | 10/50 ms |\n| [`POST /v1/session/start`](#sessionstart) | Only when sign-up is on. Start a login: a state for the login page and a nonce for the browser's cookie. | none | 5/25 ms |\n| [`POST /v1/session/exchange`](#sessionexchange) | Only when sign-up is on. Finish a login: its state and nonce and Privy's two tokens become a session. | none | 20/100 ms |\n| [`POST /v1/session/end`](#sessionend) | Sign out: end this session, or with `everywhere` every session of the account. Exists in every sign-up mode. | none | 10/50 ms |\n| [`GET /v1/account`](#accountget) | Only when sign-up is on. The signed-in account: handle, state, how many keys and repositories. | none | 2/10 ms |\n| [`POST /v1/pairings`](#pairingsbegin) | Only when sign-up is on. Pair a machine: its ed25519 key and a name get a code to type on the account page. | none | 10/50 ms |\n| [`POST /v1/pairings/lookup`](#pairingslookup) | Only when sign-up is on. What a typed code pairs: the machine's name and its key's fingerprint. | none | 5/25 ms |\n| [`POST /v1/pairings/approve`](#pairingsapprove) | Only when sign-up is on. Approve a code for the key with the fingerprint the page showed: it becomes a key of the account. | none | 10/50 ms |\n| [`GET /v1/pairings/{pairing}`](#pairingsstatus) | Only when sign-up is on. A pairing's state, asked by the machine with `Authorization: JitKey <poll>` signed by its key. | none | 5/25 ms |\n| [`GET /v1/account/keys`](#accountkeys) | Only when sign-up is on. The machine keys of the signed-in account. | none | 5/25 ms |\n| [`DELETE /v1/account/keys/{id}`](#accountkeysremove) | Only when sign-up is on. Take a machine key away from the account: its tokens are refused from the next request. | none | 10/50 ms |\n\n## Sign-up routes and `JIT_SIGNUP`\n\nThe sign-up routes (docs/contracts/accounts.md) exist only as the server's `JIT_SIGNUP` setting says. A route that\ndoes not exist answers exactly what an unknown path answers (`404 not_found`), and is left out of `GET /v1`,\n`/v1/openapi.json` and `/llms.txt` on that instance. Every other endpoint exists in every mode. The per-address\nlimits of these routes are kept in memory and start again at a restart.\n\n| Endpoint | `off` | `preview` | `privy` |\n| --- | --- | --- | --- |\n| `POST /v1/session/start` | no | yes | yes |\n| `POST /v1/session/exchange` | no | yes | yes |\n| `POST /v1/session/end` | yes | yes | yes |\n| `GET /v1/account` | no | yes | yes |\n| `POST /v1/pairings` | no | yes | yes |\n| `POST /v1/pairings/lookup` | no | yes | yes |\n| `POST /v1/pairings/approve` | no | yes | yes |\n| `GET /v1/pairings/{pairing}` | no | yes | yes |\n| `GET /v1/account/keys` | no | yes | yes |\n| `DELETE /v1/account/keys/{id}` | no | yes | yes |\n\n### health\n\n`GET /v1/health`\n\nLiveness and version.\n\n- Answer (`data`): [`Health`](#health). Status, version, backend, uptime. Also served at `/healthz` without the envelope's cost.\n- Scope: none (works without a token)\n- Budget: p50 1 ms, p99 5 ms\n- CLI: `neo health`\n\n### index\n\n`GET /v1`\n\nWhat this service is: every endpoint with its scope and budget, and links to the guide.\n\n- Answer (`data`): [`Index`](#index). The endpoint list (bounded by the size of the API).\n- Scope: none (works without a token)\n- Budget: p50 1 ms, p99 5 ms\n- CLI: `neo api GET /v1`\n\n### openapi\n\n`GET /v1/openapi.json`\n\nOpenAPI 3.1 description of this API, generated from the same table as the routes.\n\n- Answer (`data`): [`OpenApi`](#openapi). A bare OpenAPI document (not wrapped in the envelope).\n- Scope: none (works without a token)\n- Budget: p50 1 ms, p99 5 ms\n- CLI: `neo api GET /v1/openapi.json`\n\n### whoami\n\n`GET /v1/whoami`\n\nWho the token is, for whom it acts, what it may do, and its limits.\n\n- Answer (`data`): [`WhoAmI`](#whoami). Principal, owner, scopes, expiry. Limits are in `meta.limits` as in every answer.\n- Scope: none (works without a token)\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo whoami`\n\n### principals.register\n\n`POST /v1/principals`\n\nMake a principal's public key known to this instance, so tokens it mints are accepted.\n\n- Request body: [`RegisterPrincipal`](#registerprincipal)\n- Answer (`data`): [`PrincipalInfo`](#principalinfo). The principal record. Registering the same id again updates its name.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo principal register <id> --name N`\n\n### grants.instance\n\n`PUT /v1/grants/{principal}`\n\nSet what a principal may do instance-wide (creating repositories needs `admin` here).\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `principal` | path | string | yes | Principal id (`jp_…`). |\n\n- Request body: [`SetGrant`](#setgrant)\n- Answer (`data`): [`GrantInfo`](#grantinfo). The grant as it now stands. Applies from the next request, also to tokens already issued.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo grant set <principal> --scopes S,…`\n\n### grants.repo\n\n`PUT /v1/repos/{repo}/grants/{principal}`\n\nSet what a principal may do on one repository.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `principal` | path | string | yes | Principal id (`jp_…`). |\n\n- Request body: [`SetGrant`](#setgrant)\n- Answer (`data`): [`GrantInfo`](#grantinfo). The grant as it now stands. An empty `scopes` removes it.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo grant set <principal> --repo R --scopes S,…`\n\n### tokens.runner\n\n`POST /v1/repos/{repo}/tokens`\n\nMint a runner's token: one principal, this repository only, read + change_write (push only if asked).\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`MintRunnerToken`](#mintrunnertoken)\n- Answer (`data`): [`RunnerToken`](#runnertoken). The token, once: not stored. Revoke by `revocation_id` (`POST …/tokens/revoke`) or by itself (`POST /v1/tokens/revoke`).\n- Scope: `admin`\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, a repeated `Idempotency-Key` is refused (`409`) and never replayed, and a malformed body is not echoed.\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `jit-runner setup <setup.json>`\n\n### tokens.revoke_repo\n\n`POST /v1/repos/{repo}/tokens/revoke`\n\nRevoke a runner token of this repository by its revocation id: it and what was narrowed from it stop at once.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`RevokeToken`](#revoketoken)\n- Answer (`data`): [`TokenRevoked`](#tokenrevoked). Idempotent. The revocation is an entry in the repository's signed log, by the caller.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api POST /v1/repos/<repo>/tokens/revoke --json …`\n\n### tokens.revoke\n\n`POST /v1/tokens/revoke`\n\nNeeds a token. Revoke this request's token (no body), or as instance admin any token by revocation id; add `\"unseen\": true` for an id never seen here.\n\n- Request body: [`RevokeAnyToken`](#revokeanytoken)\n- Answer (`data`): [`TokenRevoked`](#tokenrevoked). Idempotent; tokens narrowed from it stop too. Unseen, by CLI: `neo admin revoke <revocation id> --unseen`.\n- Scope: none (works without a token)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo --token-file LEAKED api POST /v1/tokens/revoke`\n\n### repos.create\n\n`POST /v1/repos`\n\nCreate a repository.\n\n- Request body: [`CreateRepo`](#createrepo)\n- Answer (`data`): [`Repo`](#repo). The repository, including its identity (`id`), clone URL and event cursor.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo repo create <name>`\n\n### repos.list\n\n`GET /v1/repos`\n\nList repositories the caller can read; `owner` for one account's (`u-…/…`).\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n| `owner` | query | string | no | An account's handle (`u-…`): only its repositories, `<handle>/<name>`. |\n\n- Answer (`data`): [`Listed<Repo>`](#repo). A page of repositories ordered by name.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo repo list`\n\n### repos.get\n\n`GET /v1/repos/{repo}`\n\nOne repository: default branch, head commit, clone URL, event cursor, ref-log size.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer (`data`): [`Repo`](#repo). One record.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo repo get <repo>`\n\n### repos.withhold\n\n`POST /v1/repos/{repo}/withhold`\n\nInstance admin only: take part of a repository down, deleting nothing. `refs` covers the names and what only they reach, not what others reach; `record`, not its commits.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`Withhold`](#withhold)\n- Answer (`data`): [`LogEntry`](#logentry). The `withheld` entry.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin withhold <repo> (--repository | --refs PATTERN… | --record KIND ID) --reason R [--reference TEXT]`\n\n### repos.restore\n\n`POST /v1/repos/{repo}/restore`\n\nInstance admin only: lift one withholding by its `withheld` entry's `seq`, as a signed `restored` entry. Others stay in force: lifting a narrower one serves nothing a wider one covers.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`Restore`](#restore)\n- Answer (`data`): [`LogEntry`](#logentry). The `restored` entry; `not_found` if none is in force at `seq`.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin restore <repo> SEQ`\n\n### repos.withholdings\n\n`GET /v1/repos/{repo}/withholdings`\n\nThe withholdings in force here, oldest first: `seq`, `scope`, `reason`, `reference`. Readable under any withholding, like the log. Lists every signer's; `binding` marks this host's, the only ones it enforces.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `after` | query | string | no | Sequence number to list after; absent for the first. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n\n- Answer (`data`): [`Listed<Withholding>`](#withholding). A page; restore takes an item's `seq`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin withholdings <repo>`\n\n### accounts.admin_get\n\n`GET /v1/admin/accounts/{account}`\n\nInstance admin only (an unnarrowed token): an account's state, handle and counts. No identity. Alive whatever JIT_SIGNUP says.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `account` | path | string | yes | The account's principal id (`jp_…`) or handle (`u-…`). |\n\n- Answer (`data`): [`AdminAccount`](#adminaccount). `reason` and `suspended_ms` while suspended.\n- Scope: `admin`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo admin account show <account>`\n\n### accounts.suspend\n\n`POST /v1/admin/accounts/{account}/suspend`\n\nInstance admin only: suspend an account. Its tokens are refused from the next request; its keys are retired for good.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `account` | path | string | yes | The account's principal id (`jp_…`) or handle (`u-…`). |\n\n- Request body: [`SuspendAccount`](#suspendaccount)\n- Answer (`data`): [`AccountChanged`](#accountchanged). The account, `changed`, `keys_retired`.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin account suspend <account> --reason R [--reference TEXT]`\n\n### accounts.restore\n\n`POST /v1/admin/accounts/{account}/restore`\n\nInstance admin only: lift a suspension. No session, key or token comes back.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `account` | path | string | yes | The account's principal id (`jp_…`) or handle (`u-…`). |\n\n- Answer (`data`): [`AccountChanged`](#accountchanged). The account, `changed`.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin account restore <account>`\n\n### refs.list\n\n`GET /v1/repos/{repo}/refs`\n\nList refs, optionally under a prefix.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `prefix` | query | string | no | Only refs whose full name starts with this, e.g. `refs/heads/`. The landing queue's refs are left out under any prefix. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Listed<Ref>`](#ref). A page of refs ordered by name. The landing queue's refs (`refs/queue`, `refs/queue/…`) are never listed, for any `prefix` or caller, and the page is as if they did not exist; see `queue.get`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo refs <repo> [--prefix P]`\n\n### refs.get\n\n`GET /v1/repos/{repo}/refs/{name}`\n\nRead one ref.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `name` | path | string | yes | Full ref name (`refs/heads/main`) or a short branch or tag name (`main`). |\n\n- Answer (`data`): [`Ref`](#ref). The ref's full name and the object id it points at. The landing queue's refs (`refs/queue`, `refs/queue/…`) are `not_found`, as if they did not exist, and are no revision on any route; see `queue.get`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo refs <repo> <name>`\n\n### commit.get\n\n`GET /v1/repos/{repo}/commit`\n\nRead one commit.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `rev` | query | string | no | A commit id, a full ref name, or a branch or tag name. Default: the default branch. |\n\n- Answer (`data`): [`Commit`](#commit). Ids, parents, author, committer and message (message capped at 64 KiB).\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo commit <repo> <rev>`\n\n### log\n\n`GET /v1/repos/{repo}/log`\n\nHistory from a revision, newest first, optionally only commits touching a path.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `rev` | query | string | no | A commit id, a full ref name, or a branch or tag name. Default: the default branch. |\n| `path` | query | string | no | Only commits that changed this path or anything under it. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Listed<Commit>`](#commit). A page of commits; `next` continues the walk.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo log <repo> [--rev R] [--path P] [--limit N]`\n\n### tree\n\n`GET /v1/repos/{repo}/tree`\n\nList a directory at a revision.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `rev` | query | string | no | A commit id, a full ref name, or a branch or tag name. Default: the default branch. |\n| `path` | query | string | no | Directory path; empty or absent for the root. |\n| `recursive` | query | boolean | no | List everything under the path, files only. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Tree`](#tree). A page of entries ordered by name, each with kind, id and size. `recursive=true` lists the subtree.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo tree <repo> [--rev R] [path]`\n\n### blob\n\n`GET /v1/repos/{repo}/blob`\n\nRead a file at a revision.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `rev` | query | string | no | A commit id, a full ref name, or a branch or tag name. Default: the default branch. |\n| `path` | query | string | yes | File path. |\n| `range` | query | string | no | Byte range `start-end` (end exclusive). Default: the first 1 MiB. |\n\n- Answer (`data`): [`Blob`](#blob). Content inline (UTF-8, or base64 when binary), at most 1 MiB per answer; `range` reads further.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo blob <repo> <path> [--rev R] [--raw]`\n\n### diff\n\n`GET /v1/repos/{repo}/diff`\n\nDiff two revisions.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `base` | query | string | yes | Revision to diff from. |\n| `head` | query | string | yes | Revision to diff to. |\n| `patch` | query | boolean | no | Include patches. Default true. |\n| `max_bytes` | query | integer | no | Total patch bytes, default 262144, max 4194304. |\n| `path` | query | string | no | Only this path or anything under it. |\n\n- Answer (`data`): [`Diff`](#diff). Per-file stats (complete up to 5000 files) and unified patches bounded by `max_bytes`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo diff <repo> <base> <head>`\n\n### files\n\n`GET /v1/repos/{repo}/files`\n\nRead a directory with its files and their content.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `rev` | query | string | no | A commit id, a full ref name, or a branch or tag name. Default: the default branch. |\n| `path` | query | string | no | Directory path; empty or absent for the root. |\n| `known` | query | string | no | A commit you already have, or the `tree` of an earlier answer. |\n| `glob` | query | string | no | Only matching files: `*.lean`, `src/**/*.rs`; comma-separated. |\n| `max_bytes` | query | integer | no | Total inline content, default 1048576, max 8388608. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Files`](#files). Files recursively, content inline up to `max_bytes` in total. With `known`: `unchanged: true` and no files if the directory is the same in both commits.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo files <repo> [path] [--rev R] [--known C] [--glob G]`\n\n### commits.create\n\n`POST /v1/repos/{repo}/commits`\n\nCommit up to 1000 files to a branch without a clone: one commit on `base`; the branch is set to it.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`CommitFiles`](#commitfiles)\n- Answer (`data`): [`Committed`](#committed). The new commit, its tree and parent, the branch and what it pointed at before (`expect` makes it conditional).\n- Scope: `push`\n- Budget: p50 50 ms, p99 200 ms\n- CLI: `neo write <repo> <branch> PATH=TEXT… -m MSG`\n\n### changes.create\n\n`POST /v1/repos/{repo}/changes`\n\nPropose a change: a stable id over an evolving stack of commits.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`CreateChange`](#createchange)\n- Answer (`data`): [`ChangeSummary`](#changesummary). The change summary, as `changes.get` returns it.\n- Scope: `change_write`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo change create <repo> --title T --head REV`\n\n### changes.list\n\n`GET /v1/repos/{repo}/changes`\n\nList changes.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `state` | query | string | no | `open` (default), `queued`, `merged`, `abandoned` or `all`. |\n| `author` | query | string | no | Only changes by this principal. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Listed<ChangeBrief>`](#changebrief). A page of change briefs, most recently updated first; under a withholding, a page may be short.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo change list <repo>`\n\n### changes.get\n\n`GET /v1/repos/{repo}/changes/{change}`\n\nThe state of a change in one answer: revisions, diff stat, checks, reviews, conflicts, queue.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `change` | path | string | yes | Change id. |\n\n- Answer (`data`): [`ChangeSummary`](#changesummary). One summary; its lists are bounded (50 revisions, 200 paths) with true counts alongside.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo change get <repo> <change>`\n\n### changes.revise\n\n`POST /v1/repos/{repo}/changes/{change}/revisions`\n\nAdd a revision to a change (what a force-push becomes). Earlier revisions stay readable.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `change` | path | string | yes | Change id. |\n\n- Request body: [`AddRevision`](#addrevision)\n- Answer (`data`): [`ChangeSummary`](#changesummary). The updated change summary.\n- Scope: `change_write`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo change update <repo> <change> --head REV`\n\n### changes.upsert\n\n`PUT /v1/repos/{repo}/changes/for/{branch}`\n\nThe open change for a branch, or open one: revised when the branch moved, never retitled. Idempotent.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `branch` | path | string | yes | The head branch's short name; slashes allowed, not encoded. |\n\n- Request body: [`UpsertChange`](#upsertchange)\n- Answer (`data`): [`Upserted`](#upserted). The change summary, with `created` and `revised` saying what this call did.\n- Scope: `change_write`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo propose <repo> <branch> --title T`\n\n### changes.interdiff\n\n`GET /v1/repos/{repo}/changes/{change}/interdiff`\n\nWhat changed between two revisions of a change.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `change` | path | string | yes | Change id. |\n| `from` | query | integer | yes | Earlier revision number. |\n| `to` | query | integer | no | Later revision number. Default: the latest. |\n| `patch` | query | boolean | no | Include patches. Default true. |\n| `max_bytes` | query | integer | no | Total patch bytes, default 262144, max 4194304. |\n\n- Answer (`data`): [`Diff`](#diff). A diff, bounded like `diff`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo change interdiff <repo> <change> --from N [--to M]`\n\n### checks.report\n\n`POST /v1/repos/{repo}/changes/{change}/checks`\n\nReport a check result on a revision of a change (the same name again replaces it).\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `change` | path | string | yes | Change id. |\n\n- Request body: [`ReportCheck`](#reportcheck)\n- Answer (`data`): [`ChangeSummary`](#changesummary). The change summary. `precondition_failed` (`details.head`) if `head` is stale; log max 256 KiB.\n- Scope: `change_write`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo check report <repo> <change> --name N --state S`\n\n### claims.create\n\n`POST /v1/repos/{repo}/claims`\n\nClaim a task or a set of paths for a while, so others see it before they start.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`CreateClaim`](#createclaim)\n- Answer (`data`): [`Claim`](#claim). The claim. `409 conflict` with the holder in `details` if an overlapping claim is held by another.\n- Scope: `claim`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo claim create <repo> --paths P [--task T] [--ttl-ms N]`\n\n### claims.list\n\n`GET /v1/repos/{repo}/claims`\n\nActive claims.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `after` | query | string | no | The `next` cursor of the previous page. |\n\n- Answer (`data`): [`Listed<Claim>`](#claim). A page of unexpired claims, soonest to expire first.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo claim list <repo>`\n\n### claims.renew\n\n`POST /v1/repos/{repo}/claims/{claim}/renew`\n\nExtend a claim's lease.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `claim` | path | string | yes | Claim id. |\n\n- Request body: [`RenewClaim`](#renewclaim)\n- Answer (`data`): [`Claim`](#claim). The claim with its new expiry.\n- Scope: `claim`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo claim renew <repo> <claim>`\n\n### claims.release\n\n`DELETE /v1/repos/{repo}/claims/{claim}`\n\nRelease a claim before it expires.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `claim` | path | string | yes | Claim id. |\n\n- Answer (`data`): [`Claim`](#claim). The released claim.\n- Scope: `claim`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo claim release <repo> <claim>`\n\n### sync\n\n`GET /v1/repos/{repo}/sync`\n\nWhat changed since a cursor, folded into state: moved refs, touched changes, active claims.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `since` | query | string | yes | An event cursor from an earlier answer; `0` for everything. |\n\n- Answer (`data`): [`RepoSync`](#reposync). One object; folds at most 10000 events per call and says so in `truncated`.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo sync <repo> --since CURSOR`\n\n### work\n\n`GET /v1/repos/{repo}/work`\n\nWhat the caller could do next: its changes needing action, reviews it could give, claims to avoid.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer (`data`): [`Work`](#work). Four bounded lists: `needs_you` from the caller's 20 most recently updated open changes, the others at most 50 each (claims 200).\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo next <repo>`\n\n### events.repo\n\n`GET /v1/repos/{repo}/events`\n\nThe repository's ordered event stream (SSE), resumable from a cursor; or one JSON page with `wait_ms`.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `cursor` | query | string | no | Resume after this event cursor; `0` is the beginning. Default: now. |\n| `wait_ms` | query | integer | no | Answer JSON instead of a stream: return as soon as there is an event, or after this long (max 30000). |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n\n- Answer (`data`): [`EventPage`](#eventpage). `text/event-stream` with `id:` = cursor, ending with `event: bye` `{cursor, reason}`; with `wait_ms`, an `EventPage` of at most `limit` events.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo events <repo> [--cursor C] [--follow]`\n\n### events.all\n\n`GET /v1/events`\n\nThe firehose: events of every repository the token can read, in one ordered stream.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `cursor` | query | string | no | Resume after this event cursor; `0` is the beginning. Default: now. |\n| `wait_ms` | query | integer | no | Answer JSON instead of a stream: return as soon as there is an event, or after this long (max 30000). |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n\n- Answer (`data`): [`EventPage`](#eventpage). As `events.repo`; cursors of this stream are its own and are not valid on a repository stream.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo events [--cursor C] [--follow]`\n\n### reflog.head\n\n`GET /v1/repos/{repo}/reflog/head`\n\nThe signed head (checkpoint) of the repository's append-only ref log.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer (`data`): [`LogHead`](#loghead). Size, Merkle root, signer and signature: what a mirror or auditor pins.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo reflog <repo> --head`\n\n### reflog.entries\n\n`GET /v1/repos/{repo}/reflog`\n\nEntries of the signed ref log, oldest first: who moved which ref, for whom, with which token.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `after` | query | string | no | Sequence number to read after; absent for the beginning. |\n| `limit` | query | integer | no | Page size, default 100, max 1000. |\n| `raw` | query | boolean | no | Include each entry's canonical bytes (base64). |\n\n- Answer (`data`): [`Listed<LogEntry>`](#logentry). A page of entries; `raw=true` adds the canonical signed bytes for local verification.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo reflog <repo> [--after N]`\n\n### reflog.proof\n\n`GET /v1/repos/{repo}/reflog/proof`\n\nProof that one entry is in the signed log: its RFC 9162 audit path; readable whatever is withheld.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `seq` | query | integer | yes | The entry's sequence number; below `size`. |\n| `size` | query | integer | no | The tree size to prove against (a signed head's `size`). Default: the current head's. |\n\n- Answer (`data`): [`LogProof`](#logproof). About log2(size) hashes; verify as `LogProof` says (leaf from `reflog?raw=true`, `verify_inclusion`).\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo verify <repo> --entry N --since SIZE:ROOT`\n\n### reflog.consistency\n\n`GET /v1/repos/{repo}/reflog/consistency`\n\nProof that the signed log only grew between two sizes (RFC 9162); readable whatever is withheld.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `old` | query | integer | yes | The size of the checkpoint you kept; at most `new`. |\n| `new` | query | integer | no | The size to prove against (a signed head's `size`). Default: the current head's. |\n\n- Answer (`data`): [`LogConsistency`](#logconsistency). Keep a verified head's size and root; pass it as `old`. A smaller head or a failing proof: the log was rewritten.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo verify <repo>`\n\n### repos.bundle\n\n`GET /v1/repos/{repo}/bundle`\n\nThe repository as one signed bundle file, verifiable offline.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer: The file, not the envelope: `ETag` (one per log position), `X-Bundle-Sha256`, `X-Bundle-Log-Size`, `-Root`; one `Range` with `If-Range`. `503` + `Retry-After` while it is written, `413` over the cap, `451` if the whole repository is withheld.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo bundle <repo> -o FILE`\n\n### queue.get\n\n`GET /v1/repos/{repo}/queue`\n\nOne target's landing queue: who is in line, and the candidates being checked.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `target` | query | string | no | Branch; default `main`. |\n\n- Answer (`data`): [`Queue`](#queue). At most 200 entries, 200 waiting, 64 candidates (`truncated`).\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api GET /v1/repos/<repo>/queue`\n\n### queue.candidates\n\n`GET /v1/repos/{repo}/queue/candidates`\n\nCandidates that still need a check, front first: what a rule's reporter runs next.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `check` | query | string | yes | The check's name. |\n| `target` | query | string | no | Only this branch's queue. |\n\n- Answer (`data`): [`Candidates`](#candidates). At most 64; `commit` is what to check and what would land. A plain read.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api GET /v1/repos/<repo>/queue/candidates?check=<name>`\n\n### queue.report\n\n`POST /v1/repos/{repo}/queue/candidates/{candidate}/checks`\n\nReport a rule's check on a candidate; `passed` lands it in its turn.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n| `candidate` | path | string | yes | Candidate id, from `queue.candidates`. |\n\n- Request body: [`ReportCandidate`](#reportcandidate)\n- Answer (`data`): [`CandidateReported`](#candidatereported). What landed and was put out. `conflict` reasons: `candidate_gone`, `stale_run`, `run_finished`.\n- Scope: `change_write`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api POST /v1/repos/<repo>/queue/candidates/<id>/checks --json JSON`\n\n### landing_rules.get\n\n`GET /v1/repos/{repo}/landing-rules`\n\nThe repository's landing rules: which changes land by themselves, and on which check.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer (`data`): [`LandingRules`](#landingrules). Every rule: a change whose changed paths are exactly a rule's lands, squashed, when the rule's check passes.\n- Scope: `read` (public repositories: no token needed)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api GET /v1/repos/<repo>/landing-rules`\n\n### landing_rules.set\n\n`PUT /v1/repos/{repo}/landing-rules`\n\nReplace the repository's landing rules (the whole list).\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Request body: [`LandingRules`](#landingrules)\n- Answer (`data`): [`LandingRules`](#landingrules). The rules as stored. `400 bad_request` with the reason for a malformed rule (no globs).\n- Scope: `admin`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api PUT /v1/repos/<repo>/landing-rules --json JSON`\n\n### landing_rules.delete\n\n`DELETE /v1/repos/{repo}/landing-rules`\n\nRemove every landing rule of the repository: nothing lands by itself any more.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `repo` | path | string | yes | Repository name or id. An account's repository is `<handle>/<name>` (`u-…/proofs`), in two segments or with the `/` as `%2F` (decision 0089). |\n\n- Answer (`data`): [`LandingRules`](#landingrules). The now empty list.\n- Scope: `admin`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api DELETE /v1/repos/<repo>/landing-rules`\n\n### feedback.create\n\n`POST /v1/feedback`\n\nSend feedback about this instance: stores the text, CLI version and diagnostics if sent, and the token's principal. Its id is the only way to read its status.\n\n- Request body: [`CreateFeedback`](#createfeedback)\n- Answer (`data`): [`FeedbackReceipt`](#feedbackreceipt). The id. `409 conflict` (`details.reason: feedback_full`) while 20 of the sender's items wait. Never replayed by `Idempotency-Key`.\n- Scope: none (works without a token)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo feedback \"text\"`\n\n### feedback.get\n\n`GET /v1/feedback/{id}`\n\nWhat became of one feedback item: its state, kind, the change it led to and a one-line reply.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `id` | path | string | yes | The id `POST /v1/feedback` answered. |\n\n- Answer (`data`): [`FeedbackStatus`](#feedbackstatus). The status only: no text, diagnostics or principal. An unknown or deleted id is the same `404`.\n- Scope: none (works without a token)\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo feedback status <id>`\n\n### feedback.admin_list\n\n`GET /v1/admin/feedback`\n\nFeedback items, oldest first. Needs instance `review` (feedback triage) or instance admin.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `state` | query | string | no | `received` or `triaged`. |\n| `kind` | query | string | no | `bug`, `idea`, `question`, `duplicate` or `not_planned`. |\n| `limit` | query | integer | no | Page size, default 50, max 100. |\n| `cursor` | query | string | no | The `next` of the previous page. |\n\n- Answer (`data`): [`Listed<FeedbackItem>`](#feedbackitem). A page of whole items; pass `next` as `cursor`.\n- Scope: `review`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo admin feedback list`\n\n### feedback.admin_get\n\n`GET /v1/admin/feedback/{id}`\n\nOne feedback item in full. Needs instance `review` (feedback triage) or instance admin.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `id` | path | string | yes | Feedback id (`fb_…`). |\n\n- Answer (`data`): [`FeedbackItem`](#feedbackitem). The item. Its text is any UTF-8 a stranger wrote: escape it before showing it.\n- Scope: `review`\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo admin feedback show <id>`\n\n### feedback.admin_set\n\n`PATCH /v1/admin/feedback/{id}`\n\nTriage a feedback item: state, kind, the change it led to, a reply. Needs instance `review` (feedback triage) or instance admin.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `id` | path | string | yes | Feedback id (`fb_…`). |\n\n- Request body: [`SetFeedback`](#setfeedback)\n- Answer (`data`): [`FeedbackItem`](#feedbackitem). The item now. A field left out stays; `null` clears it; a kind makes it triaged.\n- Scope: `review`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin feedback set <id> --kind bug --reply \"...\" --change \"...\"`\n\n### feedback.admin_delete\n\n`DELETE /v1/admin/feedback/{id}`\n\nDelete a feedback item for good: its id names nothing from then on. Instance admin only.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `id` | path | string | yes | Feedback id (`fb_…`). |\n\n- Answer (`data`): [`FeedbackDeleted`](#feedbackdeleted). `deleted: true`; `404` when there was no such item.\n- Scope: `admin`\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo admin feedback delete <id>`\n\n### batch\n\n`POST /v1/batch`\n\nUp to 32 reads in one round trip.\n\n- Request body: [`BatchRequest`](#batchrequest)\n- Answer (`data`): [`BatchAnswer`](#batchanswer). One envelope per request, in order. Costs one request per part.\n- Scope: none (works without a token)\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api POST /v1/batch --json '{\"requests\":[{\"path\":\"/v1/repos/x\"}]}'`\n\n### session.start\n\n`POST /v1/session/start`\n\nOnly when sign-up is on. Start a login: a state for the login page and a nonce for the browser's cookie.\n\n- Answer (`data`): [`LoginStarted`](#loginstarted). `state` and `nonce` (64 hex each) and `expires_ms` (10 minutes). No credential; limited per client address.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api POST /v1/session/start`\n\n### session.exchange\n\n`POST /v1/session/exchange`\n\nOnly when sign-up is on. Finish a login: its state and nonce and Privy's two tokens become a session.\n\n- Request body: [`SessionExchange`](#sessionexchange)\n- Answer (`data`): [`SessionExchanged`](#sessionexchanged). A session token (8 h), its expiry, `fresh_until_ms`, `created`, the account. Any failed token, state or nonce: `401 sign_in_again`.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 20 ms, p99 100 ms\n- CLI: `neo api POST /v1/session/exchange --json JSON`\n\n### session.end\n\n`POST /v1/session/end`\n\nSign out: end this session, or with `everywhere` every session of the account. Exists in every sign-up mode.\n\n- Request body: [`EndSession`](#endsession)\n- Answer (`data`): [`SessionEnded`](#sessionended). `{\"ended\": true}`. Only an unnarrowed session token: anything else is `403 session_required`.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api POST /v1/session/end`\n\n### account.get\n\n`GET /v1/account`\n\nOnly when sign-up is on. The signed-in account: handle, state, how many keys and repositories.\n\n- Answer (`data`): [`AccountInfo`](#accountinfo). One record; `fresh_until_ms` only for a session. A session token or a machine key's token.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 2 ms, p99 10 ms\n- CLI: `neo api GET /v1/account`\n\n### pairings.begin\n\n`POST /v1/pairings`\n\nOnly when sign-up is on. Pair a machine: its ed25519 key and a name get a code to type on the account page.\n\n- Request body: [`BeginPairing`](#beginpairing)\n- Answer (`data`): [`PairingBegun`](#pairingbegun). The pairing id, the code (`XXXX-XXXX`, 10 minutes), the instance's key, its `origin` (compare with what you dialed) and the page (`null`: `<JIT_URL>/pair`). No credential.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo login`\n\n### pairings.lookup\n\n`POST /v1/pairings/lookup`\n\nOnly when sign-up is on. What a typed code pairs: the machine's name and its key's fingerprint.\n\n- Request body: [`LookupPairing`](#lookuppairing)\n- Answer (`data`): [`PairingFound`](#pairingfound). Name, fingerprint (16 hex), where (`started_from`) and when it started, expiry. `404 no_such_code` for an unknown, used or expired code alike. A session only.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api POST /v1/pairings/lookup --json JSON`\n\n### pairings.approve\n\n`POST /v1/pairings/approve`\n\nOnly when sign-up is on. Approve a code for the key with the fingerprint the page showed: it becomes a key of the account.\n\n- Request body: [`ApprovePairing`](#approvepairing)\n- Answer (`data`): [`PairingApproved`](#pairingapproved). The new key. A fresh session only (`403 fresh_login_required`); `404 no_such_code`; `409 key_limit` (5 keys).\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api POST /v1/pairings/approve --json JSON`\n\n### pairings.status\n\n`GET /v1/pairings/{pairing}`\n\nOnly when sign-up is on. A pairing's state, asked by the machine with `Authorization: JitKey <poll>` signed by its key.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `pairing` | path | string | yes | Pairing id (32 hex), from `POST /v1/pairings`. |\n\n- Answer (`data`): [`PairingStatus`](#pairingstatus). `pending` or `approved` (with the account and its handle). One refusal, `404 no_such_pairing`, for an unknown or expired pairing and a poll that does not verify.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo login`\n\n### account.keys\n\n`GET /v1/account/keys`\n\nOnly when sign-up is on. The machine keys of the signed-in account.\n\n- Answer (`data`): [`AccountKeys`](#accountkeys). At most 5 keys, each with id, name, fingerprint and when it was approved. A session only.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 5 ms, p99 25 ms\n- CLI: `neo api GET /v1/account/keys`\n\n### account.keys.remove\n\n`DELETE /v1/account/keys/{id}`\n\nOnly when sign-up is on. Take a machine key away from the account: its tokens are refused from the next request.\n\n| Parameter | In | Type | Required | Meaning |\n| --- | --- | --- | --- | --- |\n| `id` | path | string | yes | The key's id (`jp_…`), from `GET /v1/account/keys`. |\n\n- Answer (`data`): [`KeyRemoved`](#keyremoved). `{\"removed\": true}`. A session only; no fresh login needed.\n- Scope: none (works without a token)\n- Secret: the request or answer carries a credential: answers are `Cache-Control: no-store`, an `Idempotency-Key` is ignored and nothing is ever replayed, it is not answered inside a batch, and a malformed body is not echoed.\n- Budget: p50 10 ms, p99 50 ms\n- CLI: `neo api DELETE /v1/account/keys/<id>`\n\n## Types\n\n`Listed<T>` is `{\"items\": [T], \"next\": string | null, \"truncated\": boolean}`. Fields marked optional may be absent in requests; answers always carry every field unless noted.\n\n### AccountBrief\n\nAn account as a session's answer shows it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `handle` | string | yes | `u-…`, given by the instance. |\n| `principal` | string | yes | `jp_…`. |\n| `state` | AccountState | yes |  |\n\n### AccountChanged\n\nWhat a suspension or a restoration answers: the account after it, whether this request changed it, and for a suspension the machine keys it retired (for good: restoring brings none back).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `account` | AdminAccount | yes |  |\n| `changed` | boolean | yes | `false` when the account already was in that state: nothing was done, nothing was recorded. |\n| `keys_retired` | integer \\| null | no | Suspension only: keys this request took away and retired. The person pairs their machines again. |\n\n### AccountInfo\n\n`GET /v1/account`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `fresh_until_ms` | integer \\| null | no | For a session only: until when its login counts as fresh. |\n| `handle` | string | yes |  |\n| `keys` | integer | yes | Machine keys of the account (at most 5). |\n| `principal` | string | yes |  |\n| `repositories` | integer | yes | Repositories the account made (at most 10). |\n| `state` | AccountState | yes |  |\n\n### AccountKey\n\nA machine key of an account.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `fingerprint` | string | yes |  |\n| `id` | string | yes | `jp_…`: the key is a principal, an agent of the account. |\n| `name` | string | yes |  |\n\n### AccountKeys\n\n`GET /v1/account/keys`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `items` | [AccountKey] | yes |  |\n\n### AccountState\n\nWhat the account is: `active`, or `suspended` by an administrator.\n\nOne of: `\"active\"` \\| `\"suspended\"`\n\n### AddRevision\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `expect_revision` | integer \\| null | no | Fail with `precondition_failed` unless the change is currently at this revision number. |\n| `head` | string | yes | The new top of the stack. A force-push is just a new revision; every earlier one stays readable. |\n| `note` | string | no |  |\n\n### AdminAccount\n\n`GET /v1/admin/accounts/{account}`: an account as an instance administrator sees it. No identity: the provider's subject is never answered.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `handle` | string | yes |  |\n| `keys` | integer | yes | Machine keys of the account (at most 5). A suspension retires them all. |\n| `principal` | string | yes |  |\n| `reason` | SuspendReason \\| null | no | While suspended: why. |\n| `repositories` | integer | yes | Repositories the account made (at most 10). |\n| `state` | AccountState | yes |  |\n| `suspended_ms` | integer \\| null | no | While suspended: since when. |\n\n### ApiError\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `code` | ErrorCode | yes |  |\n| `details` | any | no |  |\n| `hint` | string \\| null | no | What to do next, in one sentence. |\n| `message` | string | yes |  |\n| `retry_after_ms` | integer \\| null | no | Set on `rate_limited` and `unavailable`. |\n\n### ApprovePairing\n\n`POST /v1/pairings/approve`: the fingerprint the page showed; approval binds to that key and no other.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `code` | string | yes |  |\n| `fingerprint` | string | yes |  |\n\n### BatchAnswer\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `answers` | [BatchPart] | yes | One entry per request: the HTTP status it would have had and its full envelope. |\n\n### BatchItem\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `method` | string | no | Only `GET` is accepted. |\n| `path` | string | yes | Path and query, starting with `/v1/`. |\n\n### BatchPart\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `body` | any | yes |  |\n| `status` | integer | yes |  |\n\n### BatchRequest\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `requests` | [BatchItem] | yes | Up to 32 reads, answered in order. |\n\n### BeginPairing\n\n`POST /v1/pairings`: what `neo login` sends.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `name` | string | yes | 1 to 64 characters, no control characters: shown on the account page and in the key list. |\n| `public_key` | string | yes | The machine's ed25519 public key, 64 hex digits. Its secret never leaves the machine. |\n\n### Blob\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `binary` | boolean | yes |  |\n| `commit` | string | yes |  |\n| `content` | string | yes |  |\n| `encoding` | Encoding | yes |  |\n| `oid` | string | yes |  |\n| `path` | string | yes |  |\n| `range_end` | integer | yes |  |\n| `range_start` | integer | yes | The byte range in `content`: `[start, end)`. |\n| `size` | integer | yes | Size of the whole file in bytes. |\n| `truncated` | boolean | yes | True when `content` is not the whole file; ask again with `range=start-end`. |\n\n### Candidate\n\nOne commit that would land, and what the rule's check says of it so far.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string | yes | What it is built on: the target's tip, or the candidate ahead. |\n| `change` | string | yes |  |\n| `check` | string | yes | The check the rule wants on it. |\n| `commit` | string | yes | The commit to check (readable by id: `tree`, `blob`, `files` at `rev=<commit>`). If the check passes, the target moves to exactly this. |\n| `id` | string | yes |  |\n| `number` | integer | yes |  |\n| `revision` | integer | yes |  |\n| `rule` | string | yes | The landing rule it is a candidate of. |\n| `run_seq` | integer | yes |  |\n| `state` | CheckState | yes | `pending`: nobody has reported on it yet. |\n| `target` | string | yes |  |\n\n### CandidateReported\n\nWhat a report on a candidate did.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `candidate` | Candidate \\| null | no | The candidate as it is now; absent once it landed or its change was put out. |\n| `ejected` | [QueueEjected] | yes | The changes it put out of the queue. |\n| `landed` | [string] | yes | The changes this report landed, in order (its own, and passed ones that were waiting behind it). |\n\n### Candidates\n\nThe candidates that still need a check, front of each queue first (at most 64).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `items` | [Candidate] | yes |  |\n\n### ChangeBrief\n\nA change as a list item.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `author` | string | yes |  |\n| `base` | string | yes |  |\n| `head` | string | yes |  |\n| `id` | string | yes |  |\n| `number` | integer | no | Per-repository number, from 1, never reused; `{change}` in a path accepts it as well as the id. |\n| `revision` | integer | yes |  |\n| `state` | ChangeState | yes |  |\n| `title` | string | yes |  |\n| `updated_ms` | integer | yes |  |\n\n### ChangeState\n\nOne of: `\"open\"` \\| `\"queued\"` \\| `\"merged\"` \\| `\"abandoned\"`\n\n### ChangeSummary\n\nEverything needed to act on a change, in one answer.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `author` | string | yes |  |\n| `base` | string | yes | Target branch (full ref name). |\n| `checks` | [Check] | yes |  |\n| `created_ms` | integer | yes |  |\n| `cursor` | string | yes | Cursor of the last event about this change. |\n| `description` | string | yes |  |\n| `head` | string | yes | The current revision's head commit. |\n| `id` | string | yes |  |\n| `landing` | [RuleVerdict] | no | What each landing rule for the change's target says about it now: whether it lands on a green check, and exactly what stands in the way. Empty: no rule applies, or the change is closed. |\n| `mergeability` | Mergeability | yes |  |\n| `number` | integer | no | Per-repository number, from 1, never reused; `{change}` in a path accepts it as well as the id. |\n| `on_behalf_of` | string \\| null | no | On whose behalf the author acts. |\n| `overlapping_claims` | [Claim] | yes | Active claims that overlap this change's paths and are held by someone else. |\n| `parent_change` | string \\| null | no |  |\n| `paths` | [string] | yes | Changed paths of the current revision (bounded: the first 200; `stat.files` is the true count). |\n| `queue` | QueueEntry \\| null | no |  |\n| `repo` | string | yes |  |\n| `reviews` | [Review] | yes |  |\n| `revisions` | [Revision] | yes | Every revision, oldest first (bounded: the latest 50). |\n| `stat` | DiffStat | yes | Diff stat of the current revision against its base. |\n| `state` | ChangeState | yes |  |\n| `title` | string | yes |  |\n| `updated_ms` | integer | yes |  |\n\n### Check\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `head` | string \\| null | no | The head the reporter said it checked (always the revision's). Absent: the report named none, and no landing rule counts it. |\n| `name` | string | yes |  |\n| `revision` | integer | yes | The revision the check ran against. |\n| `run_seq` | integer | no | The run this result is from (0: the reporter numbers no runs). |\n| `state` | CheckState | yes |  |\n| `summary` | string | yes |  |\n| `updated_ms` | integer | yes |  |\n\n### CheckState\n\nOne of: `\"pending\"` \\| `\"running\"` \\| `\"passed\"` \\| `\"failed\"` \\| `\"skipped\"`\n\n### Claim\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `expires_ms` | integer | yes |  |\n| `holder` | string | yes |  |\n| `id` | string | yes |  |\n| `note` | string | yes |  |\n| `on_behalf_of` | string \\| null | no |  |\n| `paths` | [string] | yes |  |\n| `repo` | string | yes |  |\n| `task` | string \\| null | no |  |\n\n### Commit\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `author` | Signature | yes |  |\n| `committer` | Signature | yes |  |\n| `message` | string | yes | The whole message, at most 64 KiB. |\n| `oid` | string | yes |  |\n| `parents` | [string] | yes |  |\n| `subject` | string | yes | First line of the message. |\n| `tree` | string | yes |  |\n\n### CommitFiles\n\n`POST /v1/repos/{repo}/commits`: one commit on top of `base` with these files written or deleted, and `branch` set to it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string \\| null | no | The new commit's parent: a revision. Default: the default branch's head. |\n| `branch` | string | yes | The branch to set: a short name (`work/x`) or a full name under `refs/heads/`. Created if absent, moved if present, whatever it pointed at before (see `expect`). |\n| `expect` | string \\| null | no | Absent: set the branch whatever it points at. A commit id: the branch must point at exactly that commit now. `null`: the branch must not exist yet. Otherwise `precondition_failed` with `details.current`. |\n| `files` | [FileWrite] | yes | At most 1000 entries, each path at most once. |\n| `message` | string | yes | The commit message. A final newline is added when missing, as git does. |\n\n### Committed\n\nWhat `POST /v1/repos/{repo}/commits` made.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `branch` | string | yes | The branch's full name, now pointing at `commit`. |\n| `commit` | string | yes | The new commit. |\n| `created` | boolean | yes | True when the branch did not exist before. |\n| `parent` | string | yes | Its parent: `base`, resolved. |\n| `previous` | string \\| null | no | What the branch pointed at before; null when it was created. |\n| `tree` | string | yes | Its root tree. |\n\n### CreateChange\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string \\| null | no | The branch this change targets; defaults to the repository's default branch. |\n| `description` | string | no |  |\n| `head` | string | yes | The commit (or ref) at the top of the stack being proposed. |\n| `parent_change` | string \\| null | no | The change this one is stacked on, if any. |\n| `title` | string | yes |  |\n\n### CreateClaim\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `note` | string | no |  |\n| `paths` | [string] | no | Path prefixes being worked on, for example `crates/jit-api/`. |\n| `task` | string \\| null | no | A task id, free text: \"issue 12\", \"fix flaky test x\". |\n| `ttl_ms` | integer \\| null | no | Lease length. Default 15 minutes, max 24 hours. The claim disappears when it expires. |\n\n### CreateFeedback\n\n`POST /v1/feedback`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `cli_version` | string \\| null | no | The sender's CLI version, at most 64 bytes. |\n| `diagnostics` | FeedbackDiagnostics \\| null | no |  |\n| `text` | string | yes | 1 to 8192 bytes of UTF-8. |\n\n### CreateRepo\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `default_branch` | string \\| null | no | Defaults to `main`. |\n| `description` | string | no |  |\n| `name` | string | yes | `[a-z0-9][a-z0-9._-]{0,63}`, unique on this instance. A label: the identity is `id`. Not `u`, not starting with `u-` (an account's handle), and not one of the reserved words (decision 0083). |\n| `public` | boolean \\| null | no | Public repositories can be read and mirrored without a token. Absent means true. `false` needs an instance admin (the instance-wide `admin` right); anyone else gets `403 private_repos_disabled`. |\n\n### Diff\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string | yes |  |\n| `files` | [FileDiff] | yes | Per-file stats are always complete up to 5000 files; patches are bounded by `max_bytes`. |\n| `head` | string | yes |  |\n| `stat` | DiffStat | yes |  |\n| `truncated` | boolean | yes | True when any patch was cut or the file list was capped. |\n\n### DiffStat\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `additions` | integer | yes |  |\n| `deletions` | integer | yes |  |\n| `files` | integer | yes |  |\n\n### Encoding\n\nOne of: `\"utf8\"` \\| `\"base64\"`\n\n### EndSession\n\n`POST /v1/session/end`. An empty body ends this session.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `everywhere` | boolean \\| null | no | End every session of the account (\"sign out everywhere\"). |\n\n### EndpointBrief\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `budget_p50_ms` | integer | yes |  |\n| `budget_p99_ms` | integer | yes |  |\n| `method` | string | yes |  |\n| `path` | string | yes |  |\n| `scope` | Scope \\| null | no |  |\n| `summary` | string | yes |  |\n\n### EntryKind\n\nOne of: `\"file\"` \\| `\"dir\"` \\| `\"symlink\"` \\| `\"submodule\"`\n\n### ErrorCode\n\nStable machine-readable error codes. The HTTP status follows the code.\n\nOne of: `\"bad_request\"` \\| `\"unknown_field\"` \\| `\"unauthorized\"` \\| `\"forbidden\"` \\| `\"not_found\"` \\| `\"conflict\"` \\| `\"precondition_failed\"` \\| `\"too_large\"` \\| `\"rate_limited\"` \\| `\"unavailable\"` \\| `\"internal\"` \\| `\"private_repos_disabled\"` \\| `\"withheld\"` \\| `\"sign_in_again\"` \\| `\"signup_closed\"` \\| `\"suspended\"` \\| `\"signups_exhausted\"` \\| `\"keys_stale\"` \\| `\"session_required\"` \\| `\"fresh_login_required\"` \\| `\"no_such_code\"` \\| `\"no_such_pairing\"` \\| `\"key_limit\"` \\| `\"bad_key\"` \\| `\"repository_limit\"` \\| `\"pairings_exhausted\"`\n\n### Event\n\nOne entry of a repository's ordered event log.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `actor` | string | yes |  |\n| `cursor` | string | yes | Position in the stream it was read from; resume with it. |\n| `data` | any | yes | Type-specific fields; always an object. |\n| `on_behalf_of` | string \\| null | no |  |\n| `repo` | string | yes |  |\n| `time_ms` | integer | yes |  |\n| `type` | string | yes | `repo.created`, `ref.updated`, `change.created`, `change.revised`, `change.state`, `check.updated`, `review.created`, `claim.created`, `claim.renewed`, `claim.released`, `claim.expired`, `queue.updated`. |\n\n### EventPage\n\nThe JSON form of the event stream (`wait_ms` given, or `Accept: application/json`).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `cursor` | string | yes | Pass this as `cursor` next time. Equal to the request's cursor when nothing happened. |\n| `events` | [Event] | yes |  |\n| `truncated` | boolean | yes | True when more events were already available than `limit`. |\n\n### FeedbackDeleted\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `deleted` | boolean | yes |  |\n| `id` | string | yes |  |\n\n### FeedbackDiagnostics\n\nWhat the sender chose to add about its machine and last command. Each field is one it was shown before sending.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `arch` | string \\| null | no |  |\n| `last_command` | string \\| null | no | The name of the last command, not its arguments. |\n| `last_exit` | integer \\| null | no |  |\n| `os` | string \\| null | no |  |\n| `repo` | string \\| null | no | A repository's name, if the sender named one. |\n\n### FeedbackItem\n\nOne item, as an instance administrator reads it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | string \\| null | no |  |\n| `cli_version` | string \\| null | no |  |\n| `created_ms` | integer | yes |  |\n| `diagnostics` | FeedbackDiagnostics \\| null | no |  |\n| `id` | string | yes |  |\n| `kind` | FeedbackKind \\| null | no |  |\n| `principal` | string \\| null | no | The principal of the token it was sent with; null when sent without one. |\n| `reply` | string \\| null | no |  |\n| `server_version` | string | yes | The version of the server that stored it. |\n| `state` | FeedbackState | yes |  |\n| `text` | string | yes | As sent: any UTF-8, control characters included. Escape it before showing it. |\n| `updated_ms` | integer | yes |  |\n\n### FeedbackKind\n\nOne of: `\"bug\"` \\| `\"idea\"` \\| `\"question\"` \\| `\"duplicate\"` \\| `\"not_planned\"`\n\n### FeedbackReceipt\n\nWhat `POST /v1/feedback` stored. Keep `id`: it is the only way to read the item's status.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `id` | string | yes | `fb_` and 32 hex digits. |\n| `state` | FeedbackState | yes |  |\n\n### FeedbackState\n\nOne of: `\"received\"` \\| `\"triaged\"`\n\n### FeedbackStatus\n\nWhat became of an item: all its sender is told.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | string \\| null | no | A reference to the change that came of it. |\n| `created_ms` | integer | yes |  |\n| `id` | string | yes |  |\n| `kind` | FeedbackKind \\| null | no | Null until someone says what it is. |\n| `reply` | string \\| null | no | One line for the sender. |\n| `state` | FeedbackState | yes |  |\n| `updated_ms` | integer | yes |  |\n\n### FileContent\n\nOne file of a `Files` answer.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `content` | string | yes | The whole file; empty when `truncated`. |\n| `encoding` | Encoding | yes |  |\n| `oid` | string | yes |  |\n| `path` | string | yes |  |\n| `size` | integer | yes | Size of the whole file in bytes. |\n| `truncated` | boolean | yes | True when the file did not fit in `max_bytes`: read it with `blob` (and `range`). |\n\n### FileDiff\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `additions` | integer | yes |  |\n| `binary` | boolean | yes |  |\n| `deletions` | integer | yes |  |\n| `old_path` | string \\| null | no |  |\n| `patch` | string \\| null | no | Unified diff of this file; null when not requested, binary, or cut by `max_bytes` (then `truncated`). |\n| `path` | string | yes |  |\n| `status` | FileStatus | yes |  |\n| `truncated` | boolean | yes |  |\n\n### FileStatus\n\nOne of: `\"added\"` \\| `\"modified\"` \\| `\"deleted\"` \\| `\"renamed\"`\n\n### FileWrite\n\nOne file to write or delete in `POST /v1/repos/{repo}/commits`. Give `content`, or `delete: true`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `content` | string \\| null | no | The whole new content of the file, in `encoding`. |\n| `delete` | boolean \\| null | no | True: delete the file (it must exist); a directory left empty disappears. Not together with `content`. |\n| `encoding` | Encoding \\| null | no | How `content` is written: `utf8` (the default) or `base64` (any bytes). |\n| `path` | string | yes | Path from the repository root, `/`-separated: no leading slash, no empty, `.`, `..` or `.git` segment, no backslash or NUL. Directories are created as needed. |\n\n### Files\n\nA directory with the files below it and their content.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `commit` | string | yes | The commit the directory was read at (resolved from `rev`): send it back as `known` next time. |\n| `files` | [FileContent] | yes | Recursively, in path order. |\n| `next` | string \\| null | no | Pass as `after` to continue a listing that was cut. |\n| `path` | string | yes |  |\n| `tree` | string | yes | The id of the directory itself at `commit`: also accepted as `known`. |\n| `truncated` | boolean | yes |  |\n| `unchanged` | boolean | yes | True when the directory is the tree `known` names, or the same in the commit it names: then `files` is empty. |\n\n### GrantInfo\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `principal` | string | yes |  |\n| `repo` | string \\| null | no | The repository the grant is on; null for an instance-wide grant. |\n| `scopes` | [Scope] | yes |  |\n\n### Health\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `backend` | string | yes | `mem` (in-memory stub) or `real`. |\n| `status` | string | yes |  |\n| `time_ms` | integer | yes |  |\n| `uptime_ms` | integer | yes |  |\n| `version` | string | yes |  |\n\n### Index\n\n`GET /v1`: what this service is and where to read more.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `api` | string | yes |  |\n| `endpoints` | [EndpointBrief] | yes |  |\n| `events` | string | yes |  |\n| `guide` | string | yes |  |\n| `openapi` | string | yes |  |\n| `service` | string | yes |  |\n| `version` | string | yes |  |\n\n### KeyRemoved\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `removed` | boolean | yes | Always `true`. |\n\n### LandingRule\n\n\"A change to `target` whose changed paths are exactly `paths` lands by itself, squashed under `title`, when `check` is green on its latest revision as reported by `reporter`.\"\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `allow_executable` | boolean | no | Optional: let an executable file (mode 100755) at a listed path land. Default false: only plain files (mode 100644) do, and an executable is refused as `not_a_plain_file`. Symbolic links and submodules never land by rule. |\n| `check` | string | yes | The check that must have passed on the change's latest revision. |\n| `delete_branch` | boolean | no | Optional: delete the change's head branch when the rule lands it (if it still points at the landed head). Default false: the branch is left. |\n| `head_branch` | string \\| null | no | Optional: the head branch the change must have been pushed by, a short name that may contain `{name}` once, e.g. `prover/{name}` (the same name its paths give). Absent: any branch, or none. |\n| `name` | string | yes | Unique in the repository; it is in the events. |\n| `paths` | [RulePath] | yes | The exact set of changed paths: each with its status, nothing else. No globs. |\n| `protect_target` | boolean | no | The rule's target branch moves only by a landing or by an admin of the repository: a push or a commit to it from anyone else is `forbidden` (message starting `protected_branch:`); push a branch and open a change instead. Default true. False leaves the target as open as any other branch. |\n| `queue` | QueueOptions \\| null | no | Optional: changes that fit this rule need not sit on the target's tip. They wait in the target's queue, the server builds for each the commit that would land on top of the ones ahead (a candidate), the rule's reporter checks candidates (`queue.candidates`, `queue.report`) and a passing candidate lands in order as exactly that commit. Absent: a change lands only while it is built on the tip. |\n| `reporter` | string | yes | The only principal whose report of that check counts, and the only one allowed to report it (`jp_…`). |\n| `target` | string | yes | The branch changes must target, e.g. `main` (stored as `refs/heads/main`). |\n| `title` | string | yes | The squash commit's title; may use `{name}`, `{change}` and `{number}`. |\n\n### LandingRules\n\nA repository's landing rules: the body of `PUT …/landing-rules` and the answer of all three calls.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `rules` | [LandingRule] | yes |  |\n\n### Limits\n\nThe bucket that binds first for this caller. A request with a token is charged, all or nothing, to the token's own bucket and to its authenticated principal's, shared by all its tokens and 16 times larger (a server constant); this reports whichever has fewer requests left. Without a token, or with one that does not authenticate: the client address's bucket (or, while the server holds too many addresses, the shared shard a new address is charged to). There are no other limits.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `cost` | integer | yes | What this request cost. |\n| `limit` | integer | yes | Bucket capacity: the largest burst. |\n| `remaining` | integer | yes | Requests that can be made right now. |\n| `reset_ms` | integer | yes | Milliseconds until the bucket is full again. |\n| `streams` | StreamLimits | yes |  |\n| `window_ms` | integer | yes | The bucket refills `limit` requests per `window_ms`, continuously. |\n\n### LogConsistency\n\nThat the log of `new` entries extends the log of `old` entries without changing any of them: the consistency proof of RFC 9162 (section 2.1.4). Keep the checkpoint you verified (its `size` and `root`); next time ask for `old=<kept size>&new=<the size of a new signed head>` and check `jit_trust::verify_consistency(old_root, new_root, &ConsistencyProof { old_size: old, new_size: new, path })` against the new head's `root`: the log only grew. A new head smaller than the kept size, or a proof that does not verify, means the log was rewritten. `old == new` and `old == 0` answer an empty path (nothing to prove: the roots must be equal, or the old one the empty tree's).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `new` | integer | yes | jit-trust's `new_size`. |\n| `old` | integer | yes | jit-trust's `old_size`. |\n| `path` | [string] | yes | The hashes, 64 lower-case hex digits each, in the order `verify_consistency` reads them. |\n\n### LogEntry\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `actor` | string | yes |  |\n| `kind` | string | yes | `genesis`, `ref_update`, `record`, `set_signer`, `withheld`, `restored`, or `runner_token` (a runner token was minted: `actor` is the administrator who asked) or `token_revoked` (`actor` revoked it). |\n| `on_behalf_of` | string \\| null | no |  |\n| `prev` | string | yes | Hash of the previous entry, hex. |\n| `raw` | string \\| null | no | The canonical signed bytes, base64, for clients that verify. |\n| `refs` | [RefMove] | yes | Ref movements of a `ref_update` entry. |\n| `revocation_id` | string \\| null | no | On a `runner_token` or `token_revoked` entry: the revocation id of the token minted or revoked. |\n| `seq` | integer | yes |  |\n| `signature` | string | yes |  |\n| `signer` | string | yes |  |\n| `time_ms` | integer | yes |  |\n| `token_id` | string \\| null | no |  |\n| `withheld` | WithheldInfo \\| null | no | On a `withheld` entry: what this host stopped serving, why, and the reference; on a `restored` entry: the sequence number of the `withheld` entry it lifts. Absent on every other kind. |\n\n### LogHead\n\nThe signed head of a repository's append-only ref log (`jit-trust`'s checkpoint).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `repo` | string | yes |  |\n| `root` | string | yes | Merkle root over the first `size` entries, hex. |\n| `signature` | string | yes |  |\n| `signer` | string | yes |  |\n| `size` | integer | yes |  |\n| `time_ms` | integer | yes |  |\n\n### LogProof\n\nThat the entry at `seq` is in the log of `size` entries: the audit path of RFC 9162 (section 2.1.3), from the leaf up. Verify: decode the entry's `raw` bytes (`GET …/reflog?raw=true`), its leaf is `SignedEntry::from_bytes(raw)?.leaf_hash()` (RFC 9162's leaf hash of those bytes), then `jit_trust::verify_inclusion(leaf, &InclusionProof { seq, size, path }, root)` with the `root` of a signed checkpoint of this `size` (`GET …/reflog/head`: pass its `size`).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `path` | [string] | yes | The sibling hashes, 64 lower-case hex digits each (the form of `LogHead.root`), about log2(size) of them. |\n| `seq` | integer | yes |  |\n| `size` | integer | yes | The tree size the path is for. |\n\n### LoginStarted\n\n`POST /v1/session/start`: a login in flight, for 10 minutes.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `expires_ms` | integer | yes |  |\n| `nonce` | string | yes | 64 hex digits: the front end keeps it in the browser's `__Host-neo_login` cookie. |\n| `state` | string | yes | 64 hex digits: sent to the login page, which sends it back with Privy's tokens. |\n\n### LookupPairing\n\n`POST /v1/pairings/lookup`: the code is in the body, never in a URL.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `code` | string | yes |  |\n\n### MergeState\n\nOne of: `\"clean\"` \\| `\"conflicted\"` \\| `\"unknown\"`\n\n### Mergeability\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `behind` | integer | yes | How many commits the base has gained since this revision's merge base. |\n| `conflicts` | [string] | yes | Paths that conflict with the base, when `state` is `conflicted`. |\n| `state` | MergeState | yes |  |\n\n### Meta\n\nPresent in every answer.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `limits` | Limits | yes | The caller's limits after this request. |\n| `request_id` | string | yes | Echo this when reporting a problem. |\n| `took_us` | integer | yes | Server-side time spent on the request, microseconds. |\n\n### MintRunnerToken\n\n`POST /v1/repos/{repo}/tokens`: a token for a runner on this one repository.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `consent` | string | yes | The principal's own agreement: its key's signature (128 hex digits) over this repository's id, this host's log signing key (both in `GET …/reflog/head`: `repo`, `signer`) and `consent_ms` (`jit_trust::RunnerConsent`; `jit-runner setup` makes it). Without it an administrator could be issued a token that acts as anyone; with the host in it, one host's cannot be used at another. |\n| `consent_ms` | integer | yes | When `consent` was signed, Unix milliseconds. Accepted for one hour. |\n| `principal` | string | yes | The runner's own principal (`jp_…`), already registered. Give a runner a principal of its own: a landing rule names it as the only reporter whose check counts. |\n| `scopes` | array \\| null | no | What the token may do: `read` always, and of `change_write` and `push` what is listed. Default `[\"read\", \"change_write\"]`: enough to read the repository and report a check, and **not push**. Ask for `push` only for a runner that commits; never for one that reports the check of a landing rule, because the command it runs is code from the changes it checks. |\n| `ttl_ms` | integer \\| null | no | How long the token lasts, in milliseconds. Default 24 hours; at most 30 days. |\n\n### PairingApproved\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `key` | AccountKey | yes |  |\n\n### PairingBegun\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `code` | string | yes | `XXXX-XXXX` (Crockford's base 32): typed on the account page. Never put it in a link. |\n| `expires_ms` | integer | yes |  |\n| `instance_key` | string | yes | The instance's key, 64 hex digits: what the machine's polls are signed for. |\n| `origin` | string | yes | This instance's origin (`JIT_PUBLIC_URL`, normalized: `scheme://host[:port]`). The machine compares it with the origin it dialed before it shows the code, and stops on a mismatch; it never signs this one. |\n| `page` | string \\| null | no | Where to type the code (`<JIT_WEB_URL>/pair`), or `null`: then `<JIT_URL>/pair`. |\n| `pairing` | string | yes | 32 hex digits: what the machine polls (`GET /v1/pairings/{pairing}`). |\n\n### PairingFound\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `expires_ms` | integer | yes |  |\n| `fingerprint` | string | yes | 16 hex digits: the first 8 bytes of SHA-256 of the machine's key. |\n| `name` | string | yes | The name the machine gave. |\n| `started_from` | string | yes | The client address the pairing was started from, as the per-address limits key it (an IPv4 address, an IPv6 /64). Kept only with the pairing; shown only here, to the session that typed the code. |\n| `started_ms` | integer | yes |  |\n\n### PairingState\n\nOne of: `\"pending\"` \\| `\"approved\"`\n\n### PairingStatus\n\n`GET /v1/pairings/{pairing}`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `account` | string \\| null | no | Once approved: the account (`jp_…`). |\n| `handle` | string \\| null | no | Once approved: the account's handle. |\n| `status` | PairingState | yes |  |\n\n### PathChange\n\nHow a landing rule expects one of its paths to have changed.\n\nOne of: `\"added\"` \\| `\"modified\"` \\| `\"deleted\"`\n\n### PathMerge\n\nHow a landing rule's queue merges a path.\n\nOne of: `\"union\"`\n\n### PrincipalInfo\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `created_ms` | integer | yes |  |\n| `id` | string | yes |  |\n| `kind` | PrincipalKind | yes |  |\n| `name` | string | yes |  |\n\n### PrincipalKind\n\nOne of: `\"person\"` \\| `\"org\"`\n\n### Queue\n\nOne target's queue. At most 200 entries, 200 waiting changes and 64 candidates are listed; `truncated` says when there are more.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `candidates` | [Candidate] | yes | Front first. |\n| `entries` | [QueuedChange] | yes | In landing order. |\n| `target` | string | yes |  |\n| `tip` | string \\| null | no |  |\n| `truncated` | boolean | yes |  |\n| `waiting` | [string] | yes | Changes that fit the rule and wait for one of their owner's places, in order. |\n\n### QueueEjected\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | string | yes |  |\n| `reason` | any | yes | `{reason, ...}`: `checks_failed {batch, summary}`, `merge_conflict {paths}`, `not_as_the_rule {rule, paths}`, `superseded`, `dequeued`, `abandoned`, `parent_not_landed {parent}`. |\n\n### QueueEntry\n\nA change's own place in a queue, on its summary (`ChangeSummary.queue`). The whole queue of a target, with every change in it, is `Queue` (`queue.get`), whose entries are `QueuedChange`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `batch` | string \\| null | no |  |\n| `enqueued_ms` | integer | yes |  |\n| `position` | integer | yes |  |\n\n### QueueOptions\n\nHow a landing rule's queue runs.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `depth` | integer | no | Candidates that exist at once, each built on the one ahead: 1 to 16, default 4. 1 is a serial queue (nothing is ever checked twice); more lets a reporter that runs several checks at once land that many per check duration, and a failure costs a re-check of those behind it. |\n| `max_per_owner` | integer | no | Changes of one owner in the queue at once: 1 to 64, default 2. Its others wait their turn behind everyone already in line. |\n\n### QueuedChange\n\nA change in a landing rule's queue (`queue.get`): where it stands and which candidate is built for it. Not `QueueEntry`, which is the same change's place as its own summary shows it (`ChangeSummary.queue`).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `author` | string | yes |  |\n| `candidate` | string \\| null | no | The candidate built for it, if one is. |\n| `change` | string | yes |  |\n| `head` | string | yes |  |\n| `number` | integer | yes |  |\n| `position` | integer | yes | 0 is the front. |\n| `revision` | integer | yes |  |\n\n### Ref\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `name` | string | yes | Full name, for example `refs/heads/main`. |\n| `oid` | string | yes |  |\n\n### RefMove\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `name` | string | yes |  |\n| `new` | string \\| null | no | Null when the ref was deleted. |\n| `old` | string \\| null | no | Null when the ref was created. |\n\n### RegisterPrincipal\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `id` | string | yes | The principal's identity: its public key in text form, `jp_` followed by 64 hex digits. |\n| `kind` | PrincipalKind \\| null | no | Defaults to `person`. |\n| `name` | string | yes | A label; it can differ between instances. |\n\n### RenewClaim\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `ttl_ms` | integer \\| null | no |  |\n\n### Repo\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `clone_url` | string | yes |  |\n| `created_by` | string | yes |  |\n| `created_ms` | integer | yes |  |\n| `cursor` | string | yes | Cursor of the newest event; pass it to `sync` or `events` to hear only what comes after. |\n| `default_branch` | string | yes |  |\n| `description` | string | yes |  |\n| `head` | string \\| null | no | Commit the default branch points at; null while the repository is empty. |\n| `id` | string | yes | The repository's identity (its key); survives renames and hosts. |\n| `log_size` | integer | yes | Number of entries in the signed ref log. |\n| `name` | string | yes |  |\n| `public` | boolean | yes |  |\n\n### RepoSync\n\n`GET …/sync?since=`: what changed in a repository since a cursor, already folded into state.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `changes` | [ChangeBrief] | yes | Changes created or touched in the interval, in their current state. |\n| `claims` | [Claim] | yes | Claims active now. |\n| `cursor` | string | yes | Pass as `since` next time. |\n| `events` | integer | yes | Number of events folded into this answer. |\n| `refs` | [RefMove] | yes | Net movement of each ref over the interval (one entry per ref, however many times it moved). |\n| `since` | string | yes |  |\n| `truncated` | boolean | yes | True when the interval held more than the server folds at once; call again with `cursor`. |\n\n### ReportCandidate\n\nA reporter's word on a candidate.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `head` | string | yes | The commit that was checked. Required: `precondition_failed` unless it is the candidate's commit. |\n| `log` | string \\| null | no | The check's output, at most 256 KiB; its last 64 KiB are kept on the change's revision. |\n| `name` | string | yes | The rule's check. |\n| `run_seq` | integer \\| null | no | The run, as in `checks.report`: a lower one than the server holds is `conflict` with `details.reason` `stale_run`; a different verdict for a finished run is `run_finished`. |\n| `state` | CheckState | yes |  |\n| `summary` | string | no |  |\n\n### ReportCheck\n\nA check result on a revision of a change. A second report of the same name on the same revision replaces the first.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `head` | string \\| null | no | The commit the check ran on. `precondition_failed` (with `details.head`, the revision's head) unless it is that revision's head. A landing rule counts a `passed` check only if its report named the head. |\n| `log` | string \\| null | no | The check's output as text, at most 256 KiB. |\n| `name` | string | yes | The check's name, e.g. `test`. |\n| `revision` | integer \\| null | no | The revision checked. Default: the latest. |\n| `run_seq` | integer \\| null | no | Which run of the check this is: the same number for a run's `running` and its verdict, a higher one for a later run (the time the run started, in milliseconds, serves). Absent is run 0. Per (change, revision, name) the server keeps the highest: a report of a lower run is `conflict` with `details.reason` `stale_run`; for a check a landing rule or the queue names, a different verdict for a run that already has one is `conflict` with `details.reason` `run_finished` (the same verdict again is accepted). `details.run_seq` is the run the server holds. A reporter that never sends it reports one run per revision: its first verdict stands. |\n| `state` | CheckState | yes |  |\n| `summary` | string | no |  |\n\n### Restore\n\nLift a withholding.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `seq` | integer | yes | The sequence number of the `withheld` entry (`seq` in the answer of `withhold`, or of that entry in `GET …/reflog`). |\n\n### Review\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `by` | string | yes |  |\n| `created_ms` | integer | yes |  |\n| `id` | string | yes |  |\n| `open_comments` | integer | yes | Comments not yet resolved; each may carry a patch that applies in one call. |\n| `revision` | integer | yes |  |\n| `summary` | string | yes |  |\n| `verdict` | ReviewVerdict | yes |  |\n\n### ReviewVerdict\n\nOne of: `\"approve\"` \\| `\"request_changes\"` \\| `\"comment\"`\n\n### Revision\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string | yes |  |\n| `created_by` | string | yes |  |\n| `created_ms` | integer | yes |  |\n| `head` | string | yes |  |\n| `note` | string | yes |  |\n| `number` | integer | yes |  |\n\n### RevokeAnyToken\n\n`POST /v1/tokens/revoke`: no body (or `{}`) revokes the token this request carries; with `revocation_id`, an instance administrator revokes any token by the id of one of its blocks.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `revocation_id` | string \\| null | no | Which token: the revocation id of one of its blocks (64 hex digits). Without `unseen`, it must be an id this instance knows (one already revoked, a runner token's, or a block of a token presented since the server started): any other is `bad_request`, since it would stop no token. Absent: the token this request carries. |\n| `unseen` | boolean \\| null | no | `true`: revoke `revocation_id` although this instance has never seen it, on the administrator's word (a token that leaked and was never presented here, or not since a restart). Instance administrators only (`admin` on the instance, through a token not narrowed below it: what \"instance root\" means here). It is explicit and never a fallback: a wrong id sent as unseen is recorded as revoked and stops nothing. Only with `revocation_id`; `false` is the same as leaving it out. |\n\n### RevokeToken\n\n`POST /v1/repos/{repo}/tokens/revoke`: a runner token of that repository.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `revocation_id` | string \\| null | no | Which token: the revocation id of one of its blocks (64 hex digits), from a runner token's answer or its mint entry in the signed log. Required. |\n\n### RulePath\n\nOne path a landing rule lists.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `merge` | PathMerge \\| null | no | Optional: `union` merges this path by line union in the rule's queue (decision 0078): a change may only add lines, and they go after what landed, without the ones already there. Only on a `modified` path without `{name}`, in a rule with `queue`. Absent: the ordinary merge. |\n| `path` | string | yes | From the repository root; may contain `{name}` once (one identifier, shared by every path that uses it). |\n| `status` | PathChange | yes |  |\n\n### RuleVerdict\n\nWhat one landing rule says about a change now.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `lands` | boolean | yes | True when nothing stands in the way: the next passing report of the rule's check lands the change. |\n| `refusals` | [any] | yes | What stands in the way, one object each: `reason` plus its fields. `check_missing {check}`, `check_not_passed {check, status, conclusion?}`, `wrong_reporter {check, reporter, wanted}`, `unexpected_paths {paths}`, `missing_paths {paths}`, `head_branch {branch, wanted}`, `behind_target`, `bad_name`, `stacked`, `not_open`, `conflict {paths}`, `check_not_pinned {check}` (its report named no head), `queued {position?, candidate?}` (the rule has a queue and the change is in line: nothing to do but wait), `ejected {why}` (the queue put this revision out; `why` as in `queue.report`), `withheld {reference}` (this host withholds the change's head branch or its target: no rule lands it while that stands), `not_a_plain_file {entries: [{path, kind}]}` (kind: `executable`, `symlink`, `submodule`, `other`). |\n| `rule` | string | yes |  |\n| `warnings` | [any] | no | What stands in nobody's way but should be known, one object each: `union_path_filling {path, bytes}` (the union-merged file was past three quarters of its bound at the push: an administrator should rotate or compact it; decision 0086). Never counted as a refusal. |\n\n### RunnerToken\n\nA runner's token, answered once and never stored: keep it in a file only the runner can read. Its `Debug` leaves the token out, so a log line or a failed assertion cannot carry it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `not_after_ms` | integer | yes |  |\n| `principal` | string | yes |  |\n| `repo` | string | yes | The repository's id (`jr_…`). |\n| `revocation_id` | string | no | What revokes it: `POST /v1/repos/{repo}/tokens/revoke` with this id (or `POST /v1/tokens/revoke` carrying the token itself). It and everything narrowed from it stop; the token it was narrowed from goes on. Not a secret; it is also in the signed log's entry of this mint. Empty from a server older than revocation by id. |\n| `scopes` | [Scope] | yes | What it may do: `read` and `change_write` unless `push` was asked for. Nothing else, ever. |\n| `token` | string | yes | The bearer token (`jt_…`). It works on this repository only, for `scopes` only. |\n| `token_id` | string | yes | Its id, as it appears in the signed ref log on every write made with it. |\n\n### Scope\n\nWhat a token may do. Mirrors `jit-trust`'s operations.\n\nOne of: `\"read\"` \\| `\"push\"` \\| `\"change_write\"` \\| `\"review\"` \\| `\"claim\"` \\| `\"merge\"` \\| `\"admin\"`\n\n### SessionEnded\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `ended` | boolean | yes | Always `true`. |\n\n### SessionExchange\n\n`POST /v1/session/exchange`. Its `Debug` shows no value: every field is a credential or binds one.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `access_token` | string | yes | Privy's access token. |\n| `identity_token` | string | yes | Privy's identity token (of the same person: the subjects must match). |\n| `nonce` | string | yes | The login's nonce, from the browser's cookie. |\n| `state` | string | yes | From `POST /v1/session/start`. |\n\n### SessionExchanged\n\nA session (8 hours) for the account.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `account` | AccountBrief | yes |  |\n| `created` | boolean | yes | The account was made by this exchange. |\n| `expires_ms` | integer | yes |  |\n| `fresh_until_ms` | integer | yes | Until when the login counts as fresh (approving a key needs that): ten minutes after Google last verified the person, never after `expires_ms`; may be in the past. |\n| `session` | string | yes | The session token. Shown once; the front end keeps it in the browser's `__Host-neo_session` cookie. |\n\n### SetFeedback\n\n`PATCH /v1/admin/feedback/{id}`. A field left out is left as it is; `null` clears it (not `state`).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | string \\| null | no | A reference to the change that came of it: one line, at most 200 bytes. |\n| `kind` | FeedbackKind \\| null | no |  |\n| `reply` | string \\| null | no | One line for the sender, at most 512 bytes. |\n| `state` | FeedbackState \\| null | no | A kind makes the item triaged unless `state` says otherwise; `received` with a kind is refused. |\n\n### SetGrant\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `scopes` | [Scope] | yes | What the principal may do in this scope from now on. An empty list removes the grant. |\n\n### Signature\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `email` | string | yes |  |\n| `name` | string | yes |  |\n| `time_ms` | integer | yes |  |\n\n### StreamLimits\n\nConcurrent event streams: the token's or its principal's count, whichever has fewer slots left.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `limit` | integer | yes |  |\n| `open` | integer | yes |  |\n\n### SuspendAccount\n\n`POST /v1/admin/accounts/{account}/suspend`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `reason` | SuspendReason | yes |  |\n| `reference` | string \\| null | no | What the administrator can follow up on (a case or ticket number). At most 512 bytes, no control characters. It goes to the server's log line only: it is not stored and never answered. |\n\n### SuspendReason\n\nWhy an instance administrator suspended an account: jit-trust's `ReasonCode`, nothing else.\n\nOne of: `\"abuse\"` \\| `\"spam\"` \\| `\"legal\"` \\| `\"security\"` \\| `\"owner_request\"`\n\n### TokenRevoked\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `logged_in` | string \\| null | no | The repository whose signed log carries the entry: a runner token's own revocation is written in its repository's log. Null for everything else (a token of no repository, and a token narrowed from a runner's revoking itself: those are in the revocation table only). |\n| `newly` | boolean | yes | False when it was revoked already: nothing changed and nothing was written. |\n| `revocation_id` | string | yes |  |\n| `unseen` | boolean \\| null | no | `true` when the request said `\"unseen\": true`; absent otherwise. |\n\n### Tree\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `commit` | string | yes | The commit the tree was read at (resolved from the `rev` in the request). |\n| `entries` | Listed5 | yes |  |\n| `path` | string | yes |  |\n\n### TreeEntry\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `kind` | EntryKind | yes |  |\n| `mode` | integer | yes |  |\n| `name` | string | yes |  |\n| `oid` | string | yes |  |\n| `path` | string | yes |  |\n| `size` | integer \\| null | no | Bytes; null for directories and submodules. |\n\n### UpsertChange\n\n`PUT /v1/repos/{repo}/changes/for/{branch}`: make sure an open change proposes this branch.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `base` | string \\| null | no | The branch a new change targets. Default: the default branch. Ignored for an existing change. |\n| `description` | string \\| null | no | Used only when a change is opened; an existing change keeps its description. |\n| `title` | string | yes | Used only when a change is opened; an existing change keeps its title. |\n\n### Upserted\n\nThe open change for a branch, and what the call did to get it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | ChangeSummary | yes | The change, as `changes.get` answers it. |\n| `created` | boolean | yes | True when the change was opened by this call. |\n| `revised` | boolean | yes | True when this call added a revision (the branch had moved since the change's latest revision). |\n\n### WhoAmI\n\n`GET /v1/whoami`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `anonymous` | boolean | yes |  |\n| `expires_ms` | integer \\| null | no |  |\n| `on_behalf_of` | string \\| null | no | Whose authority the principal acts under, when it is not its own. |\n| `principal` | string | yes | The authenticated principal: who every write is attributed to. `anonymous` without a token. |\n| `scopes` | [Scope] | yes |  |\n| `token_id` | string \\| null | no |  |\n| `via` | string \\| null | no | The sub-agent the token names as its holder, if any. A label for display, not proven and not an identity: everything is attributed to `principal`. |\n\n### WithheldInfo\n\nThe withholding a `withheld` or `restored` log entry is about.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `reason` | WithheldReason \\| null | no | `withheld` entries only. |\n| `reference` | string \\| null | no | `withheld` entries only; may be empty. |\n| `scope` | WithheldScopeInfo \\| null | no | `withheld` entries only. |\n| `seq` | integer | yes | The sequence number of the `withheld` entry: on a `withheld` entry its own, on a `restored` entry the one it lifts. This is what `POST …/restore` takes. |\n\n### WithheldKind\n\nWhat a withholding covers.\n\nOne of: `\"repository\"` \\| `\"refs\"` \\| `\"record\"`\n\n### WithheldReason\n\nWhy a host withholds content, as a class; the particulars go in `reference`.\n\nOne of: `\"legal\"` \\| `\"policy\"` \\| `\"security\"` \\| `\"owner\"`\n\n### WithheldScopeInfo\n\nA withholding's scope as the log states it.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `id` | string \\| null | no | `record`: the record's id when it is text (as jit-collab's ids are). |\n| `id_hex` | string \\| null | no | `record`: the record's id in lowercase hex when it is not text (then `id` is absent). |\n| `kind` | WithheldKind | yes |  |\n| `patterns` | array \\| null | no | `refs`: the patterns (exact, or a prefix ending in `*`). |\n| `record` | string \\| null | no | `record`: the record's kind. |\n\n### Withhold\n\nTake part of a repository down at this host (instance administrators only). What each scope covers, and does not: `WithholdScope`.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `include_queue` | boolean \\| null | no | A `refs` pattern that covers `refs/queue` or anything under `refs/queue/` (the merge queue's candidate pins, e.g. `refs/*` or `refs/queue/*`) is refused unless this is `true`: withholding them stops the queue from serving its candidates. Only for a `refs` scope. Default false. |\n| `reason` | WithheldReason | yes |  |\n| `reference` | string \\| null | no | What a reader can follow up on: a case or notice number, a URL, a policy section. At most 1024 bytes, no control characters. It is public: it is in the signed log, which anyone who may read the repository reads. Default empty. |\n| `scope` | WithholdScope | yes |  |\n\n### WithholdScope\n\nThe scope of a `POST /v1/repos/{repo}/withhold`: `kind` and the fields of that kind only (any other field is refused). `{\"kind\":\"repository\"}` covers every ref's content and every record: API reads of the repository answer `451 withheld` and clone and fetch serve nothing; what stays readable is the repository's record, its signed log and `GET …/withholdings`. `{\"kind\":\"refs\",\"patterns\":[\"refs/heads/leak\",\"refs/heads/topic/*\"]}` covers the refs whose NAMES match and the content only they reach. It does NOT cover content that another served ref, a change's `refs/changes/…` pin or a queue pin also reaches: that stays served, by that ref and by id (decision 0070); cover those refs too, or withhold the repository. Ref names stay listed (they are in the signed log). `{\"kind\":\"record\",\"record\":\"revision\",\"id\":\"<change id>/2\"}` covers one record jit-collab anchors in the log: the API refuses or leaves out a change one of whose revisions, reviews or landing is withheld, and bundles and mirrors leave the record out. It does NOT cover the git content the record names: withhold its refs for that. The log itself is always served, and states every withholding.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `id` | string \\| null | no | `record` only, required: the record's id as jit-collab writes it in the log and the API shows it: a revision `<change id>/<revision number>`, a review `<change id>/<review id>`, a landing `<change id>`, landing rules and a target override their decimal number. The record must exist (`not_found`). Exactly that spelling: another (`/01`, `/+1`, upper case, a change's number for its id) is `bad_request` naming the one to send, since the log compares ids byte for byte. |\n| `kind` | WithheldKind | yes |  |\n| `patterns` | array \\| null | no | `refs` only, required: 1 to 1024 patterns, each under `refs/`, exact or a prefix ending in `*` (a `*` anywhere else is refused: it would match only that literal name). Each must be able to match a ref: an exact pattern a valid ref name (git's rules; it may name a ref that does not exist yet, which withholds the name in advance), a prefix the beginning of one (`refs/heads/topic/` without `*` is refused). |\n| `record` | string \\| null | no | `record` only, required: the record's kind as jit-collab anchors it in the log: `revision`, `review`, `landing`, `landing_rules` or `target_override`. |\n\n### Withholding\n\nA withholding in force: a `withheld` entry that no `restored` entry has lifted (`GET …/withholdings`).\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `at_ms` | integer | yes | When the entry was written, Unix ms. |\n| `binding` | boolean | yes | Whether this host enforces it: signed by this host's own log key. `false` for one stated by an earlier host of the repository (it came with the log): it says what that host did not serve, and binds nobody here. |\n| `reason` | WithheldReason | yes |  |\n| `reference` | string | yes | May be empty. |\n| `scope` | WithheldScopeInfo | yes | In the form a `withhold` body takes, plus `id_hex` for a record id that is not text. |\n| `seq` | integer | yes | The `withheld` entry's sequence number: what `POST …/restore` takes, and where it is in `GET …/reflog`. |\n| `signer` | string | yes | The log key that signed it (64 hex digits). |\n\n### Work\n\n`GET …/work`: what the caller could usefully do next in this repository.\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `cursor` | string | yes |  |\n| `needs_you` | [WorkItem] | yes | The caller's open changes that need action from the caller: failing checks, requested changes, conflicts. |\n| `taken` | [Claim] | yes | Claims held by others: paths and tasks to stay away from. |\n| `to_review` | [WorkItem] | yes | Others' open changes waiting for a review the caller could give. |\n| `your_claims` | [Claim] | yes | The caller's own claims, soonest to expire first. |\n\n### WorkItem\n\n| Field | Type | Required | Meaning |\n| --- | --- | --- | --- |\n| `change` | ChangeBrief | yes |  |\n| `reasons` | [string] | yes | Why it is listed: `checks_failed`, `changes_requested`, `conflicted`, `needs_review`, `behind_base`. |\n","jit":"curl -s https://docs.neoopensource.com/api?format=md","api":"/api?format=md","api_url":"https://git.neoopensource.com/api?format=md"}