docs/apifrom docs/API.md on main

neoopensource agent API (v1)

<!-- Generated from crates/jit-api/src/registry.rs and types.rs. Do not edit by hand: run cargo xtask docs (or JIT_UPDATE_DOCS=1 cargo test -p jit-api api_md). A test fails when this file is stale. -->
The same information is served by a running instance: /llms.txt (a guide for agents), /v1/openapi.json (OpenAPI 3.1) and GET /v1 (the endpoint list). Wire conventions (the envelope, limits in every answer, bounded lists, cursors, errors, idempotency, events) are in docs/contracts/jit-api.md section 2 and are not repeated per endpoint. Note: Idempotency-Key answers are kept in memory only and do not survive a restart or a crash (every deploy restarts the server); for a write that must not happen twice, use the conditional fields (expect on commits).
Budgets are p50/p99 on a single warm node, measured by cargo xtask bench (see docs/BENCHMARKS.md); a regression fails CI.

Endpoints

EndpointWhat it answersScopeBudget p50/p99
GET /v1/healthLiveness and version.none1/5 ms
GET /v1What this service is: every endpoint with its scope and budget, and links to the guide.none1/5 ms
GET /v1/openapi.jsonOpenAPI 3.1 description of this API, generated from the same table as the routes.none1/5 ms
GET /v1/whoamiWho the token is, for whom it acts, what it may do, and its limits.none2/10 ms
POST /v1/principalsMake a principal's public key known to this instance, so tokens it mints are accepted.admin10/50 ms
PUT /v1/grants/{principal}Set what a principal may do instance-wide (creating repositories needs admin here).admin10/50 ms
PUT /v1/repos/{repo}/grants/{principal}Set what a principal may do on one repository.admin10/50 ms
POST /v1/repos/{repo}/tokensMint a runner's token: one principal, this repository only, read + change_write (push only if asked).admin10/50 ms
POST /v1/repos/{repo}/tokens/revokeRevoke a runner token of this repository by its revocation id: it and what was narrowed from it stop at once.admin10/50 ms
POST /v1/tokens/revokeNeeds 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.none10/50 ms
POST /v1/reposCreate a repository.admin10/50 ms
GET /v1/reposList repositories the caller can read; owner for one account's (u-…/…).read5/25 ms
GET /v1/repos/{repo}One repository: default branch, head commit, clone URL, event cursor, ref-log size.read2/10 ms
POST /v1/repos/{repo}/withholdInstance 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.admin10/50 ms
POST /v1/repos/{repo}/restoreInstance 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.admin10/50 ms
GET /v1/repos/{repo}/withholdingsThe 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.read10/50 ms
GET /v1/admin/accounts/{account}Instance admin only (an unnarrowed token): an account's state, handle and counts. No identity. Alive whatever JIT_SIGNUP says.admin5/25 ms
POST /v1/admin/accounts/{account}/suspendInstance admin only: suspend an account. Its tokens are refused from the next request; its keys are retired for good.admin10/50 ms
POST /v1/admin/accounts/{account}/restoreInstance admin only: lift a suspension. No session, key or token comes back.admin10/50 ms
GET /v1/repos/{repo}/refsList refs, optionally under a prefix.read2/10 ms
GET /v1/repos/{repo}/refs/{name}Read one ref.read2/10 ms
GET /v1/repos/{repo}/commitRead one commit.read2/10 ms
GET /v1/repos/{repo}/logHistory from a revision, newest first, optionally only commits touching a path.read10/50 ms
GET /v1/repos/{repo}/treeList a directory at a revision.read5/25 ms
GET /v1/repos/{repo}/blobRead a file at a revision.read5/25 ms
GET /v1/repos/{repo}/diffDiff two revisions.read10/50 ms
GET /v1/repos/{repo}/filesRead a directory with its files and their content.read10/50 ms
POST /v1/repos/{repo}/commitsCommit up to 1000 files to a branch without a clone: one commit on base; the branch is set to it.push50/200 ms
POST /v1/repos/{repo}/changesPropose a change: a stable id over an evolving stack of commits.change_write10/50 ms
GET /v1/repos/{repo}/changesList changes.read10/50 ms
GET /v1/repos/{repo}/changes/{change}The state of a change in one answer: revisions, diff stat, checks, reviews, conflicts, queue.read10/50 ms
POST /v1/repos/{repo}/changes/{change}/revisionsAdd a revision to a change (what a force-push becomes). Earlier revisions stay readable.change_write10/50 ms
PUT /v1/repos/{repo}/changes/for/{branch}The open change for a branch, or open one: revised when the branch moved, never retitled. Idempotent.change_write10/50 ms
GET /v1/repos/{repo}/changes/{change}/interdiffWhat changed between two revisions of a change.read10/50 ms
POST /v1/repos/{repo}/changes/{change}/checksReport a check result on a revision of a change (the same name again replaces it).change_write10/50 ms
POST /v1/repos/{repo}/claimsClaim a task or a set of paths for a while, so others see it before they start.claim5/25 ms
GET /v1/repos/{repo}/claimsActive claims.read5/25 ms
POST /v1/repos/{repo}/claims/{claim}/renewExtend a claim's lease.claim5/25 ms
DELETE /v1/repos/{repo}/claims/{claim}Release a claim before it expires.claim5/25 ms
GET /v1/repos/{repo}/syncWhat changed since a cursor, folded into state: moved refs, touched changes, active claims.read10/50 ms
GET /v1/repos/{repo}/workWhat the caller could do next: its changes needing action, reviews it could give, claims to avoid.read10/50 ms
GET /v1/repos/{repo}/eventsThe repository's ordered event stream (SSE), resumable from a cursor; or one JSON page with wait_ms.read5/25 ms
GET /v1/eventsThe firehose: events of every repository the token can read, in one ordered stream.read5/25 ms
GET /v1/repos/{repo}/reflog/headThe signed head (checkpoint) of the repository's append-only ref log.read5/25 ms
GET /v1/repos/{repo}/reflogEntries of the signed ref log, oldest first: who moved which ref, for whom, with which token.read5/25 ms
GET /v1/repos/{repo}/reflog/proofProof that one entry is in the signed log: its RFC 9162 audit path; readable whatever is withheld.read10/50 ms
GET /v1/repos/{repo}/reflog/consistencyProof that the signed log only grew between two sizes (RFC 9162); readable whatever is withheld.read10/50 ms
GET /v1/repos/{repo}/bundleThe repository as one signed bundle file, verifiable offline.read10/50 ms
GET /v1/repos/{repo}/queueOne target's landing queue: who is in line, and the candidates being checked.read10/50 ms
GET /v1/repos/{repo}/queue/candidatesCandidates that still need a check, front first: what a rule's reporter runs next.read10/50 ms
POST /v1/repos/{repo}/queue/candidates/{candidate}/checksReport a rule's check on a candidate; passed lands it in its turn.change_write10/50 ms
GET /v1/repos/{repo}/landing-rulesThe repository's landing rules: which changes land by themselves, and on which check.read5/25 ms
PUT /v1/repos/{repo}/landing-rulesReplace the repository's landing rules (the whole list).admin5/25 ms
DELETE /v1/repos/{repo}/landing-rulesRemove every landing rule of the repository: nothing lands by itself any more.admin5/25 ms
POST /v1/feedbackSend 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.none10/50 ms
GET /v1/feedback/{id}What became of one feedback item: its state, kind, the change it led to and a one-line reply.none5/25 ms
GET /v1/admin/feedbackFeedback items, oldest first. Needs instance review (feedback triage) or instance admin.review5/25 ms
GET /v1/admin/feedback/{id}One feedback item in full. Needs instance review (feedback triage) or instance admin.review5/25 ms
PATCH /v1/admin/feedback/{id}Triage a feedback item: state, kind, the change it led to, a reply. Needs instance review (feedback triage) or instance admin.review10/50 ms
DELETE /v1/admin/feedback/{id}Delete a feedback item for good: its id names nothing from then on. Instance admin only.admin10/50 ms
POST /v1/batchUp to 32 reads in one round trip.none10/50 ms
POST /v1/session/startOnly when sign-up is on. Start a login: a state for the login page and a nonce for the browser's cookie.none5/25 ms
POST /v1/session/exchangeOnly when sign-up is on. Finish a login: its state and nonce and Privy's two tokens become a session.none20/100 ms
POST /v1/session/endSign out: end this session, or with everywhere every session of the account. Exists in every sign-up mode.none10/50 ms
GET /v1/accountOnly when sign-up is on. The signed-in account: handle, state, how many keys and repositories.none2/10 ms
POST /v1/pairingsOnly when sign-up is on. Pair a machine: its ed25519 key and a name get a code to type on the account page.none10/50 ms
POST /v1/pairings/lookupOnly when sign-up is on. What a typed code pairs: the machine's name and its key's fingerprint.none5/25 ms
POST /v1/pairings/approveOnly when sign-up is on. Approve a code for the key with the fingerprint the page showed: it becomes a key of the account.none10/50 ms
GET /v1/pairings/{pairing}Only when sign-up is on. A pairing's state, asked by the machine with Authorization: JitKey <poll> signed by its key.none5/25 ms
GET /v1/account/keysOnly when sign-up is on. The machine keys of the signed-in account.none5/25 ms
DELETE /v1/account/keys/{id}Only when sign-up is on. Take a machine key away from the account: its tokens are refused from the next request.none10/50 ms

