# REST API reference

The REST API is the MCP tool set over plain HTTP. Base URL
`https://mcp.contextfile.ai`; the web app's routes (sync, the Stripe webhook, account,
offers) live on `https://contextfile.ai`. The OpenAPI 3.1 document is at
[/openapi.json](/openapi.json). It is generated from the route table the server
dispatches from, so it cannot list a route the server does not answer.

- Authenticate with `Authorization: Bearer <token>`: an agent token from the OAuth
  server, or a sandbox token.
- Send `Idempotency-Key` on every POST.
- Money is integer cents. One credit is one dollar.
- Every request and response in [the examples](/docs/examples) is replayed against the
  real server on every build.
- Changes are listed in the [API changelog](/docs/changelog) and follow the
  [deprecation policy](/docs/deprecation).

## Trust

`GET /v1/trust/{subject}` on `https://mcp.contextfile.ai` returns one subject's
computed trust: the score, edge counts by type, the time it was computed and a signed
snapshot that an outside service can check offline. The subject is
`principal:<uuid>`, `agent:<uuid>`, `artifact:<uuid>`, `listing:<uuid>`,
`source:<uuid>`, or `@handle` for a seller. The same read renders at
`https://contextfile.ai/trust/{subject}`.

- With a token holding `read:trust`, the route always answers, limited to
  120 requests a minute per API key (Example value).
- With no token, it answers once the graph holds
  500 real edges (Example value) and a snapshot key is
  set, limited to 30 requests a minute per IP
  (Example value). Until then it answers `503` with code `unavailable` and a message
  naming the reason. Real edges are every edge not written by a sandbox order.
- An unknown subject is `404` `not_found`. Over the limit is `429` `rate_limited`, with
  a `Retry-After` header and `remediation` set to `retry_after:<seconds>s`.

The body carries the `get_trust` fields (`score`, `sampleSize`, `passRate`,
`breakdown`) plus `subject`, `edge_counts`, `edges_total`, `computed_at`,
`snapshot_id` and `snapshot`. `snapshot` is null, with `snapshot_unavailable` giving
the reason, only when no snapshot key is configured.

### Snapshot format

A signed snapshot is `{ snapshot, snapshot_id, signature }`, with the JSON Schema at
[/schemas/trust-snapshot-v1.json](/schemas/trust-snapshot-v1.json). `snapshot` holds
`format` (`contextfile.trust-snapshot/v1`), `issuer` (`contextfile.ai`), `subject`,
`score` and `pass_rate` (rounded to 6 decimals), `sample_size`, `edge_counts` (every
edge kind, zero included), `edges_total`, `computed_at` and `graph_root`.
`graph_root` is the RFC 9162 Merkle root over the subject's edges ordered by id; each
leaf input is the SHA-256 of the RFC 8785 form of
`{ id, kind, from_ref, to_ref, report_digest, created_at }`.

### Verify a snapshot

