09

API

The public edges of the ChangeBox loop.

Client API

Build your own issue desk, work the queue from Cursor, or script it. Create a token in Settings → API and send it as Authorization: Bearer cbk_…. Tokens belong to one organization and carry scopes: read lists and inspects, operator changes status, admin also manages tokens. Nothing here needs a ChangeBox login — keep the token on your server and proxy from your UI.

GET  /api/v1/meta                     statuses, groups, transitions, impacts (no auth)
GET  /api/v1/me                       org, token scopes, apps, queue counts
GET  /api/v1/models                   operator — Cursor models this org's key can launch
GET  /api/v1/apps                     apps with repositories + environments

GET  /api/v1/changes                  ?status=open|verify|closed|reported,in_progress
                                      &app=<appId> &impact=broken,confusing,polish &q=<text>
                                      &assignee=<userId>|unassigned &gate=pending|build|ship
                                      &sort=updated|reported|impact &limit=50
                                      &cursor=<page.nextCursor> &since=<iso>
                                      → { changes, counts, page:{ total, nextCursor, hasMore } }
GET  /api/v1/changes/counts           ?app=&impact=          per-status counts (+ open, gates)
GET  /api/v1/approvals                ?gate=build|ship &app= open gates across the org, newest first
GET  /api/v1/changes/:ref             ?fileTtl=3600          :ref is chg_… or CB-12
                                      → change + events[] + comments[] + screenshots[{url,expiresAt}]

POST /api/v1/changes/:ref/claim       { actor? }             → in_progress, claimer becomes assignee
POST /api/v1/changes/:ref/assign      { assignee?, userId? } point it at a person; null clears
POST /api/v1/changes/:ref/comment     { message, actor? }    timeline note
POST /api/v1/changes/:ref/pr          { prUrl, actor? }      → pr_ready, PR linked
POST /api/v1/changes/:ref/live        { note?, prUrl?, actor? } → live via pr_ready, reporter asked to confirm
POST /api/v1/changes/:ref/block       { note, actor? }       → blocked
POST /api/v1/changes/:ref/wontfix     { note, actor? }       → wontfix, note goes to reporter
POST /api/v1/changes/:ref/status      { status, note?, prUrl?, actor? }  any legal move
POST /api/v1/changes/:ref/agent       { model? } hand to a Cursor Cloud Agent
                                      unknown model → 400 listing GET /api/v1/models

GET  /api/v1/changes/:ref/approvals   gate history: who decided, via what, note
POST /api/v1/changes/:ref/approvals   { gate: build|ship, decision: approve|reject, note?, actor? }
                                      approve scope. Build→approve starts the agent; Ship→approve
                                      unlocks live; Build→reject closes as wontfix; Ship→reject
                                      sends it back with the note as the agent's follow-up
POST /api/v1/changes/:ref/approve     { actor?, note? }      alias: Build gate approve

GET  /api/v1/changes/:ref/evidence    the evidence packet: request as filed, screenshots, spec
                                      versions, policy decisions, approvals (who/when/via), agent
                                      runs, PR, release, reporter verification, timeline, audit
                                      rows; integrity.hash = sha256 over canonical JSON
GET  /api/v1/audit                    ?app=&change=&action=gate.|change.live|… &actor=<userId>
                                      &via=console|widget|slack|email|api|policy &from=&to=&q=
                                      &limit=100 &cursor= &format=json|csv
                                      → { events, page } — the append-only audit log, newest first

GET  /api/v1/changes/:ref/links       external records: Jira / Linear key, url, status

GET    /api/v1/integrations           admin scope — connections (never secrets) + the catalog
POST   /api/v1/integrations           { kind, name?, appId?, config, secret?, events? }
                                      → { integration, secret?, inboundSecret? } shown once
GET    /api/v1/integrations/:id       one connection
PATCH  /api/v1/integrations/:id       { status: active|paused }
DELETE /api/v1/integrations/:id       remove; deliveries and links go with it
GET    /api/v1/integrations/:id/deliveries   ?limit=50 — the delivery log
POST   /api/v1/integrations/:id/deliveries   send a test delivery → 202 { deliveryId }

GET    /api/v1/tokens                 admin scope — list tokens (never plaintext)
POST   /api/v1/tokens                 { name, scopes? }      → { token } shown once
DELETE /api/v1/tokens/:id             revoke

Every mutation appends to the change timeline, refreshes the Slack card, and is attributed to actor (≤ 80 chars) or the token name. Illegal transitions return 409 with the reason; validation errors return 422. Responses carry cache-control: no-store. Errors are { error, code }. A machine-readable spec lives at /openapi.json.

Statuses: reported → in_progress → in_review → pr_ready → live → confirmed, with reopened, blocked, wontfix and failed on the side. live is reachable from in_progress too — a fix does not need a PR on file to ship. Only the reporter (via the widget) moves a change to confirmed or reopened.

Gates: every change passes a Build gate (may an agent build this?) and a Ship gate (may this PR be released?). Each is a row with who decided, through which channel, and why. Under the app's default ship policy the operator who marks a change live decides the Ship gate; under the approver policy an approver must approve first, and /live returns 409 with code gate until they do. Tokens decide gates only with the approve scope.

Remote MCP

POST /api/mcp     Authorization: Bearer <OAuth access token or cbk_…>
            JSON-RPC 2.0, Streamable HTTP, stateless

{ "mcpServers": { "changebox": { "url": "https://changebox.ai/api/mcp" } } }

Add the URL and press Connect. ChangeBox signs you in, asks which organization and scopes to allow, and issues an ordinary API token in your name. See MCP. A pasted cbk_ bearer still works for a headless job. Clients without OAuth run npx -y @changebox/mcp, a stdio shim over this URL. Scopes apply per tool exactly as on /api/v1; a read token gets a readable refusal on a write tool. A token bound to a person acts as that person.

Widget and system

POST /api/widget/report
POST /api/widget/verify
GET  /api/widget/changes
POST /api/widget/handshake
POST /api/deployments/:secret
POST /api/jobs
GET  /api/health