Sign-up routes and JIT_SIGNUP

The sign-up routes (docs/contracts/accounts.md) exist only as the server's JIT_SIGNUP setting says. A route that does not exist answers exactly what an unknown path answers (404 not_found), and is left out of GET /v1, /v1/openapi.json and /llms.txt on that instance. Every other endpoint exists in every mode. The per-address limits of these routes are kept in memory and start again at a restart.
Endpointoffpreviewprivy
POST /v1/session/startnoyesyes
POST /v1/session/exchangenoyesyes
POST /v1/session/endyesyesyes
GET /v1/accountnoyesyes
POST /v1/pairingsnoyesyes
POST /v1/pairings/lookupnoyesyes
POST /v1/pairings/approvenoyesyes
GET /v1/pairings/{pairing}noyesyes
GET /v1/account/keysnoyesyes
DELETE /v1/account/keys/{id}noyesyes

health

GET /v1/health
Liveness and version.
  • Answer (data): Health. Status, version, backend, uptime. Also served at /healthz without the envelope's cost.
  • Scope: none (works without a token)
  • Budget: p50 1 ms, p99 5 ms
  • CLI: neo health

index

GET /v1
What this service is: every endpoint with its scope and budget, and links to the guide.
  • Answer (data): Index. The endpoint list (bounded by the size of the API).
  • Scope: none (works without a token)
  • Budget: p50 1 ms, p99 5 ms
  • CLI: neo api GET /v1

openapi

GET /v1/openapi.json
OpenAPI 3.1 description of this API, generated from the same table as the routes.
  • Answer (data): OpenApi. A bare OpenAPI document (not wrapped in the envelope).
  • Scope: none (works without a token)
  • Budget: p50 1 ms, p99 5 ms
  • CLI: neo api GET /v1/openapi.json

whoami

GET /v1/whoami
Who the token is, for whom it acts, what it may do, and its limits.
  • Answer (data): WhoAmI. Principal, owner, scopes, expiry. Limits are in meta.limits as in every answer.
  • Scope: none (works without a token)
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo whoami

principals.register

POST /v1/principals
Make a principal's public key known to this instance, so tokens it mints are accepted.
  • Request body: RegisterPrincipal
  • Answer (data): PrincipalInfo. The principal record. Registering the same id again updates its name.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo principal register <id> --name N

grants.instance

PUT /v1/grants/{principal}
Set what a principal may do instance-wide (creating repositories needs admin here).
ParameterInTypeRequiredMeaning
principalpathstringyesPrincipal id (jp_…).
  • Request body: SetGrant
  • Answer (data): GrantInfo. The grant as it now stands. Applies from the next request, also to tokens already issued.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo grant set <principal> --scopes S,…

grants.repo

PUT /v1/repos/{repo}/grants/{principal}
Set what a principal may do on one repository.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
principalpathstringyesPrincipal id (jp_…).
  • Request body: SetGrant
  • Answer (data): GrantInfo. The grant as it now stands. An empty scopes removes it.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo grant set <principal> --repo R --scopes S,…

tokens.runner

POST /v1/repos/{repo}/tokens
Mint a runner's token: one principal, this repository only, read + change_write (push only if asked).
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: MintRunnerToken
  • Answer (data): RunnerToken. The token, once: not stored. Revoke by revocation_id (POST …/tokens/revoke) or by itself (POST /v1/tokens/revoke).
  • Scope: admin
  • 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.
  • Budget: p50 10 ms, p99 50 ms
  • CLI: jit-runner setup <setup.json>

tokens.revoke_repo

POST /v1/repos/{repo}/tokens/revoke
Revoke a runner token of this repository by its revocation id: it and what was narrowed from it stop at once.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: RevokeToken
  • Answer (data): TokenRevoked. Idempotent. The revocation is an entry in the repository's signed log, by the caller.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api POST /v1/repos/<repo>/tokens/revoke --json …

tokens.revoke

POST /v1/tokens/revoke
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.
  • Request body: RevokeAnyToken
  • Answer (data): TokenRevoked. Idempotent; tokens narrowed from it stop too. Unseen, by CLI: neo admin revoke <revocation id> --unseen.
  • Scope: none (works without a token)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo --token-file LEAKED api POST /v1/tokens/revoke

repos.create

POST /v1/repos
Create a repository.
  • Request body: CreateRepo
  • Answer (data): Repo. The repository, including its identity (id), clone URL and event cursor.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo repo create <name>

repos.list

GET /v1/repos
List repositories the caller can read; owner for one account's (u-…/…).
ParameterInTypeRequiredMeaning
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
ownerquerystringnoAn account's handle (u-…): only its repositories, <handle>/<name>.
  • Answer (data): Listed<Repo>. A page of repositories ordered by name.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo repo list

repos.get

GET /v1/repos/{repo}
One repository: default branch, head commit, clone URL, event cursor, ref-log size.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Answer (data): Repo. One record.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo repo get <repo>

repos.withhold

POST /v1/repos/{repo}/withhold
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.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: Withhold
  • Answer (data): LogEntry. The withheld entry.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin withhold <repo> (--repository | --refs PATTERN… | --record KIND ID) --reason R [--reference TEXT]

repos.restore

POST /v1/repos/{repo}/restore
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.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: Restore
  • Answer (data): LogEntry. The restored entry; not_found if none is in force at seq.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin restore <repo> SEQ

repos.withholdings

GET /v1/repos/{repo}/withholdings
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.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
afterquerystringnoSequence number to list after; absent for the first.
limitqueryintegernoPage size, default 100, max 1000.
  • Answer (data): Listed<Withholding>. A page; restore takes an item's seq.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin withholdings <repo>

accounts.admin_get

GET /v1/admin/accounts/{account}
Instance admin only (an unnarrowed token): an account's state, handle and counts. No identity. Alive whatever JIT_SIGNUP says.
ParameterInTypeRequiredMeaning
accountpathstringyesThe account's principal id (jp_…) or handle (u-…).
  • Answer (data): AdminAccount. reason and suspended_ms while suspended.
  • Scope: admin
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo admin account show <account>

accounts.suspend

POST /v1/admin/accounts/{account}/suspend
Instance admin only: suspend an account. Its tokens are refused from the next request; its keys are retired for good.
ParameterInTypeRequiredMeaning
accountpathstringyesThe account's principal id (jp_…) or handle (u-…).
  • Request body: SuspendAccount
  • Answer (data): AccountChanged. The account, changed, keys_retired.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin account suspend <account> --reason R [--reference TEXT]

accounts.restore

POST /v1/admin/accounts/{account}/restore
Instance admin only: lift a suspension. No session, key or token comes back.
ParameterInTypeRequiredMeaning
accountpathstringyesThe account's principal id (jp_…) or handle (u-…).
  • Answer (data): AccountChanged. The account, changed.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin account restore <account>

refs.list

GET /v1/repos/{repo}/refs
List refs, optionally under a prefix.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
prefixquerystringnoOnly refs whose full name starts with this, e.g. refs/heads/. The landing queue's refs are left out under any prefix.
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): Listed<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.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo refs <repo> [--prefix P]

refs.get

GET /v1/repos/{repo}/refs/{name}
Read one ref.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
namepathstringyesFull ref name (refs/heads/main) or a short branch or tag name (main).
  • Answer (data): 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.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo refs <repo> <name>

commit.get

GET /v1/repos/{repo}/commit
Read one commit.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
revquerystringnoA commit id, a full ref name, or a branch or tag name. Default: the default branch.
  • Answer (data): Commit. Ids, parents, author, committer and message (message capped at 64 KiB).
  • Scope: read (public repositories: no token needed)
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo commit <repo> <rev>