1. Fetch the key set at
   [https://contextfile.ai/.well-known/trust-snapshot-keys.json](/.well-known/trust-snapshot-keys.json).
   It lists `key_id`, `alg` (`Ed25519`), `public_key` (32 bytes, base64url),
   `valid_from` and `valid_to`. These keys sign trust snapshots and nothing else.
2. Serialize `snapshot` with RFC 8785 (JSON Canonicalization Scheme). Its SHA-256,
   prefixed `sha256:`, must equal `snapshot_id`.
3. Find the key whose `key_id` equals `signature.key_id`. `computed_at` must fall at or
   after its `valid_from` and before its `valid_to` (when set).
4. Verify `signature.value` (base64) as an Ed25519 signature over the canonical bytes
   from step 2 with that key.

Any changed field changes the canonical bytes, so step 2 or step 4 fails. No
ContextFile code is needed: an RFC 8785 serializer and an Ed25519 library are enough.

## Operations

Generated from the OpenAPI document (version 1.123.0). The machine-readable copy is [/openapi.json](/openapi.json).

### GET /.well-known/agent-card-keys.json

The Agent Card signing keys as a JWK Set (OKP Ed25519), each with valid_from and valid_to. 503 when the card key is not set.

- server `https://contextfile.ai`

### GET /.well-known/agent-card.json

The signed A2A Agent Card: ContextFile's read-only skills (one per tool of the read-only MCP profile), the read-only MCP endpoint and its OAuth metadata. signatures holds a detached JWS (EdDSA) over the RFC 8785 canonical card without signatures; verify it against /.well-known/agent-card-keys.json. 503 when the card key is not set.

- server `https://contextfile.ai`

### GET /.well-known/did.json

The did:web document for this origin: every claim credential key, current and retired, as a Multikey in verificationMethod and assertionMethod. Open CORS.

- server `https://contextfile.ai`

### GET /.well-known/mcp.json

The same MCP server card as /.well-known/mcp/server-card.json, at the shorter path some clients try first.

- server `https://contextfile.ai`

### GET /.well-known/mcp/server-card.json

The MCP server card: the registry name, title and description from server.json, the API release, the full and read-only MCP endpoints, the OAuth authorization server and protected-resource metadata, and every tool's name and title. Unsigned; the draft format may change.

- server `https://contextfile.ai`

### GET /.well-known/oauth-authorization-server

OAuth 2.1 authorization server metadata (RFC 8414).

- server `https://mcp.contextfile.ai`

### GET /.well-known/oauth-protected-resource

Protected resource metadata (RFC 9728).

- server `https://mcp.contextfile.ai`

### GET /.well-known/promptreports-connector.json

The PromptReports connector manifest (family contract part 1): one action per tool or tool mode, each with its effect (read, write or destructive), input schema, a sample call and, for a write, its PromptCompute catalog action key or catalog_gap; the triggers; and a sha256 digest over the RFC 8785 form, also sent as the ETag.

- server `https://contextfile.ai`

### GET /.well-known/promptreports-inventory.json

The decision, action, approval and setting inventory (family contract part 8), generated from the parity matrix: each row names its MCP tool, API operation, event, page and use cases, and for a write its catalog action key, or an explicit absence or a gap with the task that closes it.

- server `https://contextfile.ai`

### GET /.well-known/receipt-anchor-keys.json

Public receipt anchor keys (Ed25519, shared key set shape plus note_vkey): verify the daily receipt tree heads logged in Rekor or co-signed by a witness.

- server `https://contextfile.ai`

### GET /.well-known/receipt-keys.json

Public receipt-signing keys (Ed25519, shared key set shape): verify any ContextFile receipt offline.

- server `https://contextfile.ai`

### GET /.well-known/report-keys

Public report-signing keys: verify any report signature offline with nothing else.

- server `https://contextfile.ai`

### GET /.well-known/trust-snapshot-keys.json

Public trust-snapshot signing keys (Ed25519, shared key set shape): verify the signed snapshot GET /v1/trust/{subject} returns, offline. 503 when no snapshot key is configured. Open CORS.

- server `https://contextfile.ai`

### GET /.well-known/ucp

UCP business profile (Universal Commerce Protocol): ContextFile's REST and MCP services, the live offers under capability ai.contextfile.offers, and the payment handlers that are on (credits, x402, MPP). Built on request from the offer documents; validated against the published UCP schema.

- server `https://contextfile.ai`

### GET /api/account/export

Download everything held about the signed-in person (GDPR/CCPA).

- server `https://contextfile.ai`

### POST /api/auth/promptreports/backchannel-logout

OpenID Connect back-channel logout from PromptReports ID: a verified logout token ends every session of the linked person.

- server `https://contextfile.ai`

### POST /api/auth/promptreports/org-changed

The org changed notice from PromptReports ID (wp-82 2.4): a verified org_changed_token whose org_seq is newer marks the person's sessions from that ID session, and their next request takes the new org. 200 also for a stale notice; 400 on a failed check; 404 unless PROMPTREPORTS_ORG_CHANGED=on.

- server `https://contextfile.ai`

### POST /api/commitops/events

CommitOps claim.failed events (commitops-signature checked with COMMITOPS_EVENTS_SECRET, five-minute window). Each published item whose site_url is the event's data.url is held: out of the feed and public reads, its owner told by content.held, nothing deleted. 200 when taken or taken before (duplicate), 401 bad or stale signature, 422 any other type, 503 while the secret is unset.

- server `https://contextfile.ai`

### GET /api/family/conflicts

ContextFile's signed conflicts_with statements that name one version by its content digest (topic artifact_conflict), for RepoOps change risk. Signed like the family feed; the grant must name ask for facts. 200 with the list, 400 bad org or digest, 401 signature, 403 no grant, 503 while CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai` · query `org`, `digest`

### GET /api/family/fact

ContextFile's newest family statement on a claim whose topic it owns (artifact, artifact_version, artifact_conflict, purchase_outcome), contract section 8.5. Signed like the feed; the grant must name ask for the statement's kind. 200 statement, 401 signature, 403 no grant, 404 none held, 503 while CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai` · query `org`, `claim`

### GET /api/family/feed

ContextFile's feed of shareable family statements for one org, after a cursor (family statement contract section 8.4). Signed with the reader's family key (headers family-product, family-signer, family-at, family-signature; five-minute window; the key must be listed for that product). Only the kinds the reader's live grant names for read and the org shares. next_cursor moves past hidden entries. 200 page, 400 bad org or cursor, 401 signature, clock or key, 403 no grant or sharing off, 503 while CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai` · query `org`, `cursor`, `limit`

### POST /api/family/quarantine

The family statement quarantine as a service for another family product (PromptReports wp-196 3.1): op=hold holds a statement the caller received, verified and kept as observed per calling product and org; check, replay and decline record the steps; adopt answers the memory.lesson.promote args for the caller to ask promptcompute, then takes the signed promptcompute grant and final args and answers the rule; list shows the caller's holds fenced as data. Signed like the family feed with the caller's family key; query digest is sha256:<hex> of the body; a live family grant must name the quarantine action. 200 done, 202 approval needed, 400 malformed, 401 signature, clock, key or digest, 403 no grant, 404 no such hold or while CONTEXTFILE_FAMILY_QUARANTINE_SERVICE is off, 409 not ready or already decided, 413 too large, 422 a statement refused with the reason, 503 while CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai` · query `org`, `op`, `digest`

### POST /api/family/resume

The hub's signed resume of the stop named by stop_id: releases what the stop held. 200 resumed, 400 a malformed resume, 401 a bad signature, 409 not_current_stop when that stop is not in force, 413 too large, 503 while FAMILY_STOP_SECRET is unset, 404 while EMERGENCY_STOP is off.

- server `https://contextfile.ai`

### POST /api/family/statements

A family statement from another product (CloudEvents 1.0, dataschema https://repoops.ai/specs/family-statement/v1). The Ed25519 signature is inside the statement; it must be by a key set for the sending product and for ContextFile's org. Kept when the authority rule accepts it, keeps it as advisory or routes it to ContextFile as the owner. 200 stored or stored before, 400 not JSON, 413 too large, 422 refused with the reason, 503 while CONTEXTFILE_FAMILY_ORG or CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai`

### POST /api/family/stop

The family emergency stop the PromptReports hub sends (wp-152), signed in x-family-stop-signature with ContextFile's FAMILY_STOP_SECRET. Holds the org's agent work here until the resume; a repeat of the same stop_id answers the current counts. 200 taken, 400 a malformed stop, 401 a missing, stale, wrong or replayed signature, 409 stop_id_taken by another org, 413 too large, 503 while FAMILY_STOP_SECRET is unset, 404 while EMERGENCY_STOP is off. Called by the hub, never a browser.

- server `https://contextfile.ai`

### GET /api/family/stop

An org's emergency stop state here, read by the PromptReports hub with the same signature. 200, 400 no org_id, 401 a bad signature, 503 while FAMILY_STOP_SECRET is unset, 404 while EMERGENCY_STOP is off.

- server `https://contextfile.ai` · query `org_id`

### GET /api/family/switches

ContextFile's feature switches as the hub's switchboard reads them, for one org and environment (PromptReports wp-151). 200 the switches, 400 org_id missing. Called by the hub, never by a browser. Signed in the x-family-stop-signature header. 404 while FAMILY_SWITCHES is off, 401 signature, clock or replay.

- server `https://contextfile.ai` · query `org_id`, `env`

### POST /api/family/switches

The hub's signed request to set an org-scoped switch, with the approval that allowed it (PromptReports wp-151). 413 too large. Called by the hub, never by a browser. Signed in the x-family-stop-signature header. 404 while FAMILY_SWITCHES is off, 401 signature, clock or replay.

- server `https://contextfile.ai`

### GET /api/family/versions

ContextFile's signed artifact_version statements for one repository, newest first, each with its digest, time and changed sections, so RepoOps can line sessions up with context versions (LDG-2210). Signed like the family feed; the grant must name read for facts. 200 with the list, 400 bad org or repo, 401 signature, 403 no grant, 503 while CONTEXTFILE_FAMILY_TRUSTED_KEYS is unset.

- server `https://contextfile.ai` · query `org`, `repo`, `limit`

### GET /api/health

Liveness probe for the web app (uptime monitors).

- server `https://contextfile.ai`

### POST /api/legal/ip-notices

File an IP notice (copyright takedown, trademark, source-owner claim or counter-notice), the agent path of the /legal/ip form. No sign-in. 201 with id and case_ref, and an acknowledgment email that names the DMCA agent; 400 validation_failed with field-level errors and nothing stored. Rate limited per IP and per email.

- server `https://contextfile.ai`

### GET /api/orders/{order_id}/compliance

The signed compliance bundle for one of the signed-in buyer's orders.

- server `https://contextfile.ai`

### GET /api/orders/{order_id}/download

The artifact bytes for one of the signed-in buyer's held or settled orders, the same bytes download_artifact returns. Headers ContextFile-Artifact-Digest and ContextFile-Report-Digest name what they hash to.

- server `https://contextfile.ai` · query `format`

### POST /api/promptcompute/credit-commit

An Enterprise credit commit from PromptCompute (wp-71 4.4): a paid Enterprise invoice funds the org's wallet by a whole number of US cents, signed with RFC 9421 Ed25519 under tag promptreports-credit-commit on the provisioning key set, with an org-wide sequence. Each delivery and each invoice applies once. 200 applied, 401 signature, digest, clock or replay, 400 malformed, 403 another issuer, 422 an unknown org, 409 already applied, 413 body too large, 404 while PROMPTCOMPUTE_CREDIT_COMMIT is off.

- server `https://contextfile.ai`

### POST /api/promptcompute/spend-policy

A spending policy version pushed from PromptCompute (wp-61): an agent's monthly cap, per-item cap, trust and judge floors, allowed types and publishing limits, signed with RFC 9421 Ed25519 under tag promptreports-spend-policy on the same key set as the provisioning push, with an org-wide sequence. Applied as the agent's newest mandate version, which every call reads. 200 applied, 401 signature, digest, clock or replay, 400 malformed, 403 another issuer, 422 a hash mismatch or an unknown org, person or agent, 409 an older or equal sequence, 404 while PROMPTCOMPUTE_SPEND_POLICY is off.

- server `https://contextfile.ai`

### POST /api/promptreports/connect

The one-click connect from PromptReports ID (promptcompute docs/connect-products.md, LDG-2259): the ID delivers the org's promptcompute key and webhook secret (RFC 9421 Ed25519, tag promptreports-connect and no other, provisioning key set, five-minute window, nonce taken once in 24 hours). The body must be v1 connection.issued from the ID, with aud our PROMPTCOMPUTE_CLIENT_ID, product contextfile and external_ref prid:org:<org id>. Stored sealed for that org, replacing its earlier page-connect key at once; a member's own OAuth connection is untouched. 200 stored (a repeat is stored again, never 409), 401 tag, key, signature, digest, clock or replay, 400 malformed, 403 another issuer or aud, 422 another product, an unknown org or an issued_at older than the stored one, 413 too large, 503 while PROMPTCOMPUTE_CLIENT_ID or PROMPTCOMPUTE_CONNECTION_KEY is unset, 404 while PROMPTREPORTS_ID_CONNECT is off.

- server `https://contextfile.ai`

### POST /api/promptreports/move-items

The hub's move_items request (PromptReports wp-82 3.6, promptcompute docs/move-items.md): a plan or an apply for a move of an org's work to another org (RFC 9421 Ed25519, tag promptreports-move-items, provisioning key set, five-minute window, one-time nonce). A plan lists the members and connections of org A; an apply copies the members into org B and refuses each connection with reconnect_required, one result per item. A retried apply answers the stored results. 200 the answer, 401 signature, digest, clock or replay, 400 malformed, 404 unknown_org or while PROMPTREPORTS_MOVE_ITEMS is off, 409 idempotency_conflict or org_suspended, 422 too_many_items.

- server `https://contextfile.ai`

### POST /api/promptreports/person-sessions

PromptReports ID reads one person's live ContextFile sessions for the access page (PromptReports wp-72 5.2/5.5, promptcompute docs/person-sessions.md; RFC 9421 Ed25519, tag promptreports-person-sessions, provisioning key set, five-minute window, one-time nonce, body at most 4 KiB). Each session carries created_at, last_seen_at, expires_at and the browser family only. Sessions belong to an account here, so they are answered only while the person is a live member of the org, else an empty list. 200 the answer, 401 signature, digest, clock or replay, 400 malformed, 404 unknown_org or while PROMPTREPORTS_PERSON_SESSIONS is off, 413 too large.

- server `https://contextfile.ai`

### POST /api/promptreports/provisioning

The provisioning push from PromptReports ID: the whole org (name, members, roles) on every change, or org.removed (RFC 9421 Ed25519, tag promptreports-provisioning, key from https://accounts.promptreports.ai/.well-known/promptreports-provisioning-keys.json, five-minute window, one-time nonce). Members the push leaves out are removed; an older push is ignored. 200 applied, 401 signature, digest, clock or replay, 400 malformed, 403 another issuer, 422 another product, 404 while PROMPTREPORTS_PROVISIONING is off.

- server `https://contextfile.ai`

### GET /api/promptreports/staff/people

The staff people read for PromptReports ID's staff console (staff-people-admin): one page of people (kind=people, the default) or of addresses mailed a sign-in link that never signed up (kind=contacts). RFC 9421 Ed25519 over @method and @target-uri (the full URL with its query), tag promptreports-staff-people, key from the provisioning key set, 300-second window, one-time nonce. limit defaults to 500 and is capped at 1000; next_cursor pages on. No tokens, session ids, IPs or user agents. 200 a page, 400 bad kind, limit or cursor, 401 signature, clock or replay, 404 with no body while PROMPTREPORTS_STAFF_PEOPLE is off.

- server `https://contextfile.ai` · query `kind`, `limit`, `cursor`

### GET /api/promptreports/standalone

The org's standalone publisher plans, for the PromptReports hub's move to the family plan at renewal (wp-44): ref, plan, seats, period_end, interval, monthly_usd and cancel_at_period_end for each live plan bought on ContextFile's own checkout. No card, bank account, customer id or credit balance. org_id is the PromptReports org id; an unknown org, or one with no plans, answers 200 with an empty list; a plan with no pr_org_id whose buyer pays for more than one PromptReports org, or whose subscription Stripe cannot return, is left out. 200, 400 no org_id, 401 wrong token, 503 while PROMPTREPORTS_STANDALONE_TOKEN is unset.

- server `https://contextfile.ai` · query `org_id`

### POST /api/promptreports/standalone/cancel-at-period-end

The PromptReports hub sets one standalone publisher plan to cancel at its period end when the org moves to the family plan (wp-44). Needs an Idempotency-Key header; a repeat with the same key changes nothing. The plan stays on until that day. 200 with the period end, 400 no key or bad body, 401 wrong token, 404 not this org's plan, 409 not live or ambiguous_owner (no pr_org_id on the subscription and the buyer pays for more than one PromptReports org), 413 body too large, 503 while PROMPTREPORTS_STANDALONE_TOKEN is unset.

- server `https://contextfile.ai`

### GET /api/receipts/{id}

One artifact.verification receipt, to anyone who can see its report; 404 otherwise.

- server `https://contextfile.ai`

### POST /api/repoops/credentials

Credentials RepoOps issues per linked PromptReports org (RFC 9421 Ed25519, tag repoops-sibling-credentials, key from https://www.repoops.ai/.well-known/repoops-sibling-keys.json, five-minute window, one-time nonce). Stored sealed, one per org and kind; a new delivery rotates it, a revoke notice deletes it. 200 stored, 401 signature, digest, clock or replay, 400 malformed, 404 an org from another issuer, 422 another product, 503 while REPOOPS_SIBLING_CREDENTIAL_KEY is unset.

- server `https://contextfile.ai`

### POST /api/repoops/memory-effect

RepoOps' memory.error_returned event: the error a promoted memory entry was meant to prevent came back (PromptReports plan wp-130 3.1 and 4.1; RFC 9421 Ed25519, tag repoops-memory-effect, key from https://www.repoops.ai/.well-known/repoops-sibling-keys.json, five-minute window, one-time nonce, body at most 8 KiB). Names the org and the entry by its packet address memory:<name>@<version>, optionally with its digest; one return per event_id. An error_fix entry with 20 packet loads in 30 days and 3 returns since promotion is paused until a person decides. Shape in docs/repoops-memory-effect.md. 200 recorded (replayed for an event_id already taken), 400 malformed, 401 signature, digest, clock or replay, 404 an org or entry not here, 409 a digest that is not the entry's, 413 too large, 422 another product or a future time, 503 while CONTEXTFILE_MEMORY_EFFECT is off.

- server `https://contextfile.ai`

### POST /api/stripe/webhook

Stripe events (signature verified). The only path that credits real money.

- server `https://contextfile.ai`

### PUT /api/sync/blobs/{digest}

Upload one blob; the server re-hashes it.

- server `https://contextfile.ai`

### POST /api/sync/manifest

Which digests the owner does not hold yet.

- server `https://contextfile.ai` · query `locator`

### GET /api/sync/revisions

What the server holds for a synced folder (cf sync).

- server `https://contextfile.ai` · query `locator`

### POST /api/sync/snapshots

Commit snapshots (Idempotency-Key required); server-side injection scan.

- server `https://contextfile.ai` · query `locator`

### GET /auth/promptreports/callback

PromptReports ID redirect URI (code, state, iss).

- server `https://contextfile.ai` · query `code`, `state`, `iss`, `error`

### GET /auth/promptreports/start

Start Sign in with PromptReports (the product switcher's entry; prompt=none allowed). 404 while PROMPTREPORTS_SIGNIN is off.

- server `https://contextfile.ai` · query `prompt`, `next`

### POST /auth/promptreports/start

Start Sign in with PromptReports from the login button, or link it from account settings (mode=link, CSRF field). Same origin only.

- server `https://contextfile.ai`

### GET /badge/{id}

Verification badge for a published item: /badge/{artifact_id}.svg is the SVG (image/svg+xml) showing the live state (verified, re-check due once the report passes its age limit, recalled after an erratum or an open judge recall, or not verified), with the report digest in the CF-Report-Digest header; /badge/{artifact_id} redirects to the item's report, or its page when the report is not public.

- server `https://contextfile.ai`

### GET /benchmarks.json

Verifier accuracy on the golden set: the latest signed result (precision, recall, misgrounded rate) with judge model, judge prompt hash, set digest and date, plus the run history, and the uplift scorecard (with and without ContextFile, per model) under uplift. The same values /benchmarks shows. Open CORS.

- server `https://contextfile.ai`

### GET /benchmarks/judge-prompt.json

The live judge prompt: its version, its sha256 hash (the one every report and golden-set result pins) and the exact text the hash covers. Generated from the same source as benchmarks/judge-prompt.json in the harness. Open CORS.

- server `https://contextfile.ai`

### GET /benchmarks/pickup.json

The pick-up benchmark (wp-133): the task set and every signed run with its date and who ran it (ranBy: name, internal or outside, link). Per model and arm (none, files, contextfile) a run shows finish rate, repeat rate, tokens per task and second-session time only when it is a full outside run listed in outside-runs.json and the golden set's second labels meet golden_min_kappa; otherwise figures is null and reason says why. The same values /benchmarks/pickup shows. 404 while CONTEXTFILE_PICKUP_BENCHMARK is off. Open CORS.

- server `https://contextfile.ai`

### GET /export/okf

OKF export of public content.

- server `https://contextfile.ai`

### GET /feeds/acp.json

ACP product feed (Agentic Commerce Protocol): one product per live one-off offer at the live price in cents. For discovery; checkout runs on ContextFile's own rails. Built on request from the offer documents; validated against the published ACP feed schema.

- server `https://contextfile.ai`

### GET /healthz

Liveness probe for uptime monitors. Body is exactly {"ok":true}; X-Contextfile-Commit names the deployed commit when Railway sets it.

- server `https://mcp.contextfile.ai`

### GET /listings/{id}/license.xml

The listing's license terms in the RSL format (application/rsl+xml), derived from the licenses of every source its report cites and the listing license; the most restrictive term wins.

- server `https://contextfile.ai`

### POST /mcp

MCP Streamable HTTP: JSON-RPC (initialize, tools/list, tools/call). Also served at /.

- server `https://mcp.contextfile.ai`

### GET /mcp

MCP server-to-client SSE stream for an initialized session.

- server `https://mcp.contextfile.ai`

### DELETE /mcp

End an MCP session.

- server `https://mcp.contextfile.ai`

### POST /mcp/public

MCP Streamable HTTP with no token: initialize, tools/list and tools/call for the public tools only (content_get and claims_verify). For static site builds and outside checkers.

- server `https://mcp.contextfile.ai`

### DELETE /mcp/public

End a public MCP session.

- server `https://mcp.contextfile.ai`

### POST /mcp/readonly

MCP Streamable HTTP, read-only profile: the same OAuth bearer token as /mcp, but tools/list and tools/call reach only artifacts_search, artifacts_get, claims_verify, trust_get and content_get. No tool here writes, spends, tops up or subscribes. The surface listed in directories that bar servers which move money.

- server `https://mcp.contextfile.ai`

### GET /mcp/readonly

Server-to-client SSE stream for a read-only profile session.

- server `https://mcp.contextfile.ai`

### DELETE /mcp/readonly

End a read-only profile session.

- server `https://mcp.contextfile.ai`

### GET /oauth/authorize

Authorization endpoint (code + PKCE S256); redirects to the consent screen.

- server `https://mcp.contextfile.ai` · query `response_type`, `client_id`, `redirect_uri`, `scope`, `state`, `code_challenge`, `code_challenge_method`, `resource`

### POST /oauth/authorize/decision

The consent screen's decision call (web server only, short-lived principal token).

- server `https://mcp.contextfile.ai`

### POST /oauth/device_authorization

Device authorization grant (RFC 8628) for cf login.

- server `https://mcp.contextfile.ai`

### POST /oauth/register

Dynamic client registration (RFC 7591) with the principal's initial access token.

- server `https://mcp.contextfile.ai`

### POST /oauth/token

Token endpoint: authorization_code, refresh_token, token exchange (RFC 8693), device_code.

- server `https://mcp.contextfile.ai`

### POST /oci/callback

The OCI build workflow's result: the image digest, image_ref and signer (repository, run_id, commit, GitHub Actions OIDC issuer), sent after the workflow verified the SLSA provenance and SBOM attestation. Binds the digest to the oci_image artifact version once (201); the same digest again is 200; a different one is 409. Bearer OCI_CALLBACK_TOKEN; only the configured repository's workflow is accepted.

- server `https://mcp.contextfile.ai`

### GET /offers/{id}

The offer document for a live listing (ETag, If-None-Match gives 304).

- server `https://contextfile.ai`

### GET /openapi.json

This document.

- server `https://mcp.contextfile.ai`

### POST /promptcompute/webhook

promptcompute approval events for connected principals (promptcompute-signature checked with that principal's webhook secret). The decision is read back from the promptcompute API before anything runs.

- server `https://mcp.contextfile.ai`

### GET /receipts/{id}/proof

A receipt, its receipt_hash, its inclusion proof to the daily root and the AI Source of Truth anchor (status anchored or pending_anchor), plus any approval.grant an escrow.release was checked against as linked, and outside_anchor (the day's tree head in Rekor or co-signed by a witness) once logged there. 404 unless both id and hash match. Open CORS, 60 requests a minute per IP.

- server `https://contextfile.ai` · query `hash`

### GET /red-team/skills.json

The published red-team set for the skills safety lane: hidden-character and injection samples, each quarantined when uploaded as a skill. Hidden code points stay as JSON escapes. Data, never instructions. Open CORS.

- server `https://contextfile.ai`

### GET /reports/{digest}/attestation.sigstore.json

The report as a Sigstore bundle: an in-toto Statement v1 (predicate type https://contextfile.ai/verification-report/v1, subject the artifact SHA-256) in a DSSE envelope signed with the report key, with its Rekor entry once logged. Check it with cosign and /.well-known/report-keys. Public reports to anyone, others to the artifact owner; 404 otherwise.

- server `https://contextfile.ai`

### GET /reports/{digest}/claims/{claim_id}/credential

One verified claim as a W3C Verifiable Credential 2.0: DataIntegrityProof (eddsa-rdfc-2022) by did:web for this origin, subject {claim_id, text_hash, source_locator, entailment, report_digest}, and a BitstringStatusListEntry. Public reports to anyone, others to the artifact owner; 404 otherwise, 409 for a claim that did not verify, 503 without the VC key.

- server `https://contextfile.ai`

### POST /sandbox/agents

Register a sandbox agent: a token with test credits, an active test mandate and the synthetic catalog. No human step.

- server `https://mcp.contextfile.ai`

### GET /schemas/offer-v1.json

JSON Schema (draft 2020-12) of offer documents.

- server `https://contextfile.ai`

### GET /schemas/trust-snapshot-v1.json

JSON Schema (draft 2020-12) of signed trust snapshots.

- server `https://contextfile.ai`

### GET /schemas/verification-report-v1.json

JSON Schema (draft 2020-12) of the verification-report/v1 attestation predicate.

- server `https://contextfile.ai`

### GET /settings/promptcompute/callback

Where promptcompute sends the signed-in person back after Connect promptcompute (code, state). Exchanges the code server side and redirects to /settings/agents.

- server `https://contextfile.ai` · query `code`, `state`, `error`

### GET /sites/{domain}/llms.txt

The free verified llms.txt teaser for a publisher site: only items whose current signed report meets its floor and is not recalled, each with its report digest. text/plain. 404 for a site that is not verified.

- server `https://contextfile.ai`

### GET /status-lists/{id}

A W3C Bitstring Status List credential (revocation) for the claim credentials exported in month {id} (YYYY-MM). An erratum against a claim sets its bit. Signed by the same did:web key; cache for its ttl. Open CORS.

- server `https://contextfile.ai`

### GET /status.json

Live status, the agent path for /status: web, MCP and worker health plus both key sets, each with state (up, down or unknown), checked_at and the deployed commit when known. Checks run per request; always 200.

- server `https://contextfile.ai`

### POST /v1/acceptance/runs

Run a held-out scenario set against a document's text or an https URL and get the signed verdict: each scenario's pass or fail by id, the share satisfied and the org's floor, with judge scores and evidence for a reviewer only. Never a scenario's text. Limited per agent and per set for a caller who may not read the set (429 rate_limited).

- server `https://mcp.contextfile.ai` · MCP twin `acceptance_run` · scope `read:artifact` · requires `Idempotency-Key`

### GET /v1/acceptance/verdicts/{digest}

One signed acceptance verdict of the org, by digest.

- server `https://mcp.contextfile.ai` · MCP twin `acceptance_get` · scope `read:artifact` · query `org`

### POST /v1/agents/{agent_id}/revoke

Revoke one of the caller's agents for a PromptReports workflow run, with the PromptCompute approval id and the run id. A second call answers replayed. Off unless FAMILY_AGENT_REVOKE=on.

- server `https://mcp.contextfile.ai` · MCP twin `agents_revoke` · scope `delete` · requires `Idempotency-Key`

### POST /v1/artifacts

Create a doc artifact from a brief and a locked corpus; queues a generation run (watch it with GET /v1/runs/{run_id}).

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_create` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/artifacts/{artifact_id}/changes

The claim-level difference between two versions: added, removed and changed claims with match confidence, and the unchanged count.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_get` · scope `read:artifact` · query `from`, `to`

### POST /v1/artifacts/{artifact_id}/delete

Ask to delete a doc you own. Answers 202 pending_approval: nothing is deleted until a person approves (a PromptCompute artifact.delete approval for a connected owner).

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_delete` · scope `delete` · requires `Idempotency-Key`

### GET /v1/artifacts/{artifact_id}/files

The files of one of your org's skills at its newest version that is not a draft, with the corpus its verification used. Off unless CONTEXTFILE_CURATOR_APPROVALS is on.

- server `https://mcp.contextfile.ai` · MCP twin `skills_get_files` · scope `read:artifact`

### POST /v1/artifacts/{artifact_id}/versions

Queue a new version of a doc you own; corpus_id (a corpus you locked) rebuilds it from new sources, otherwise the run reuses the latest version's corpus.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_update` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/artifacts/{id}

An artifact and its current version: artifact digest, report digest, floor and live listings.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_get` · scope `read:artifact`

### GET /v1/balance

Credit balance for the calling principal.

- server `https://mcp.contextfile.ai` · MCP twin `account_get` · scope `read:artifact`

### POST /v1/brief/context

For the PromptReports agent brief: the context packet digest for each task id in task_ids (at most 50), as contextfile-brief-context/v1. Digests only, never a packet's content; for the org of the ID agent token.

- server `https://mcp.contextfile.ai` · MCP twin `get_brief_context` · scope `read:artifact`

### GET /v1/console-search

For the PromptReports console's search: the org's context files whose name or id matches q, as family-search/v1. For the org of the ID agent token. Off unless CONTEXTFILE_SEARCH is on.

- server `https://mcp.contextfile.ai` · MCP twin `search` · scope `read:artifact` · query `q`, `limit`

### GET /v1/console/issues

For the PromptReports console's issues page: the org's open issues as family-issues/v1, or the one issue id names. For the org of the ID agent token. Off unless CONTEXTFILE_CONSOLE_READS is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_issues` · scope `read:artifact` · query `id`

### GET /v1/console/next

For the PromptReports console's next list: what waits on a person in the org, as family-next/v1. For the org of the ID agent token. Off unless CONTEXTFILE_CONSOLE_READS is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_next` · scope `read:artifact`

### POST /v1/content

Publish author-written markdown to a verified site; queues the verification run.

- server `https://mcp.contextfile.ai` · MCP twin `content_publish` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/content/{artifact_id}

One published item by artifact id.

- server `https://mcp.contextfile.ai` · MCP twin `content_get` · scope `read:artifact`

### POST /v1/context-packets

A starter context packet for an agent's job: verified artifacts pinned and cited by digest, with a packet digest as its version.

- server `https://mcp.contextfile.ai` · MCP twin `context_packet` · scope `read:artifact`

### POST /v1/context/data-access

Read data access guidance: one guide by name, the guides whose question shares words with question, or every guide. The source and the query, never data. Off unless CONTEXTFILE_DATA_ACCESS is on.

- server `https://mcp.contextfile.ai` · MCP twin `data_access_get` · scope `read:artifact`

### POST /v1/context/data-access/save

Save data access guidance for a question (the source to trust, where the data lives, how to query it) as the next version of a named context file, as contextfile.data-access/v1. A figure or rows of values answers 422 with reason holds_data. Off unless CONTEXTFILE_DATA_ACCESS is on.

- server `https://mcp.contextfile.ai` · MCP twin `data_access_save` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/context/delete

Delete a context file under a person's PromptCompute approval for contextfile.context.delete: without approval_id it files the request and answers pending_approval; with the approved approval_id it deletes. Restorable until context_delete_restore_days pass.

- server `https://mcp.contextfile.ai` · MCP twin `context_delete` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/context/export

The org's promoted memory entries for a repo rendered as each coding assistant's files (AGENTS.md, CLAUDE.md and .claude/rules, .cursor/rules, .github/instructions, GEMINI.md, SKILL.md), each block marked generated with its address, digest and sum. Writes nothing. Off unless CONTEXTFILE_CONTEXT_EXPORT is on.

- server `https://mcp.contextfile.ai` · MCP twin `export_context` · scope `read:artifact`

### POST /v1/context/lint

Score a CLAUDE.md or AGENTS.md from 0 to 100 with each finding's rule, line and reason. Nothing is stored.

- server `https://mcp.contextfile.ai` · MCP twin `context_lint` · scope `read:artifact`

### POST /v1/context/load

Load context files at their newest stored version or the version each name@N pins; with paths, only files whose globs match plus files with no globs. A deleted file never loads.

- server `https://mcp.contextfile.ai` · MCP twin `context_load` · scope `read:artifact`

### POST /v1/context/log

One context file's versions, newest first, with who saved each, state and digest; from and to add the line diff between two versions.

- server `https://mcp.contextfile.ai` · MCP twin `context_log` · scope `read:artifact`

### POST /v1/context/restore

Restore a deleted context file before its window ends; it loads again at the same address and digest.

- server `https://mcp.contextfile.ai` · MCP twin `context_delete` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/context/retention

An org store's retention for versions no load cited: keep_versions and cited_days, or the defaults (context_retention_keep_versions, context_retention_cited_days) when none is set.

- server `https://mcp.contextfile.ai` · MCP twin `get_context_retention` · scope `read:artifact` · query `org`

### POST /v1/context/retention

Set an org store's retention: keep_versions (at least 1) and cited_days (0 or more). An org owner or admin only.

- server `https://mcp.contextfile.ai` · MCP twin `set_context_retention` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/context/save

Save text as the next version of a named context file in your org's or personal store. expected_version (the version you started from, 0 for a new file) makes a stale save answer 409 conflict with the newest address, digest and a diff, storing nothing. paths sets the file's globs. Injection-scanned; a hit is quarantined and never loads.

- server `https://mcp.contextfile.ai` · MCP twin `context_save` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/context/search

Search your own context stores by words in a file's name or newest text. Never reads published content.

- server `https://mcp.contextfile.ai` · MCP twin `context_search` · scope `read:artifact`

### POST /v1/context/versions

Which version of each context file was newest at a time (at), with address and digest. No text.

- server `https://mcp.contextfile.ai` · MCP twin `context_versions` · scope `read:artifact`

### POST /v1/context/versions/{version_id}/failed

Mark the context version a failed PromptReports run loaded, when the RepoOps diagnosis names context as the cause, with run_id, case_id and summary. A repeat for the same version and case answers replayed. Off unless FAMILY_CONTEXT_FAILURE_MARKS=on.

- server `https://mcp.contextfile.ai` · MCP twin `mark_context_version_failed` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/corpora

Lock sources you registered into a content-addressed corpus for a generation run; answers corpus_id and the source count; sends corpus.locked.

- server `https://mcp.contextfile.ai` · MCP twin `corpus_manage` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/corpora/{corpus_id}/coverage

Coverage of a locked corpus against a brief, before any spend.

- server `https://mcp.contextfile.ai` · MCP twin `corpus_manage` · scope `read:artifact` · query `brief`

### POST /v1/definitions

Save a new version of a business definition for the org (contextfile.definition/v1). Off unless DEFINITIONS is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `save_definition` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/definitions

The org's business definitions whose term holds q, newest version of each. Off unless DEFINITIONS is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `search_definitions` · scope `read:artifact` · query `q`, `limit`, `org`

### GET /v1/definitions/term

One business definition of the org by term, newest or a version. Off unless DEFINITIONS is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `get_definition` · scope `read:artifact` · query `term`, `version`, `org`

### GET /v1/downloads/{token}

The bytes behind a signed download URL from artifacts_download. The token is the credential and expires; a refund revokes it. Headers ContextFile-Artifact-Digest and ContextFile-Report-Digest name what the bytes hash to.

- server `https://mcp.contextfile.ai`

### GET /v1/errata

Errata affecting an artifact, or the caller's purchases.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_get` · scope `read:artifact` · query `artifact_id`

### POST /v1/errata

Issue an erratum on one of your reports with reason, optional claim_ids and an optional successor_digest: revokes the claims' status list entries, marks the version superseded when a successor is named, sends erratum.issued to everyone who holds or loaded the version and shares the family correction. The report's owner, or an owner or admin of its org, only.

- server `https://mcp.contextfile.ai` · MCP twin `erratum_issue` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/escrow-signoff

Set whether escrow releases need a person's sign-off in PromptCompute, with an approval for contextfile.escrow_signoff.set. Off while buying is off.

- server `https://mcp.contextfile.ai` · MCP twin `account_security` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/events

Poll the caller's events (every webhook event is also pollable).

- server `https://mcp.contextfile.ai` · query `type`, `cursor`, `limit`

### POST /v1/events/{id}/redeliver

Re-arm one event for the next webhook delivery pass.

- server `https://mcp.contextfile.ai`

### GET /v1/family-spend

The caller's spend for the PromptReports hub billing page: by workflow run, user and agent, mandate caps and what is left, open escrow holds and refunds. Read only; never on the family invoice. Off unless FAMILY_SPEND_VIEW=on.

- server `https://mcp.contextfile.ai` · MCP twin `spend_get` · scope `read:artifact` · query `since`, `until`

### POST /v1/handoffs

Write the next version of a task's handoff (contextfile.handoff/v1); it supersedes the last, and state done closes it. Secrets are cut and every field is screened; a flagged version is kept quarantined and never served. The assignee's agents and the org's owners and admins only (owners and admins only with CONTEXTFILE_BRIEF_ASSIGNEE_SCOPE off). Off unless CONTEXTFILE_HANDOFFS is on.

- server `https://mcp.contextfile.ai` · MCP twin `handoff_write` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/handoffs

Every version of a task's handoff, newest first, with the open one. The assignee's agents and the org's owners and admins only (owners and admins only with CONTEXTFILE_BRIEF_ASSIGNEE_SCOPE off). Off unless CONTEXTFILE_HANDOFFS is on.

- server `https://mcp.contextfile.ai` · MCP twin `handoff_list` · scope `read:artifact` · query `task_id`, `org`, `limit`

### GET /v1/handoffs/open

A task's open handoff (task_id), or one version (handoff_id). The assignee's agents and the org's owners and admins only (owners and admins only with CONTEXTFILE_BRIEF_ASSIGNEE_SCOPE off). Off unless CONTEXTFILE_HANDOFFS is on.

- server `https://mcp.contextfile.ai` · MCP twin `handoff_get` · scope `read:artifact` · query `task_id`, `handoff_id`, `org`

### POST /v1/held-out/sets

Save a held-out scenario set for a repo or a document as its next version. Reviewers only, on a token with no write scope; a refusal is recorded. Off unless the org is in HELD_OUT_ACCEPTANCE.

- server `https://mcp.contextfile.ai` · MCP twin `held_out_save` · scope `read:artifact` · requires `Idempotency-Key`

### GET /v1/held-out/sets

The org's held-out scenario sets by name, with the newest stored version and its digest. Reviewers only.

- server `https://mcp.contextfile.ai` · MCP twin `held_out_get` · scope `read:artifact` · query `org`

### GET /v1/held-out/sets/{name}

One version of a held-out scenario set with its scenarios. Reviewers only, on a token with no write scope; a token that can write to the work is refused and the refusal is recorded.

- server `https://mcp.contextfile.ai` · MCP twin `held_out_get` · scope `read:artifact` · query `version`, `org`

### POST /v1/images

Ask for a signed OCI image of an artifact version you own. Answers 202 pending_approval; the build runs in GitHub Actions only after a person approves (PromptCompute oci.build for a connected owner).

- server `https://mcp.contextfile.ai` · MCP twin `images_build` · scope `build:image` · requires `Idempotency-Key`

### POST /v1/knowledge/curator-inputs

For the PromptReports hub's curate-context workflow: the org's open knowledge flags, the newest text of each context file they name, and the chat or wiki messages in sources, each screened first; a message that trips the scan comes back by tool, ref, digest and rules, never its text. Any live member of the org. Read-only. Off unless CONTEXTFILE_CURATOR and CONTEXTFILE_KNOWLEDGE_FLAGS are on.

- server `https://mcp.contextfile.ai` · MCP twin `curator_inputs` · scope `read:artifact`

### POST /v1/knowledge/flags

Keep an agent's flag that a context file, skill or lesson of the org is missing something or wrong, against the version it names (the body the PromptReports hub's flag_knowledge forwards). Another org's item answers not_found; a flag whose text the scan flags is kept quarantined. A flag changes nothing it names. Off unless CONTEXTFILE_KNOWLEDGE_FLAGS is on.

- server `https://mcp.contextfile.ai` · MCP twin `flag_knowledge` · scope `read:artifact` · requires `Idempotency-Key`

### GET /v1/knowledge/flags

The org's knowledge flags, newest first, for its reviewers and the curator; a quarantined flag shows its findings and no text. Any live member of the org. Off unless CONTEXTFILE_KNOWLEDGE_FLAGS is on.

- server `https://mcp.contextfile.ai` · MCP twin `knowledge_flags_list` · scope `read:artifact`

### POST /v1/launch-proof

A launch's docs and specs, each pinned and cited by artifact and report digest, with one proof digest over the set.

- server `https://mcp.contextfile.ai` · MCP twin `launch_proof` · scope `read:artifact`

### GET /v1/ledger

Credit ledger, newest first.

- server `https://mcp.contextfile.ai` · MCP twin `account_get` · scope `read:artifact` · query `cursor`, `limit`

### POST /v1/listings

List an artifact (a free public context entry while buying is off). It lands pending_approval until a person approves it (PromptCompute listing.publish for a connected owner).

- server `https://mcp.contextfile.ai` · MCP twin `listings_create` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/listings/{listing_id}/calls

One metered call on a per-call listing: a cited answer from its verified edition, charged per call through escrow (credits with a Bearer token; x402 without one).

- server `https://mcp.contextfile.ai` · MCP twin `commerce_buy` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/listings/{listing_id}/download

Download a listing: with buying on, your newest held or settled order's version, the same answer as GET /v1/orders/{order_id}/download (no order answers 403 forbidden); with buying off (CONTEXTFILE_COMMERCE), a live listing's current verified edition, free. Buys nothing.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_download` · scope `purchase` · query `format`, `via`

### GET /v1/listings/{listing_id}/economics

The payout range for a listing from (T - c) / 2, with every input.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_get` · scope `read:artifact`

### GET /v1/listings/{listing_id}/health

The owner's health view of a listing: floor-pass history, re-verify failures with reasons, upstream drift, verified buyer outcomes, uplift and refund causes.

- server `https://mcp.contextfile.ai` · MCP twin `world_get` · scope `read:artifact`

### POST /v1/listings/{listing_id}/maintainer

Mark a listing you sell maintainer verified with the Sigstore keyless bundle the upstream repository's GitHub Actions workflow wrote over the listing's current artifact digest. The workflow must be one of your trusted publisher links.

- server `https://mcp.contextfile.ai` · MCP twin `maintainer_verify` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/listings/{listing_id}/usage

The owner's agent usage of an official listing per UTC day: reads, installs, downloads and searches that returned it. Aggregate counts only, no buyer identity.

- server `https://mcp.contextfile.ai` · MCP twin `world_get` · scope `read:artifact` · query `days`

### GET /v1/memory/adoption

The org's memory use as team totals over the last 30 days, counts only: entries a packet can serve, how many sessions other than the proposer's loaded and how many such sessions, and how many no packet loaded. Off unless CONTEXTFILE_MEMORY_EFFECT is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_memory_adoption` · scope `read:artifact` · query `org`

### POST /v1/memory/answers/{answer_id}/recheck

Check a memory_ask answer record again with no model call: its signature, and whether each entry it read was since marked wrong, retired or replaced. Off unless MEMORY_ASK is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `recheck_memory_answer` · scope `read:artifact`

### POST /v1/memory/ask

A cited answer over the org's memory, every sentence citing an entry by digest and checked by the pinned judge, or not_found naming the layers, entries and dates searched; a signed answer record. Off unless MEMORY_ASK is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `ask_memory` · scope `read:artifact`

### GET /v1/memory/entries/{entry_id}

A promoted memory entry with its source and promoter, and every run, session or agent that read it.

- server `https://mcp.contextfile.ai` · MCP twin `get_memory_entry` · scope `read:artifact` · query `org`, `as_of`

### POST /v1/memory/entries/{entry_id}/wrong

Mark a memory entry wrong: later packets leave it out; the answer lists every run and session that read it.

- server `https://mcp.contextfile.ai` · MCP twin `mark_memory_entry_wrong` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/memory/fetch

Full memory entries by name, the versions a packet could serve the caller, each load recorded as a read. Off unless MEMORY_RETRIEVAL is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `fetch_memory_entries` · scope `read:artifact`

### GET /v1/memory/lesson-repeats

For the PromptReports proof numbers: how often a mistake repeats once its lesson is in the org's memory, last 30 days, as contextfile.lesson-repeats/v1. For the org of the ID agent token. Off unless CONTEXTFILE_MEMORY_EFFECT is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_lesson_repeats` · scope `read:artifact`

### POST /v1/memory/okf/export

The org's promoted memory as OKF v0.1 files, one per entry, with address and digest under cf:. Reads only. Off unless CONTEXTFILE_CONTEXT_EXPORT is on.

- server `https://mcp.contextfile.ai` · MCP twin `export_memory_okf` · scope `read:artifact`

### POST /v1/memory/okf/import

OKF v0.1 files filed as memory proposals a person reviews, screened as outside content. Off unless CONTEXTFILE_CONTEXT_EXPORT is on.

- server `https://mcp.contextfile.ai` · MCP twin `import_memory_okf` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/memory/proposals

Propose a lesson, an error and its fix, or a decision for the org's memory, with its sources. It waits for a person; the same proposal twice answers replayed. Off unless the org is in FAMILY_MEMORY_ORGS.

- server `https://mcp.contextfile.ai` · MCP twin `propose_memory` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/memory/proposals

The org's memory proposal queue, newest first: pending, promoted, declined, quarantined or all.

- server `https://mcp.contextfile.ai` · MCP twin `list_memory_proposals` · scope `read:artifact` · query `state`, `org`, `limit`

### POST /v1/memory/proposals/{proposal_id}/decision

Promote (asks a person in PromptCompute, then applies with the approved approval_id; wins settles an open contradiction) or decline a memory proposal.

- server `https://mcp.contextfile.ai` · MCP twin `decide_memory_proposal` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/memory/reads

Who read the org's memory, oldest first: each entry version handed to a run, session or agent, with the reader, digest and time. Owners and admins only; no entry text, never a person's notes. Off unless MEMORY_AUDIT is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `export_memory_reads` · scope `read:artifact` · query `org`, `entry_id`, `reader_kind`, `reader_id`, `from`, `to`, `limit`, `after`

### POST /v1/memory/rules

Turn the promotion rule error_fix_check_passed on (under a person's PromptCompute approval, once the org's memory is 30 days old) or off.

- server `https://mcp.contextfile.ai` · MCP twin `set_memory_rule` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/memory/service-report

The org's weekly memory service report: entries promoted, loads, pauses, repeat errors per lesson, changed citations, quarantined writes, tokens per load and the stale-memory rate, each with the rows it counts. Owners and admins only. Off unless MEMORY_SERVICE_REPORT is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `get_memory_service_report` · scope `read:artifact` · query `org`, `week_ending`

### POST /v1/memory/tool

The Claude memory tool's commands over the org's reviewed memory as files under /memories. Reads come from promoted entries; writes file proposals a person reviews. Off unless MEMORY_TOOL_BACKEND is on for the org.

- server `https://mcp.contextfile.ai` · MCP twin `memory_files` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/model-keys

The model keys your org holds for its own model work (OpenAI, Anthropic, OpenRouter, Amazon Bedrock): provider, model, region, the active one, dates and last test. Never a key.

- server `https://mcp.contextfile.ai` · MCP twin `model_keys` · scope `read:artifact`

### POST /v1/model-keys

Add or rotate a model key and make it active, with an approval for contextfile.model_key.set naming the key's fingerprint. The key is sealed at rest and never answered back.

- server `https://mcp.contextfile.ai` · MCP twin `model_keys` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/model-keys/{provider}/remove

Remove a stored model key, with an approval for contextfile.model_key.remove. With no active key, model features are off.

- server `https://mcp.contextfile.ai` · MCP twin `model_keys` · scope `delete` · requires `Idempotency-Key`

### POST /v1/model-keys/{provider}/test

Test a stored model key with one short call on the key itself; answers ok and, on failure, a status and reason that never quote the key.

- server `https://mcp.contextfile.ai` · MCP twin `model_keys` · scope `read:artifact` · requires `Idempotency-Key`

### POST /v1/mpp/sessions

MPP sessions (no account): open a session on a deposit the MPP rail confirmed. Body { deposit_ref, voucher_key } where voucher_key is a raw Ed25519 public key, base64url. Returns session_id, session_token, deposit_cents and expires_at. One deposit opens one session; a retry returns it (200). Off unless the operator configures MPP; test network only until legal sign-off.

- server `https://mcp.contextfile.ai`

### GET /v1/mpp/sessions/{session_id}

MPP: the session's deposit, running total, each draw's order and state, and the settlement once it posted. Session token in X-ContextFile-Session-Token.

- server `https://mcp.contextfile.ai`

### POST /v1/mpp/sessions/{session_id}/calls

MPP: one paid call. Body { listing_id, formats?, voucher { cumulative_cents, signature } }; the signature is Ed25519 over cf-mpp-voucher-v1|session_id|cumulative_cents|listing_id. The total must rise by exactly the call's price; a replayed or lower total is refused and draws nothing. The draw is held in escrow as an ordinary order. Session token in X-ContextFile-Session-Token.

- server `https://mcp.contextfile.ai`

### POST /v1/mpp/sessions/{session_id}/close

MPP: stop taking vouchers and settle once. 202 with outcome waiting while a draw's order still holds escrow (the worker settles it later); 200 with outcome settled and the settlement (passing draws claimed, the rest returned to the depositor in one transfer). Repeating it changes nothing. Sessions also close at expiry.

- server `https://mcp.contextfile.ai`

### GET /v1/mpp/sessions/{session_id}/orders/{order_id}/download

MPP: the artifact for an order this session paid for, the same answer artifacts_download gives. Session token in X-ContextFile-Session-Token.

- server `https://mcp.contextfile.ai` · query `format`

### POST /v1/orders

Buy a listing under the agent's mandate; escrow holds the price.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_buy` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/orders

The caller's orders with state.

- server `https://mcp.contextfile.ai` · MCP twin `account_get` · scope `purchase` · query `cursor`, `limit`

### GET /v1/orders/{order_id}

One of the caller's orders with the fields order.done carries: state, done, listing_id, escrow_cents, formats, run_id, workflow_run_id and report_digest. Off unless CONTEXTFILE_ORDER_READ=on.

- server `https://mcp.contextfile.ai` · MCP twin `orders_get` · scope `purchase`

### GET /v1/orders/{order_id}/compliance-bundle

Signed compliance bundle for a settled order (report, judge version, key id, timestamps).

- server `https://mcp.contextfile.ai` · MCP twin `compliance_get` · scope `purchase`

### GET /v1/orders/{order_id}/download

Download a purchased artifact: inline bytes or a short-lived signed URL, with the artifact and report digests. via=install marks a cf install.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_download` · scope `purchase` · query `format`, `via`

### POST /v1/orders/{order_id}/outcome

Report whether a bought artifact was used and whether the task succeeded; once per order. A signed report earns a small credit.

- server `https://mcp.contextfile.ai` · MCP twin `outcomes_report` · scope `purchase` · requires `Idempotency-Key`

### POST /v1/orders/{order_id}/release

Release an order waiting in awaiting_release_approval with a PromptCompute escrow.release approval id; the grant is checked against the order's args and used once.

- server `https://mcp.contextfile.ai` · MCP twin `escrow_release` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/payouts

Payout history and whether payouts are enabled.

- server `https://mcp.contextfile.ai` · MCP twin `account_get` · scope `read:artifact` · query `cursor`, `limit`

### POST /v1/promptcompute/disconnect

Disconnect PromptCompute, with an approval for contextfile.promptcompute.disconnect. Connecting needs the person's browser.

- server `https://mcp.contextfile.ai` · MCP twin `account_security` · scope `delete` · requires `Idempotency-Key`

### POST /v1/promptreports/unlink

Unlink the PromptReports account, with an approval for contextfile.promptreports.unlink. Linking needs the person to sign in.

- server `https://mcp.contextfile.ai` · MCP twin `account_identity` · scope `delete` · requires `Idempotency-Key`

### POST /v1/quotes/purchase

A dry run of a purchase: price, every check, delivery outcome, forecasts. Nothing is held or written.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_quote` · scope `purchase`

### POST /v1/quotes/run

The credit price of a generation run and a quote_token for artifacts_create.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_quote` · scope `write:doc`

### POST /v1/quotes/subscription

A dry run of a subscription: cycle price, every check, the cycle floor-pass forecast.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_quote` · scope `purchase`

### GET /v1/recalls

Recall notices for artifacts the caller bought, watches, downloaded free or depends on, each with the digest to remove. Returned once, then marked delivered.

- server `https://mcp.contextfile.ai` · MCP twin `recalls_get` · scope `read:artifact`

### GET /v1/reports/{digest}

Fetch a signed, content-addressed report by digest.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_get` · scope `read:artifact`

### POST /v1/reverify

Re-run one claim of a public report with its pinned judge; a signed result. No token needed; rate-limited.

- server `https://mcp.contextfile.ai` · MCP twin `claims_verify` · scope `read:artifact`

### GET /v1/runs/{run_id}

One run the caller queued, with the publish outcome for a publish run.

- server `https://mcp.contextfile.ai` · MCP twin `runs_get` · scope `read:artifact`

### GET /v1/search

Search the catalog; each result carries a trust summary and offer URLs.

- server `https://mcp.contextfile.ai` · MCP twin `artifacts_search` · scope `read:artifact` · query `type`, `topic`, `floor`, `max_price`, `cursor`, `limit`

### POST /v1/seller-signoff-prompt/dismiss

Dismiss the seller sign-off prompt, with an approval for contextfile.seller_signoff_prompt.dismiss.

- server `https://mcp.contextfile.ai` · MCP twin `publisher_manage` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/sessions

The caller's live web sessions, newest seen first, and the account id an approval for a setting names. No token or address is shown.

- server `https://mcp.contextfile.ai` · MCP twin `account_security` · scope `read:artifact`

### POST /v1/sessions/revoke

Sign out one web session or every other one, with an approval for contextfile.session.revoke.

- server `https://mcp.contextfile.ai` · MCP twin `account_security` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/sites

The caller's publisher sites and their verification status.

- server `https://mcp.contextfile.ai` · MCP twin `sites_manage` · scope `read:artifact`

### POST /v1/sites

Register a site; returns the DNS TXT record and well-known file that prove ownership.

- server `https://mcp.contextfile.ai` · MCP twin `sites_manage` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/sites/{domain}/verify

Check domain ownership now (DNS TXT or the well-known file).

- server `https://mcp.contextfile.ai` · MCP twin `sites_manage` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/sites/{site}/content/{slug}

One published item by site and slug: markdown, sanitized HTML, metadata, report and badge (no token needed for public items).

- server `https://mcp.contextfile.ai` · MCP twin `content_get` · scope `read:artifact`

### POST /v1/sites/{site}/content/{slug}/unpublish

Take an item off the site's feed and public reads at once (the site's owner only). Versions and reports stay; a new version that meets its floor publishes it again. Sends content.unpublished.

- server `https://mcp.contextfile.ai` · MCP twin `content_unpublish` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/sites/{site}/content/{slug}/versions

Publish a new version of an item.

- server `https://mcp.contextfile.ai` · MCP twin `content_publish` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/sites/{site}/feed

A verified site's published items (no token needed; ETag and If-None-Match supported).

- server `https://mcp.contextfile.ai` · MCP twin `content_get` · scope `read:artifact` · query `kind`, `cursor`, `limit`

### POST /v1/skills

Upload an Agent Skills folder: pinned by archive digest, scanned (hidden characters, injection, scripts), then verified against a corpus. oidc_token marks a trusted publisher.

- server `https://mcp.contextfile.ai` · MCP twin `skills_publish` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/snapshot

For the PromptReports hub's home: the org's ContextFile snapshot as family-snapshot/v1 (memory proposals waiting for review, versions held for a person, the oldest waiting proposal's day, proposals waiting more than a week, and a link). Counts only; for the org of the ID agent token. Off unless CONTEXTFILE_SNAPSHOT is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_snapshot` · scope `read:artifact`

### GET /v1/source-terms/rule

The org's source terms rule: the RSL terms classes a context packet loads, or the default (allowed, attribution, no_terms_found). Off unless CONTEXTFILE_SOURCE_TERMS is on.

- server `https://mcp.contextfile.ai` · MCP twin `get_source_terms_rule` · scope `read:artifact` · query `org`

### POST /v1/source-terms/rule

Set the org's source terms rule: the terms classes a context packet loads. An org owner or admin only. Off unless CONTEXTFILE_SOURCE_TERMS is on.

- server `https://mcp.contextfile.ai` · MCP twin `set_source_terms_rule` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/sources

Register public sources (GitHub repo at a commit, docs page, llms.txt); fetch, snapshot by digest and lock them into a corpus.

- server `https://mcp.contextfile.ai` · MCP twin `corpus_manage` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/subscriptions

Subscribe to a living-artifact listing.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_buy` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/subscriptions

The caller's subscriptions.

- server `https://mcp.contextfile.ai` · MCP twin `account_get` · scope `purchase` · query `cursor`, `limit`

### POST /v1/subscriptions/{subscription_id}/cancel

Cancel a subscription (buyer or seller). Terminal.

- server `https://mcp.contextfile.ai` · MCP twin `commerce_cancel` · scope `purchase` · requires `Idempotency-Key`

### POST /v1/topups

Top up credits off-session (sandbox: test credits, no payment).

- server `https://mcp.contextfile.ai` · MCP twin `credits_top_up` · scope `purchase` · requires `Idempotency-Key`

### GET /v1/trust/{subject}

Computed, recency-weighted trust for a principal:, agent:, artifact:, listing: or source: ref, or @handle: score, edge counts by kind, computed_at and a signed snapshot (keys at /.well-known/trust-snapshot-keys.json). No token needed once the graph holds enough real edges; rate limited per API key and per IP.

- server `https://mcp.contextfile.ai` · MCP twin `trust_get` · scope `read:trust`

### POST /v1/trusted-publishers

Link a GitHub trusted publisher, with an approval for contextfile.trusted_publisher.link.

- server `https://mcp.contextfile.ai` · MCP twin `publisher_manage` · scope `write:doc` · requires `Idempotency-Key`

### POST /v1/trusted-publishers/unlink

Unlink a GitHub trusted publisher, with an approval for contextfile.trusted_publisher.unlink.

- server `https://mcp.contextfile.ai` · MCP twin `publisher_manage` · scope `write:doc` · requires `Idempotency-Key`

### GET /v1/webhooks

The caller's webhook endpoints (id, url, created_at, event_types), never their secrets. event_types is null when the endpoint receives every type. With org (a PromptReports ID org id): that org's endpoints, for its owner or admin, while CONTEXTFILE_FAMILY_SENDERS is on.

- server `https://mcp.contextfile.ai` · query `org`

### POST /v1/webhooks

Register an https webhook endpoint for the caller's events. The answer carries the signing secret, shown this once; each delivery is signed X-ContextFile-Signature = HMAC-SHA256(secret, timestamp.body). At most 10 per account. While CONTEXTFILE_FAMILY_SENDERS is on: event_types limits the endpoint to the event types listed (each must be a trigger in the connector manifest; left out or null, every type), and org registers the endpoint for that org, which then receives the events the org owns (an owner or admin of the org only, on a token with write:doc; at most 10 per org).

- server `https://mcp.contextfile.ai`

### PATCH /v1/webhooks/{id}

Change the event types one webhook endpoint receives: a list of triggers from the connector manifest, or null for every type. The caller's own endpoint, or an org's for its owner or admin on a token with write:doc. Off until CONTEXTFILE_FAMILY_SENDERS is on.

- server `https://mcp.contextfile.ai`

### DELETE /v1/webhooks/{id}

Remove one of the caller's webhook endpoints, or one of an org's as its owner or admin on a token with write:doc.

- server `https://mcp.contextfile.ai`

### POST /v1/wikis/{artifact_id}/ask

Ask a wiki a question: a cited answer, or no_answer.

- server `https://mcp.contextfile.ai` · MCP twin `wiki_ask` · scope `read:wiki`

### GET /v1/world/{artifact_id}

An artifact's neighborhood: dependencies, dependents, superseded versions, compatibility, conflicts, recalls, verifier history, trust, uplift and outcomes.

- server `https://mcp.contextfile.ai` · MCP twin `world_get` · scope `read:artifact` · query `as_of`

### GET /v1/world/{artifact_id}/impact

Who depends on an artifact, transitively, with buyer and watcher counts.

- server `https://mcp.contextfile.ai` · MCP twin `world_get` · scope `read:artifact`

### GET /v1/x402/orders/{order_id}

x402 (no account): a wallet buyer's order. Send the order_token from the paid POST /v1/orders in X-ContextFile-Order-Token. State, payment (payer, network, settlement tx), any refund owed or sent to the wallet, and the signed escrow.release receipt once the escrow released.

- server `https://mcp.contextfile.ai`

### GET /v1/x402/orders/{order_id}/download

x402 (no account): the artifact for a wallet buyer's held or settled order, the same answer artifacts_download gives (inline bytes or a signed URL, with artifact_digest and report_digest). Order token in X-ContextFile-Order-Token. A refunded order no longer downloads.

- server `https://mcp.contextfile.ai` · query `format`

## Error codes

Every error, on every route, is `{ code, message, remediation, retryable, docs_url }`. Codes are stable API; renaming one is a breaking change.

### requote_required

Remediation `requote`. Retryable: yes.

### insufficient_credits

Remediation `top_up`. Retryable: no.

### mandate_exceeded

Remediation `request_mandate_increase`. Retryable: no.

### mandate_revoked

Remediation `request_new_mandate`. Retryable: no.

### floor_not_met

Remediation `raise_floor_or_pick_another_listing`. Retryable: no.

### quota_exhausted

Remediation `wait_or_upgrade_tier`. Retryable: yes.

### judge_version_rejected

Remediation `relax_judge_filter`. Retryable: no.

### idempotency_conflict

Remediation `use_a_new_idempotency_key`. Retryable: no.

### not_found

Remediation `check_the_id`. Retryable: no.

### unauthorized

Remediation `authenticate`. Retryable: no.

### forbidden

Remediation `request_scope`. Retryable: no.

### rate_limited

Remediation `back_off_and_retry`. Retryable: yes.

### validation_failed

Remediation `fix_the_request_body`. Retryable: no.

### pending_approval

Remediation `await_principal_approval`. Retryable: no.

### unavailable

Remediation `retry_later`. Retryable: yes.

### model_key_required

Remediation `connect_model_key`. Retryable: no.

### person_only_action

Remediation `ask_the_person`. Retryable: no.

### conflict

Remediation `merge_and_save_with_latest_version`. Retryable: no.

Version 3, updated 2026-11-01.