log

GET /v1/repos/{repo}/log
History from a revision, newest first, optionally only commits touching a path.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
revquerystringnoA commit id, a full ref name, or a branch or tag name. Default: the default branch.
pathquerystringnoOnly commits that changed this path or anything under it.
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): Listed<Commit>. A page of commits; next continues the walk.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo log <repo> [--rev R] [--path P] [--limit N]

tree

GET /v1/repos/{repo}/tree
List a directory at a revision.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
revquerystringnoA commit id, a full ref name, or a branch or tag name. Default: the default branch.
pathquerystringnoDirectory path; empty or absent for the root.
recursivequerybooleannoList everything under the path, files only.
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): Tree. A page of entries ordered by name, each with kind, id and size. recursive=true lists the subtree.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo tree <repo> [--rev R] [path]

blob

GET /v1/repos/{repo}/blob
Read a file at a revision.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
revquerystringnoA commit id, a full ref name, or a branch or tag name. Default: the default branch.
pathquerystringyesFile path.
rangequerystringnoByte range start-end (end exclusive). Default: the first 1 MiB.
  • Answer (data): Blob. Content inline (UTF-8, or base64 when binary), at most 1 MiB per answer; range reads further.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo blob <repo> <path> [--rev R] [--raw]

diff

GET /v1/repos/{repo}/diff
Diff two revisions.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
basequerystringyesRevision to diff from.
headquerystringyesRevision to diff to.
patchquerybooleannoInclude patches. Default true.
max_bytesqueryintegernoTotal patch bytes, default 262144, max 4194304.
pathquerystringnoOnly this path or anything under it.
  • Answer (data): Diff. Per-file stats (complete up to 5000 files) and unified patches bounded by max_bytes.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo diff <repo> <base> <head>

files

GET /v1/repos/{repo}/files
Read a directory with its files and their content.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
revquerystringnoA commit id, a full ref name, or a branch or tag name. Default: the default branch.
pathquerystringnoDirectory path; empty or absent for the root.
knownquerystringnoA commit you already have, or the tree of an earlier answer.
globquerystringnoOnly matching files: *.lean, src/**/*.rs; comma-separated.
max_bytesqueryintegernoTotal inline content, default 1048576, max 8388608.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): 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.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo files <repo> [path] [--rev R] [--known C] [--glob G]

commits.create

POST /v1/repos/{repo}/commits
Commit up to 1000 files to a branch without a clone: one commit on base; the branch is set to it.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: CommitFiles
  • Answer (data): Committed. The new commit, its tree and parent, the branch and what it pointed at before (expect makes it conditional).
  • Scope: push
  • Budget: p50 50 ms, p99 200 ms
  • CLI: neo write <repo> <branch> PATH=TEXT… -m MSG

changes.create

POST /v1/repos/{repo}/changes
Propose a change: a stable id over an evolving stack of commits.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: CreateChange
  • Answer (data): ChangeSummary. The change summary, as changes.get returns it.
  • Scope: change_write
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo change create <repo> --title T --head REV

changes.list

GET /v1/repos/{repo}/changes
List changes.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
statequerystringnoopen (default), queued, merged, abandoned or all.
authorquerystringnoOnly changes by this principal.
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): Listed<ChangeBrief>. A page of change briefs, most recently updated first; under a withholding, a page may be short.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo change list <repo>

changes.get

GET /v1/repos/{repo}/changes/{change}
The state of a change in one answer: revisions, diff stat, checks, reviews, conflicts, queue.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
changepathstringyesChange id.
  • Answer (data): ChangeSummary. One summary; its lists are bounded (50 revisions, 200 paths) with true counts alongside.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo change get <repo> <change>

changes.revise

POST /v1/repos/{repo}/changes/{change}/revisions
Add a revision to a change (what a force-push becomes). Earlier revisions stay readable.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
changepathstringyesChange id.
  • Request body: AddRevision
  • Answer (data): ChangeSummary. The updated change summary.
  • Scope: change_write
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo change update <repo> <change> --head REV

changes.upsert

PUT /v1/repos/{repo}/changes/for/{branch}
The open change for a branch, or open one: revised when the branch moved, never retitled. Idempotent.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
branchpathstringyesThe head branch's short name; slashes allowed, not encoded.
  • Request body: UpsertChange
  • Answer (data): Upserted. The change summary, with created and revised saying what this call did.
  • Scope: change_write
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo propose <repo> <branch> --title T

changes.interdiff

GET /v1/repos/{repo}/changes/{change}/interdiff
What changed between two revisions of a change.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
changepathstringyesChange id.
fromqueryintegeryesEarlier revision number.
toqueryintegernoLater revision number. Default: the latest.
patchquerybooleannoInclude patches. Default true.
max_bytesqueryintegernoTotal patch bytes, default 262144, max 4194304.
  • Answer (data): Diff. A diff, bounded like diff.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo change interdiff <repo> <change> --from N [--to M]

checks.report

POST /v1/repos/{repo}/changes/{change}/checks
Report a check result on a revision of a change (the same name again replaces it).
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
changepathstringyesChange id.
  • Request body: ReportCheck
  • Answer (data): ChangeSummary. The change summary. precondition_failed (details.head) if head is stale; log max 256 KiB.
  • Scope: change_write
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo check report <repo> <change> --name N --state S

claims.create

POST /v1/repos/{repo}/claims
Claim a task or a set of paths for a while, so others see it before they start.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: CreateClaim
  • Answer (data): Claim. The claim. 409 conflict with the holder in details if an overlapping claim is held by another.
  • Scope: claim
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo claim create <repo> --paths P [--task T] [--ttl-ms N]

claims.list

GET /v1/repos/{repo}/claims
Active claims.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
limitqueryintegernoPage size, default 100, max 1000.
afterquerystringnoThe next cursor of the previous page.
  • Answer (data): Listed<Claim>. A page of unexpired claims, soonest to expire first.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo claim list <repo>

claims.renew

POST /v1/repos/{repo}/claims/{claim}/renew
Extend a claim's lease.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
claimpathstringyesClaim id.
  • Request body: RenewClaim
  • Answer (data): Claim. The claim with its new expiry.
  • Scope: claim
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo claim renew <repo> <claim>

claims.release

DELETE /v1/repos/{repo}/claims/{claim}
Release a claim before it expires.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
claimpathstringyesClaim id.
  • Answer (data): Claim. The released claim.
  • Scope: claim
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo claim release <repo> <claim>

sync

GET /v1/repos/{repo}/sync
What changed since a cursor, folded into state: moved refs, touched changes, active claims.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
sincequerystringyesAn event cursor from an earlier answer; 0 for everything.
  • Answer (data): RepoSync. One object; folds at most 10000 events per call and says so in truncated.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo sync <repo> --since CURSOR

work

GET /v1/repos/{repo}/work
What the caller could do next: its changes needing action, reviews it could give, claims to avoid.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Answer (data): Work. Four bounded lists: needs_you from the caller's 20 most recently updated open changes, the others at most 50 each (claims 200).
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo next <repo>

events.repo

GET /v1/repos/{repo}/events
The repository's ordered event stream (SSE), resumable from a cursor; or one JSON page with wait_ms.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
cursorquerystringnoResume after this event cursor; 0 is the beginning. Default: now.
wait_msqueryintegernoAnswer JSON instead of a stream: return as soon as there is an event, or after this long (max 30000).
limitqueryintegernoPage size, default 100, max 1000.
  • Answer (data): EventPage. text/event-stream with id: = cursor, ending with event: bye {cursor, reason}; with wait_ms, an EventPage of at most limit events.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo events <repo> [--cursor C] [--follow]

events.all

GET /v1/events
The firehose: events of every repository the token can read, in one ordered stream.
ParameterInTypeRequiredMeaning
cursorquerystringnoResume after this event cursor; 0 is the beginning. Default: now.
wait_msqueryintegernoAnswer JSON instead of a stream: return as soon as there is an event, or after this long (max 30000).
limitqueryintegernoPage size, default 100, max 1000.
  • Answer (data): EventPage. As events.repo; cursors of this stream are its own and are not valid on a repository stream.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo events [--cursor C] [--follow]

reflog.head

GET /v1/repos/{repo}/reflog/head
The signed head (checkpoint) of the repository's append-only ref log.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Answer (data): LogHead. Size, Merkle root, signer and signature: what a mirror or auditor pins.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo reflog <repo> --head

reflog.entries

GET /v1/repos/{repo}/reflog
Entries of the signed ref log, oldest first: who moved which ref, for whom, with which token.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
afterquerystringnoSequence number to read after; absent for the beginning.
limitqueryintegernoPage size, default 100, max 1000.
rawquerybooleannoInclude each entry's canonical bytes (base64).
  • Answer (data): Listed<LogEntry>. A page of entries; raw=true adds the canonical signed bytes for local verification.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo reflog <repo> [--after N]

reflog.proof

GET /v1/repos/{repo}/reflog/proof
Proof that one entry is in the signed log: its RFC 9162 audit path; readable whatever is withheld.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
seqqueryintegeryesThe entry's sequence number; below size.
sizequeryintegernoThe tree size to prove against (a signed head's size). Default: the current head's.
  • Answer (data): LogProof. About log2(size) hashes; verify as LogProof says (leaf from reflog?raw=true, verify_inclusion).
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo verify <repo> --entry N --since SIZE:ROOT

reflog.consistency

GET /v1/repos/{repo}/reflog/consistency
Proof that the signed log only grew between two sizes (RFC 9162); readable whatever is withheld.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
oldqueryintegeryesThe size of the checkpoint you kept; at most new.
newqueryintegernoThe size to prove against (a signed head's size). Default: the current head's.
  • Answer (data): LogConsistency. Keep a verified head's size and root; pass it as old. A smaller head or a failing proof: the log was rewritten.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo verify <repo>

repos.bundle

GET /v1/repos/{repo}/bundle
The repository as one signed bundle file, verifiable offline.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • 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.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo bundle <repo> -o FILE

queue.get

GET /v1/repos/{repo}/queue
One target's landing queue: who is in line, and the candidates being checked.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
targetquerystringnoBranch; default main.
  • Answer (data): Queue. At most 200 entries, 200 waiting, 64 candidates (truncated).
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api GET /v1/repos/<repo>/queue

queue.candidates

GET /v1/repos/{repo}/queue/candidates
Candidates that still need a check, front first: what a rule's reporter runs next.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
checkquerystringyesThe check's name.
targetquerystringnoOnly this branch's queue.
  • Answer (data): Candidates. At most 64; commit is what to check and what would land. A plain read.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api GET /v1/repos/<repo>/queue/candidates?check=<name>

queue.report

POST /v1/repos/{repo}/queue/candidates/{candidate}/checks
Report a rule's check on a candidate; passed lands it in its turn.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
candidatepathstringyesCandidate id, from queue.candidates.
  • Request body: ReportCandidate
  • Answer (data): CandidateReported. What landed and was put out. conflict reasons: candidate_gone, stale_run, run_finished.
  • Scope: change_write
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api POST /v1/repos/<repo>/queue/candidates/<id>/checks --json JSON

landing_rules.get

GET /v1/repos/{repo}/landing-rules
The repository's landing rules: which changes land by themselves, and on which check.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Answer (data): LandingRules. Every rule: a change whose changed paths are exactly a rule's lands, squashed, when the rule's check passes.
  • Scope: read (public repositories: no token needed)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api GET /v1/repos/<repo>/landing-rules

landing_rules.set

PUT /v1/repos/{repo}/landing-rules
Replace the repository's landing rules (the whole list).
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Request body: LandingRules
  • Answer (data): LandingRules. The rules as stored. 400 bad_request with the reason for a malformed rule (no globs).
  • Scope: admin
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api PUT /v1/repos/<repo>/landing-rules --json JSON

landing_rules.delete

DELETE /v1/repos/{repo}/landing-rules
Remove every landing rule of the repository: nothing lands by itself any more.
ParameterInTypeRequiredMeaning
repopathstringyesRepository name or id. An account's repository is <handle>/<name> (u-…/proofs), in two segments or with the / as %2F (decision 0089).
  • Answer (data): LandingRules. The now empty list.
  • Scope: admin
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api DELETE /v1/repos/<repo>/landing-rules

feedback.create

POST /v1/feedback
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.
  • Request body: CreateFeedback
  • Answer (data): FeedbackReceipt. The id. 409 conflict (details.reason: feedback_full) while 20 of the sender's items wait. Never replayed by Idempotency-Key.
  • Scope: none (works without a token)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo feedback "text"

feedback.get

GET /v1/feedback/{id}
What became of one feedback item: its state, kind, the change it led to and a one-line reply.
ParameterInTypeRequiredMeaning
idpathstringyesThe id POST /v1/feedback answered.
  • Answer (data): FeedbackStatus. The status only: no text, diagnostics or principal. An unknown or deleted id is the same 404.
  • Scope: none (works without a token)
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo feedback status <id>

feedback.admin_list

GET /v1/admin/feedback
Feedback items, oldest first. Needs instance review (feedback triage) or instance admin.
ParameterInTypeRequiredMeaning
statequerystringnoreceived or triaged.
kindquerystringnobug, idea, question, duplicate or not_planned.
limitqueryintegernoPage size, default 50, max 100.
cursorquerystringnoThe next of the previous page.
  • Answer (data): Listed<FeedbackItem>. A page of whole items; pass next as cursor.
  • Scope: review
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo admin feedback list

feedback.admin_get

GET /v1/admin/feedback/{id}
One feedback item in full. Needs instance review (feedback triage) or instance admin.
ParameterInTypeRequiredMeaning
idpathstringyesFeedback id (fb_…).
  • Answer (data): FeedbackItem. The item. Its text is any UTF-8 a stranger wrote: escape it before showing it.
  • Scope: review
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo admin feedback show <id>

feedback.admin_set

PATCH /v1/admin/feedback/{id}
Triage a feedback item: state, kind, the change it led to, a reply. Needs instance review (feedback triage) or instance admin.
ParameterInTypeRequiredMeaning
idpathstringyesFeedback id (fb_…).
  • Request body: SetFeedback
  • Answer (data): FeedbackItem. The item now. A field left out stays; null clears it; a kind makes it triaged.
  • Scope: review
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin feedback set <id> --kind bug --reply "..." --change "..."

feedback.admin_delete

DELETE /v1/admin/feedback/{id}
Delete a feedback item for good: its id names nothing from then on. Instance admin only.
ParameterInTypeRequiredMeaning
idpathstringyesFeedback id (fb_…).
  • Answer (data): FeedbackDeleted. deleted: true; 404 when there was no such item.
  • Scope: admin
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo admin feedback delete <id>

batch

POST /v1/batch
Up to 32 reads in one round trip.
  • Request body: BatchRequest
  • Answer (data): BatchAnswer. One envelope per request, in order. Costs one request per part.
  • Scope: none (works without a token)
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api POST /v1/batch --json '{"requests":[{"path":"/v1/repos/x"}]}'

session.start

POST /v1/session/start
Only when sign-up is on. Start a login: a state for the login page and a nonce for the browser's cookie.
  • Answer (data): LoginStarted. state and nonce (64 hex each) and expires_ms (10 minutes). No credential; limited per client address.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api POST /v1/session/start

session.exchange

POST /v1/session/exchange
Only when sign-up is on. Finish a login: its state and nonce and Privy's two tokens become a session.
  • Request body: SessionExchange
  • Answer (data): SessionExchanged. A session token (8 h), its expiry, fresh_until_ms, created, the account. Any failed token, state or nonce: 401 sign_in_again.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 20 ms, p99 100 ms
  • CLI: neo api POST /v1/session/exchange --json JSON

session.end

POST /v1/session/end
Sign out: end this session, or with everywhere every session of the account. Exists in every sign-up mode.
  • Request body: EndSession
  • Answer (data): SessionEnded. {"ended": true}. Only an unnarrowed session token: anything else is 403 session_required.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api POST /v1/session/end

account.get

GET /v1/account
Only when sign-up is on. The signed-in account: handle, state, how many keys and repositories.
  • Answer (data): AccountInfo. One record; fresh_until_ms only for a session. A session token or a machine key's token.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 2 ms, p99 10 ms
  • CLI: neo api GET /v1/account

pairings.begin

POST /v1/pairings
Only when sign-up is on. Pair a machine: its ed25519 key and a name get a code to type on the account page.
  • Request body: BeginPairing
  • Answer (data): 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.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo login

pairings.lookup

POST /v1/pairings/lookup
Only when sign-up is on. What a typed code pairs: the machine's name and its key's fingerprint.
  • Request body: LookupPairing
  • Answer (data): 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.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api POST /v1/pairings/lookup --json JSON

pairings.approve

POST /v1/pairings/approve
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.
  • Request body: ApprovePairing
  • Answer (data): PairingApproved. The new key. A fresh session only (403 fresh_login_required); 404 no_such_code; 409 key_limit (5 keys).
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api POST /v1/pairings/approve --json JSON

pairings.status

GET /v1/pairings/{pairing}
Only when sign-up is on. A pairing's state, asked by the machine with Authorization: JitKey <poll> signed by its key.
ParameterInTypeRequiredMeaning
pairingpathstringyesPairing id (32 hex), from POST /v1/pairings.
  • Answer (data): 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.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo login

account.keys

GET /v1/account/keys
Only when sign-up is on. The machine keys of the signed-in account.
  • Answer (data): AccountKeys. At most 5 keys, each with id, name, fingerprint and when it was approved. A session only.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 5 ms, p99 25 ms
  • CLI: neo api GET /v1/account/keys

account.keys.remove

DELETE /v1/account/keys/{id}
Only when sign-up is on. Take a machine key away from the account: its tokens are refused from the next request.
ParameterInTypeRequiredMeaning
idpathstringyesThe key's id (jp_…), from GET /v1/account/keys.
  • Answer (data): KeyRemoved. {"removed": true}. A session only; no fresh login needed.
  • Scope: none (works without a token)
  • 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.
  • Budget: p50 10 ms, p99 50 ms
  • CLI: neo api DELETE /v1/account/keys/<id>

Types

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.

AccountBrief

An account as a session's answer shows it.
FieldTypeRequiredMeaning
handlestringyesu-…, given by the instance.
principalstringyesjp_….
stateAccountStateyes

AccountChanged

What 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).
FieldTypeRequiredMeaning
accountAdminAccountyes
changedbooleanyesfalse when the account already was in that state: nothing was done, nothing was recorded.
keys_retiredinteger | nullnoSuspension only: keys this request took away and retired. The person pairs their machines again.

AccountInfo

GET /v1/account.
FieldTypeRequiredMeaning
created_msintegeryes
fresh_until_msinteger | nullnoFor a session only: until when its login counts as fresh.
handlestringyes
keysintegeryesMachine keys of the account (at most 5).
principalstringyes
repositoriesintegeryesRepositories the account made (at most 10).
stateAccountStateyes

AccountKey

A machine key of an account.
FieldTypeRequiredMeaning
created_msintegeryes
fingerprintstringyes
idstringyesjp_…: the key is a principal, an agent of the account.
namestringyes

AccountKeys

GET /v1/account/keys.
FieldTypeRequiredMeaning
items[AccountKey]yes

AccountState

What the account is: active, or suspended by an administrator.
One of: "active" | "suspended"

AddRevision

FieldTypeRequiredMeaning
expect_revisioninteger | nullnoFail with precondition_failed unless the change is currently at this revision number.
headstringyesThe new top of the stack. A force-push is just a new revision; every earlier one stays readable.
notestringno

AdminAccount

GET /v1/admin/accounts/{account}: an account as an instance administrator sees it. No identity: the provider's subject is never answered.
FieldTypeRequiredMeaning
created_msintegeryes
handlestringyes
keysintegeryesMachine keys of the account (at most 5). A suspension retires them all.
principalstringyes
reasonSuspendReason | nullnoWhile suspended: why.
repositoriesintegeryesRepositories the account made (at most 10).
stateAccountStateyes
suspended_msinteger | nullnoWhile suspended: since when.

ApiError

FieldTypeRequiredMeaning
codeErrorCodeyes
detailsanyno
hintstring | nullnoWhat to do next, in one sentence.
messagestringyes
retry_after_msinteger | nullnoSet on rate_limited and unavailable.

ApprovePairing

POST /v1/pairings/approve: the fingerprint the page showed; approval binds to that key and no other.
FieldTypeRequiredMeaning
codestringyes
fingerprintstringyes

BatchAnswer

FieldTypeRequiredMeaning
answers[BatchPart]yesOne entry per request: the HTTP status it would have had and its full envelope.

BatchItem

FieldTypeRequiredMeaning
methodstringnoOnly GET is accepted.
pathstringyesPath and query, starting with /v1/.

BatchPart

FieldTypeRequiredMeaning
bodyanyyes
statusintegeryes

BatchRequest

FieldTypeRequiredMeaning
requests[BatchItem]yesUp to 32 reads, answered in order.

BeginPairing

POST /v1/pairings: what neo login sends.
FieldTypeRequiredMeaning
namestringyes1 to 64 characters, no control characters: shown on the account page and in the key list.
public_keystringyesThe machine's ed25519 public key, 64 hex digits. Its secret never leaves the machine.

Blob

FieldTypeRequiredMeaning
binarybooleanyes
commitstringyes
contentstringyes
encodingEncodingyes
oidstringyes
pathstringyes
range_endintegeryes
range_startintegeryesThe byte range in content: [start, end).
sizeintegeryesSize of the whole file in bytes.
truncatedbooleanyesTrue when content is not the whole file; ask again with range=start-end.

Candidate

One commit that would land, and what the rule's check says of it so far.
FieldTypeRequiredMeaning
basestringyesWhat it is built on: the target's tip, or the candidate ahead.
changestringyes
checkstringyesThe check the rule wants on it.
commitstringyesThe commit to check (readable by id: tree, blob, files at rev=<commit>). If the check passes, the target moves to exactly this.
idstringyes
numberintegeryes
revisionintegeryes
rulestringyesThe landing rule it is a candidate of.
run_seqintegeryes
stateCheckStateyespending: nobody has reported on it yet.
targetstringyes

CandidateReported

What a report on a candidate did.
FieldTypeRequiredMeaning
candidateCandidate | nullnoThe candidate as it is now; absent once it landed or its change was put out.
ejected[QueueEjected]yesThe changes it put out of the queue.
landed[string]yesThe changes this report landed, in order (its own, and passed ones that were waiting behind it).

Candidates

The candidates that still need a check, front of each queue first (at most 64).
FieldTypeRequiredMeaning
items[Candidate]yes

ChangeBrief

A change as a list item.
FieldTypeRequiredMeaning
authorstringyes
basestringyes
headstringyes
idstringyes
numberintegernoPer-repository number, from 1, never reused; {change} in a path accepts it as well as the id.
revisionintegeryes
stateChangeStateyes
titlestringyes
updated_msintegeryes

ChangeState

One of: "open" | "queued" | "merged" | "abandoned"

ChangeSummary

Everything needed to act on a change, in one answer.
FieldTypeRequiredMeaning
authorstringyes
basestringyesTarget branch (full ref name).
checks[Check]yes
created_msintegeryes
cursorstringyesCursor of the last event about this change.
descriptionstringyes
headstringyesThe current revision's head commit.
idstringyes
landing[RuleVerdict]noWhat 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.
mergeabilityMergeabilityyes
numberintegernoPer-repository number, from 1, never reused; {change} in a path accepts it as well as the id.
on_behalf_ofstring | nullnoOn whose behalf the author acts.
overlapping_claims[Claim]yesActive claims that overlap this change's paths and are held by someone else.
parent_changestring | nullno
paths[string]yesChanged paths of the current revision (bounded: the first 200; stat.files is the true count).
queueQueueEntry | nullno
repostringyes
reviews[Review]yes
revisions[Revision]yesEvery revision, oldest first (bounded: the latest 50).
statDiffStatyesDiff stat of the current revision against its base.
stateChangeStateyes
titlestringyes
updated_msintegeryes

Check

FieldTypeRequiredMeaning
headstring | nullnoThe head the reporter said it checked (always the revision's). Absent: the report named none, and no landing rule counts it.
namestringyes
revisionintegeryesThe revision the check ran against.
run_seqintegernoThe run this result is from (0: the reporter numbers no runs).
stateCheckStateyes
summarystringyes
updated_msintegeryes

CheckState

One of: "pending" | "running" | "passed" | "failed" | "skipped"

Claim

FieldTypeRequiredMeaning
created_msintegeryes
expires_msintegeryes
holderstringyes
idstringyes
notestringyes
on_behalf_ofstring | nullno
paths[string]yes
repostringyes
taskstring | nullno

Commit

FieldTypeRequiredMeaning
authorSignatureyes
committerSignatureyes
messagestringyesThe whole message, at most 64 KiB.
oidstringyes
parents[string]yes
subjectstringyesFirst line of the message.
treestringyes

CommitFiles

POST /v1/repos/{repo}/commits: one commit on top of base with these files written or deleted, and branch set to it.
FieldTypeRequiredMeaning
basestring | nullnoThe new commit's parent: a revision. Default: the default branch's head.
branchstringyesThe 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).
expectstring | nullnoAbsent: 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.
files[FileWrite]yesAt most 1000 entries, each path at most once.
messagestringyesThe commit message. A final newline is added when missing, as git does.

Committed

What POST /v1/repos/{repo}/commits made.
FieldTypeRequiredMeaning
branchstringyesThe branch's full name, now pointing at commit.
commitstringyesThe new commit.
createdbooleanyesTrue when the branch did not exist before.
parentstringyesIts parent: base, resolved.
previousstring | nullnoWhat the branch pointed at before; null when it was created.
treestringyesIts root tree.

CreateChange

FieldTypeRequiredMeaning
basestring | nullnoThe branch this change targets; defaults to the repository's default branch.
descriptionstringno
headstringyesThe commit (or ref) at the top of the stack being proposed.
parent_changestring | nullnoThe change this one is stacked on, if any.
titlestringyes

CreateClaim

FieldTypeRequiredMeaning
notestringno
paths[string]noPath prefixes being worked on, for example crates/jit-api/.
taskstring | nullnoA task id, free text: "issue 12", "fix flaky test x".
ttl_msinteger | nullnoLease length. Default 15 minutes, max 24 hours. The claim disappears when it expires.

CreateFeedback

POST /v1/feedback.
FieldTypeRequiredMeaning
cli_versionstring | nullnoThe sender's CLI version, at most 64 bytes.
diagnosticsFeedbackDiagnostics | nullno
textstringyes1 to 8192 bytes of UTF-8.

CreateRepo

FieldTypeRequiredMeaning
default_branchstring | nullnoDefaults to main.
descriptionstringno
namestringyes[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).
publicboolean | nullnoPublic 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.

Diff

FieldTypeRequiredMeaning
basestringyes
files[FileDiff]yesPer-file stats are always complete up to 5000 files; patches are bounded by max_bytes.
headstringyes
statDiffStatyes
truncatedbooleanyesTrue when any patch was cut or the file list was capped.

DiffStat

FieldTypeRequiredMeaning
additionsintegeryes
deletionsintegeryes
filesintegeryes

Encoding

One of: "utf8" | "base64"

EndSession

POST /v1/session/end. An empty body ends this session.
FieldTypeRequiredMeaning
everywhereboolean | nullnoEnd every session of the account ("sign out everywhere").

EndpointBrief

FieldTypeRequiredMeaning
budget_p50_msintegeryes
budget_p99_msintegeryes
methodstringyes
pathstringyes
scopeScope | nullno
summarystringyes

EntryKind

One of: "file" | "dir" | "symlink" | "submodule"

ErrorCode

Stable machine-readable error codes. The HTTP status follows the code.
One 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"

Event

One entry of a repository's ordered event log.
FieldTypeRequiredMeaning
actorstringyes
cursorstringyesPosition in the stream it was read from; resume with it.
dataanyyesType-specific fields; always an object.
on_behalf_ofstring | nullno
repostringyes
time_msintegeryes
typestringyesrepo.created, ref.updated, change.created, change.revised, change.state, check.updated, review.created, claim.created, claim.renewed, claim.released, claim.expired, queue.updated.

EventPage

The JSON form of the event stream (wait_ms given, or Accept: application/json).
FieldTypeRequiredMeaning
cursorstringyesPass this as cursor next time. Equal to the request's cursor when nothing happened.
events[Event]yes
truncatedbooleanyesTrue when more events were already available than limit.

FeedbackDeleted

FieldTypeRequiredMeaning
deletedbooleanyes
idstringyes

FeedbackDiagnostics

What the sender chose to add about its machine and last command. Each field is one it was shown before sending.
FieldTypeRequiredMeaning
archstring | nullno
last_commandstring | nullnoThe name of the last command, not its arguments.
last_exitinteger | nullno
osstring | nullno
repostring | nullnoA repository's name, if the sender named one.

FeedbackItem

One item, as an instance administrator reads it.
FieldTypeRequiredMeaning
changestring | nullno
cli_versionstring | nullno
created_msintegeryes
diagnosticsFeedbackDiagnostics | nullno
idstringyes
kindFeedbackKind | nullno
principalstring | nullnoThe principal of the token it was sent with; null when sent without one.
replystring | nullno
server_versionstringyesThe version of the server that stored it.
stateFeedbackStateyes
textstringyesAs sent: any UTF-8, control characters included. Escape it before showing it.
updated_msintegeryes

FeedbackKind

One of: "bug" | "idea" | "question" | "duplicate" | "not_planned"

FeedbackReceipt

What POST /v1/feedback stored. Keep id: it is the only way to read the item's status.
FieldTypeRequiredMeaning
created_msintegeryes
idstringyesfb_ and 32 hex digits.
stateFeedbackStateyes

FeedbackState

One of: "received" | "triaged"

FeedbackStatus

What became of an item: all its sender is told.
FieldTypeRequiredMeaning
changestring | nullnoA reference to the change that came of it.
created_msintegeryes
idstringyes
kindFeedbackKind | nullnoNull until someone says what it is.
replystring | nullnoOne line for the sender.
stateFeedbackStateyes
updated_msintegeryes

FileContent

One file of a Files answer.
FieldTypeRequiredMeaning
contentstringyesThe whole file; empty when truncated.
encodingEncodingyes
oidstringyes
pathstringyes
sizeintegeryesSize of the whole file in bytes.
truncatedbooleanyesTrue when the file did not fit in max_bytes: read it with blob (and range).

FileDiff

FieldTypeRequiredMeaning
additionsintegeryes
binarybooleanyes
deletionsintegeryes
old_pathstring | nullno
patchstring | nullnoUnified diff of this file; null when not requested, binary, or cut by max_bytes (then truncated).
pathstringyes
statusFileStatusyes
truncatedbooleanyes

FileStatus

One of: "added" | "modified" | "deleted" | "renamed"

FileWrite

One file to write or delete in POST /v1/repos/{repo}/commits. Give content, or delete: true.
FieldTypeRequiredMeaning
contentstring | nullnoThe whole new content of the file, in encoding.
deleteboolean | nullnoTrue: delete the file (it must exist); a directory left empty disappears. Not together with content.
encodingEncoding | nullnoHow content is written: utf8 (the default) or base64 (any bytes).
pathstringyesPath from the repository root, /-separated: no leading slash, no empty, ., .. or .git segment, no backslash or NUL. Directories are created as needed.

Files

A directory with the files below it and their content.
FieldTypeRequiredMeaning
commitstringyesThe commit the directory was read at (resolved from rev): send it back as known next time.
files[FileContent]yesRecursively, in path order.
nextstring | nullnoPass as after to continue a listing that was cut.
pathstringyes
treestringyesThe id of the directory itself at commit: also accepted as known.
truncatedbooleanyes
unchangedbooleanyesTrue when the directory is the tree known names, or the same in the commit it names: then files is empty.

GrantInfo

FieldTypeRequiredMeaning
principalstringyes
repostring | nullnoThe repository the grant is on; null for an instance-wide grant.
scopes[Scope]yes

Health

FieldTypeRequiredMeaning
backendstringyesmem (in-memory stub) or real.
statusstringyes
time_msintegeryes
uptime_msintegeryes
versionstringyes

Index

GET /v1: what this service is and where to read more.
FieldTypeRequiredMeaning
apistringyes
endpoints[EndpointBrief]yes
eventsstringyes
guidestringyes
openapistringyes
servicestringyes
versionstringyes

KeyRemoved

FieldTypeRequiredMeaning
removedbooleanyesAlways true.

LandingRule

"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."
FieldTypeRequiredMeaning
allow_executablebooleannoOptional: 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.
checkstringyesThe check that must have passed on the change's latest revision.
delete_branchbooleannoOptional: 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.
head_branchstring | nullnoOptional: 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.
namestringyesUnique in the repository; it is in the events.
paths[RulePath]yesThe exact set of changed paths: each with its status, nothing else. No globs.
protect_targetbooleannoThe 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.
queueQueueOptions | nullnoOptional: 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.
reporterstringyesThe only principal whose report of that check counts, and the only one allowed to report it (jp_…).
targetstringyesThe branch changes must target, e.g. main (stored as refs/heads/main).
titlestringyesThe squash commit's title; may use {name}, {change} and {number}.

LandingRules

A repository's landing rules: the body of PUT …/landing-rules and the answer of all three calls.
FieldTypeRequiredMeaning
rules[LandingRule]yes

Limits

The 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.
FieldTypeRequiredMeaning
costintegeryesWhat this request cost.
limitintegeryesBucket capacity: the largest burst.
remainingintegeryesRequests that can be made right now.
reset_msintegeryesMilliseconds until the bucket is full again.
streamsStreamLimitsyes
window_msintegeryesThe bucket refills limit requests per window_ms, continuously.

LogConsistency

That 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).
FieldTypeRequiredMeaning
newintegeryesjit-trust's new_size.
oldintegeryesjit-trust's old_size.
path[string]yesThe hashes, 64 lower-case hex digits each, in the order verify_consistency reads them.

LogEntry

FieldTypeRequiredMeaning
actorstringyes
kindstringyesgenesis, 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).
on_behalf_ofstring | nullno
prevstringyesHash of the previous entry, hex.
rawstring | nullnoThe canonical signed bytes, base64, for clients that verify.
refs[RefMove]yesRef movements of a ref_update entry.
revocation_idstring | nullnoOn a runner_token or token_revoked entry: the revocation id of the token minted or revoked.
seqintegeryes
signaturestringyes
signerstringyes
time_msintegeryes
token_idstring | nullno
withheldWithheldInfo | nullnoOn 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.

LogHead

The signed head of a repository's append-only ref log (jit-trust's checkpoint).
FieldTypeRequiredMeaning
repostringyes
rootstringyesMerkle root over the first size entries, hex.
signaturestringyes
signerstringyes
sizeintegeryes
time_msintegeryes

LogProof

That 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).
FieldTypeRequiredMeaning
path[string]yesThe sibling hashes, 64 lower-case hex digits each (the form of LogHead.root), about log2(size) of them.
seqintegeryes
sizeintegeryesThe tree size the path is for.

LoginStarted

POST /v1/session/start: a login in flight, for 10 minutes.
FieldTypeRequiredMeaning
expires_msintegeryes
noncestringyes64 hex digits: the front end keeps it in the browser's __Host-neo_login cookie.
statestringyes64 hex digits: sent to the login page, which sends it back with Privy's tokens.

LookupPairing

POST /v1/pairings/lookup: the code is in the body, never in a URL.
FieldTypeRequiredMeaning
codestringyes

MergeState

One of: "clean" | "conflicted" | "unknown"

Mergeability

FieldTypeRequiredMeaning
behindintegeryesHow many commits the base has gained since this revision's merge base.
conflicts[string]yesPaths that conflict with the base, when state is conflicted.
stateMergeStateyes

Meta

Present in every answer.
FieldTypeRequiredMeaning
limitsLimitsyesThe caller's limits after this request.
request_idstringyesEcho this when reporting a problem.
took_usintegeryesServer-side time spent on the request, microseconds.

MintRunnerToken

POST /v1/repos/{repo}/tokens: a token for a runner on this one repository.
FieldTypeRequiredMeaning
consentstringyesThe 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.
consent_msintegeryesWhen consent was signed, Unix milliseconds. Accepted for one hour.
principalstringyesThe 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.
scopesarray | nullnoWhat 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.
ttl_msinteger | nullnoHow long the token lasts, in milliseconds. Default 24 hours; at most 30 days.

PairingApproved

FieldTypeRequiredMeaning
keyAccountKeyyes

PairingBegun

FieldTypeRequiredMeaning
codestringyesXXXX-XXXX (Crockford's base 32): typed on the account page. Never put it in a link.
expires_msintegeryes
instance_keystringyesThe instance's key, 64 hex digits: what the machine's polls are signed for.
originstringyesThis 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.
pagestring | nullnoWhere to type the code (<JIT_WEB_URL>/pair), or null: then <JIT_URL>/pair.
pairingstringyes32 hex digits: what the machine polls (GET /v1/pairings/{pairing}).

PairingFound

FieldTypeRequiredMeaning
expires_msintegeryes
fingerprintstringyes16 hex digits: the first 8 bytes of SHA-256 of the machine's key.
namestringyesThe name the machine gave.
started_fromstringyesThe 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.
started_msintegeryes

PairingState

One of: "pending" | "approved"

PairingStatus

GET /v1/pairings/{pairing}.
FieldTypeRequiredMeaning
accountstring | nullnoOnce approved: the account (jp_…).
handlestring | nullnoOnce approved: the account's handle.
statusPairingStateyes

PathChange

How a landing rule expects one of its paths to have changed.
One of: "added" | "modified" | "deleted"

PathMerge

How a landing rule's queue merges a path.
One of: "union"

PrincipalInfo

FieldTypeRequiredMeaning
created_msintegeryes
idstringyes
kindPrincipalKindyes
namestringyes

PrincipalKind

One of: "person" | "org"

Queue

One target's queue. At most 200 entries, 200 waiting changes and 64 candidates are listed; truncated says when there are more.
FieldTypeRequiredMeaning
candidates[Candidate]yesFront first.
entries[QueuedChange]yesIn landing order.
targetstringyes
tipstring | nullno
truncatedbooleanyes
waiting[string]yesChanges that fit the rule and wait for one of their owner's places, in order.

QueueEjected

FieldTypeRequiredMeaning
changestringyes
reasonanyyes{reason, ...}: checks_failed {batch, summary}, merge_conflict {paths}, not_as_the_rule {rule, paths}, superseded, dequeued, abandoned, parent_not_landed {parent}.

QueueEntry

A 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.
FieldTypeRequiredMeaning
batchstring | nullno
enqueued_msintegeryes
positionintegeryes

QueueOptions

How a landing rule's queue runs.
FieldTypeRequiredMeaning
depthintegernoCandidates 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.
max_per_ownerintegernoChanges of one owner in the queue at once: 1 to 64, default 2. Its others wait their turn behind everyone already in line.

QueuedChange

A 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).
FieldTypeRequiredMeaning
authorstringyes
candidatestring | nullnoThe candidate built for it, if one is.
changestringyes
headstringyes
numberintegeryes
positionintegeryes0 is the front.
revisionintegeryes

Ref

FieldTypeRequiredMeaning
namestringyesFull name, for example refs/heads/main.
oidstringyes

RefMove

FieldTypeRequiredMeaning
namestringyes
newstring | nullnoNull when the ref was deleted.
oldstring | nullnoNull when the ref was created.

RegisterPrincipal

FieldTypeRequiredMeaning
idstringyesThe principal's identity: its public key in text form, jp_ followed by 64 hex digits.
kindPrincipalKind | nullnoDefaults to person.
namestringyesA label; it can differ between instances.

RenewClaim

FieldTypeRequiredMeaning
ttl_msinteger | nullno

Repo

FieldTypeRequiredMeaning
clone_urlstringyes
created_bystringyes
created_msintegeryes
cursorstringyesCursor of the newest event; pass it to sync or events to hear only what comes after.
default_branchstringyes
descriptionstringyes
headstring | nullnoCommit the default branch points at; null while the repository is empty.
idstringyesThe repository's identity (its key); survives renames and hosts.
log_sizeintegeryesNumber of entries in the signed ref log.
namestringyes
publicbooleanyes

RepoSync

GET …/sync?since=: what changed in a repository since a cursor, already folded into state.
FieldTypeRequiredMeaning
changes[ChangeBrief]yesChanges created or touched in the interval, in their current state.
claims[Claim]yesClaims active now.
cursorstringyesPass as since next time.
eventsintegeryesNumber of events folded into this answer.
refs[RefMove]yesNet movement of each ref over the interval (one entry per ref, however many times it moved).
sincestringyes
truncatedbooleanyesTrue when the interval held more than the server folds at once; call again with cursor.

ReportCandidate

A reporter's word on a candidate.
FieldTypeRequiredMeaning
headstringyesThe commit that was checked. Required: precondition_failed unless it is the candidate's commit.
logstring | nullnoThe check's output, at most 256 KiB; its last 64 KiB are kept on the change's revision.
namestringyesThe rule's check.
run_seqinteger | nullnoThe 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.
stateCheckStateyes
summarystringno

ReportCheck

A check result on a revision of a change. A second report of the same name on the same revision replaces the first.
FieldTypeRequiredMeaning
headstring | nullnoThe 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.
logstring | nullnoThe check's output as text, at most 256 KiB.
namestringyesThe check's name, e.g. test.
revisioninteger | nullnoThe revision checked. Default: the latest.
run_seqinteger | nullnoWhich 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.
stateCheckStateyes
summarystringno

Restore

Lift a withholding.
FieldTypeRequiredMeaning
seqintegeryesThe sequence number of the withheld entry (seq in the answer of withhold, or of that entry in GET …/reflog).

Review

FieldTypeRequiredMeaning
bystringyes
created_msintegeryes
idstringyes
open_commentsintegeryesComments not yet resolved; each may carry a patch that applies in one call.
revisionintegeryes
summarystringyes
verdictReviewVerdictyes

ReviewVerdict

One of: "approve" | "request_changes" | "comment"

Revision

FieldTypeRequiredMeaning
basestringyes
created_bystringyes
created_msintegeryes
headstringyes
notestringyes
numberintegeryes

RevokeAnyToken

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.
FieldTypeRequiredMeaning
revocation_idstring | nullnoWhich 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.
unseenboolean | nullnotrue: 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.

RevokeToken

POST /v1/repos/{repo}/tokens/revoke: a runner token of that repository.
FieldTypeRequiredMeaning
revocation_idstring | nullnoWhich 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.

RulePath

One path a landing rule lists.
FieldTypeRequiredMeaning
mergePathMerge | nullnoOptional: 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.
pathstringyesFrom the repository root; may contain {name} once (one identifier, shared by every path that uses it).
statusPathChangeyes

RuleVerdict

What one landing rule says about a change now.
FieldTypeRequiredMeaning
landsbooleanyesTrue when nothing stands in the way: the next passing report of the rule's check lands the change.
refusals[any]yesWhat 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).
rulestringyes
warnings[any]noWhat 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.

RunnerToken

A 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.
FieldTypeRequiredMeaning
not_after_msintegeryes
principalstringyes
repostringyesThe repository's id (jr_…).
revocation_idstringnoWhat 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.
scopes[Scope]yesWhat it may do: read and change_write unless push was asked for. Nothing else, ever.
tokenstringyesThe bearer token (jt_…). It works on this repository only, for scopes only.
token_idstringyesIts id, as it appears in the signed ref log on every write made with it.

Scope

What a token may do. Mirrors jit-trust's operations.
One of: "read" | "push" | "change_write" | "review" | "claim" | "merge" | "admin"

SessionEnded

FieldTypeRequiredMeaning
endedbooleanyesAlways true.

SessionExchange

POST /v1/session/exchange. Its Debug shows no value: every field is a credential or binds one.
FieldTypeRequiredMeaning
access_tokenstringyesPrivy's access token.
identity_tokenstringyesPrivy's identity token (of the same person: the subjects must match).
noncestringyesThe login's nonce, from the browser's cookie.
statestringyesFrom POST /v1/session/start.

SessionExchanged

A session (8 hours) for the account.
FieldTypeRequiredMeaning
accountAccountBriefyes
createdbooleanyesThe account was made by this exchange.
expires_msintegeryes
fresh_until_msintegeryesUntil 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.
sessionstringyesThe session token. Shown once; the front end keeps it in the browser's __Host-neo_session cookie.

SetFeedback

PATCH /v1/admin/feedback/{id}. A field left out is left as it is; null clears it (not state).
FieldTypeRequiredMeaning
changestring | nullnoA reference to the change that came of it: one line, at most 200 bytes.
kindFeedbackKind | nullno
replystring | nullnoOne line for the sender, at most 512 bytes.
stateFeedbackState | nullnoA kind makes the item triaged unless state says otherwise; received with a kind is refused.

SetGrant

FieldTypeRequiredMeaning
scopes[Scope]yesWhat the principal may do in this scope from now on. An empty list removes the grant.

Signature

FieldTypeRequiredMeaning
emailstringyes
namestringyes
time_msintegeryes

StreamLimits

Concurrent event streams: the token's or its principal's count, whichever has fewer slots left.
FieldTypeRequiredMeaning
limitintegeryes
openintegeryes

SuspendAccount

POST /v1/admin/accounts/{account}/suspend.
FieldTypeRequiredMeaning
reasonSuspendReasonyes
referencestring | nullnoWhat 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.

SuspendReason

Why an instance administrator suspended an account: jit-trust's ReasonCode, nothing else.
One of: "abuse" | "spam" | "legal" | "security" | "owner_request"

TokenRevoked

FieldTypeRequiredMeaning
logged_instring | nullnoThe 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).
newlybooleanyesFalse when it was revoked already: nothing changed and nothing was written.
revocation_idstringyes
unseenboolean | nullnotrue when the request said "unseen": true; absent otherwise.

Tree

FieldTypeRequiredMeaning
commitstringyesThe commit the tree was read at (resolved from the rev in the request).
entriesListed5yes
pathstringyes

TreeEntry

FieldTypeRequiredMeaning
kindEntryKindyes
modeintegeryes
namestringyes
oidstringyes
pathstringyes
sizeinteger | nullnoBytes; null for directories and submodules.

UpsertChange

PUT /v1/repos/{repo}/changes/for/{branch}: make sure an open change proposes this branch.
FieldTypeRequiredMeaning
basestring | nullnoThe branch a new change targets. Default: the default branch. Ignored for an existing change.
descriptionstring | nullnoUsed only when a change is opened; an existing change keeps its description.
titlestringyesUsed only when a change is opened; an existing change keeps its title.

Upserted

The open change for a branch, and what the call did to get it.
FieldTypeRequiredMeaning
changeChangeSummaryyesThe change, as changes.get answers it.
createdbooleanyesTrue when the change was opened by this call.
revisedbooleanyesTrue when this call added a revision (the branch had moved since the change's latest revision).

WhoAmI

GET /v1/whoami.
FieldTypeRequiredMeaning
anonymousbooleanyes
expires_msinteger | nullno
on_behalf_ofstring | nullnoWhose authority the principal acts under, when it is not its own.
principalstringyesThe authenticated principal: who every write is attributed to. anonymous without a token.
scopes[Scope]yes
token_idstring | nullno
viastring | nullnoThe 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.

WithheldInfo

The withholding a withheld or restored log entry is about.
FieldTypeRequiredMeaning
reasonWithheldReason | nullnowithheld entries only.
referencestring | nullnowithheld entries only; may be empty.
scopeWithheldScopeInfo | nullnowithheld entries only.
seqintegeryesThe 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.

WithheldKind

What a withholding covers.
One of: "repository" | "refs" | "record"

WithheldReason

Why a host withholds content, as a class; the particulars go in reference.
One of: "legal" | "policy" | "security" | "owner"

WithheldScopeInfo

A withholding's scope as the log states it.
FieldTypeRequiredMeaning
idstring | nullnorecord: the record's id when it is text (as jit-collab's ids are).
id_hexstring | nullnorecord: the record's id in lowercase hex when it is not text (then id is absent).
kindWithheldKindyes
patternsarray | nullnorefs: the patterns (exact, or a prefix ending in *).
recordstring | nullnorecord: the record's kind.

Withhold

Take part of a repository down at this host (instance administrators only). What each scope covers, and does not: WithholdScope.
FieldTypeRequiredMeaning
include_queueboolean | nullnoA 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.
reasonWithheldReasonyes
referencestring | nullnoWhat 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.
scopeWithholdScopeyes

WithholdScope

The 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.
FieldTypeRequiredMeaning
idstring | nullnorecord 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.
kindWithheldKindyes
patternsarray | nullnorefs 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).
recordstring | nullnorecord only, required: the record's kind as jit-collab anchors it in the log: revision, review, landing, landing_rules or target_override.

Withholding

A withholding in force: a withheld entry that no restored entry has lifted (GET …/withholdings).
FieldTypeRequiredMeaning
at_msintegeryesWhen the entry was written, Unix ms.
bindingbooleanyesWhether 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.
reasonWithheldReasonyes
referencestringyesMay be empty.
scopeWithheldScopeInfoyesIn the form a withhold body takes, plus id_hex for a record id that is not text.
seqintegeryesThe withheld entry's sequence number: what POST …/restore takes, and where it is in GET …/reflog.
signerstringyesThe log key that signed it (64 hex digits).

Work

GET …/work: what the caller could usefully do next in this repository.
FieldTypeRequiredMeaning
cursorstringyes
needs_you[WorkItem]yesThe caller's open changes that need action from the caller: failing checks, requested changes, conflicts.
taken[Claim]yesClaims held by others: paths and tasks to stay away from.
to_review[WorkItem]yesOthers' open changes waiting for a review the caller could give.
your_claims[Claim]yesThe caller's own claims, soonest to expire first.

WorkItem

FieldTypeRequiredMeaning
changeChangeBriefyes
reasons[string]yesWhy it is listed: checks_failed, changes_requested, conflicted, needs_review, behind_base.