HTTP API Overview
The WarmHub HTTP API exposes mounted endpoints for graph reads, action observability, callbacks, MCP HTTP transport, and SSE. Most endpoints return JSON; the synchronous export stream returns application/x-ndjson (see Response Format).
Graph data writes and management operations are not REST CRUD endpoints. Use the SDK, CLI, or MCP tools for those workflows.
WarmHub does not currently publish an OpenAPI specification. For exact request and response shapes, see the documentation in this section or the SDK reference.
A minimal request
Section titled “A minimal request”The most common HTTP task is reading a graph’s current state — its HEAD. This is a GET, so it is safe to retry; reads on a public graph also work without a token.
curl -H "Authorization: Bearer <token>" \ "https://api.warmhub.ai/api/graphs/warmhub-data/us.congress.trades/head?shape=CongressTrade&kind=thing&limit=1"{ "items": [ { "wref": "20034954/bd598743649e738e-2", "name": "20034954/bd598743649e738e-2", "kind": "thing", "active": true, "version": 1, "data": { "ticker": "CSCO", "amount_range": "$1,001 - $15,000", "transaction_type": "sale_partial" } } ], "nextCursor": "whc1_eyJ2Ijox..."}The rest of this page covers the base URL, auth, formats, and retries that apply across endpoints; the routing table points to each endpoint family.
Base URL
Section titled “Base URL”Most REST endpoints use the /api prefix:
https://api.warmhub.ai/api/The SSE transport is root-mounted, using the origin without /api:
https://api.warmhub.ai/sseThe MCP server has its own hostname — see MCP Server:
https://mcp.warmhub.ai/mcpFor example, the graph HEAD endpoint is:
https://api.warmhub.ai/api/graphs/acme/world/headThe /api/repos/ prefix, from when a graph was called a repo, is retired: until 2026-12-15 it is served exactly like /api/graphs/ and answers with a Sunset header. Use /api/graphs/.
Authentication
Section titled “Authentication”Authenticated endpoints require an Authorization header with a Bearer token:
curl -H "Authorization: Bearer <token>" \ https://api.warmhub.ai/api/graphs/acme/world/headGraph data read endpoints (/head, /about/:wref, /query) on public graphs can be read anonymously; the same endpoints on private graphs require authentication. Action-observability endpoints (/api/graphs/:orgName/:graphName/actions/*) always require authentication regardless of graph visibility.
The export endpoint (GET /api/graphs/:orgName/:graphName/export) always requires authentication regardless of graph visibility. The token must carry both repo:read and repo:checkpoint-read scopes, and repo:read must have a whole-graph selection (not narrowed to particular names or Shapes). A token with only repo:checkpoint-read, or with repo:read over a narrower selection, will receive a 403.
For POST /mcp, the server accepts two tiers of access and its behavior differs by protocol era:
- Legacy path — anonymous callers (no token) can reach
initialize,tools/list,ping, and a subset oftools/callrequests that don’t require a verified identity. - Modern
2026-07-28path — anonymous callers can reachserver/discover,tools/list, and a subset oftools/callrequests.pingis not handled on this path and returns a-32601error with HTTP 404.
On both paths, callers with a valid bearer token can reach the full set of tool calls. A presented bearer token that is invalid — expired, revoked, forged, malformed, or associated with a disabled account — is rejected before handler dispatch and returns a 401 challenge marked invalid_token. Only an absent bearer falls through to anonymous-tier access; a bad token does not degrade to anonymous and will not reach any handler, including anonymous-tier methods such as initialize. Tool calls that require a verified identity return a 401 challenge before dispatch if no valid token is present. For a full explanation of which tool calls fall into each tier and how clients discover the requirement, see the MCP server documentation.
PAT management REST endpoints are not currently mounted. Create and manage PATs with the CLI (wh token) or the SDK (client.token.*); see Authentication.
Request Format
Section titled “Request Format”- Content-Type:
application/jsonfor JSON request bodies - Path parameters: URL-encoded (for example,
20034954%2Fbd598743649e738e-2for the Thing name20034954/bd598743649e738e-2) - Query parameters: Standard URL query string format
Response Format
Section titled “Response Format”Graph read and action observability endpoints return JSON on success. The /sse endpoint streams text/event-stream, and MCP endpoints follow JSON-RPC over HTTP.
Export endpoint exception: GET /api/graphs/:orgName/:graphName/export does not follow the JSON-only pattern. When the export is ready and streamed synchronously (no token), the response body is application/x-ndjson. When a previously minted export token is redeemed and the export has completed, the response is 200 JSON with metadata — { url, expiresAt, atGraphSeq, recordCount, contentSha256 } — containing a signed URL the client fetches separately to retrieve the export bytes. An async export mint or an in-progress token redemption returns 202 with a JSON body. Raw HTTP callers building against the graph read surface must not assume a uniform content type across all export response paths.
Export errors usually use a different envelope. Errors from the export endpoint — on the synchronous stream and the async paths alike — return a flat { "code", "message" } JSON body with kebab-case codes (for example, { "code": "rate-limited", "message": "..." }) instead of the standard { "error": { ... } } shape. The exception is the per-IP cap on unauthenticated requests, which covers /export like every other endpoint: a request whose token is missing or cannot be verified counts against that cap, and a 429 from it uses the standard envelope (error.code RATE_LIMITED). Export clients should accept both shapes.
Most REST errors use this envelope:
{ "error": { "code": "NOT_FOUND", "message": "Thing not found: temp-1" }}Three error codes carry an additional machine-readable error.details arm that callers can branch on:
VALIDATION_ERROR — emitted for request validation failures. error.details contains structured field-level validation issues. The top-level error.message reflects the first validation issue encountered (for example, "Expected number, received string"), so callers should not match on a fixed message literal; branch on error.code instead.
{ "error": { "code": "VALIDATION_ERROR", "message": "Expected number, received string", "details": { "reason": "validation_failed", "issues": [ { "path": "limit", "message": "Expected number, received string" } ] } }}issues[].path is a dotted string (e.g. "limit" or "body.name") identifying the field that failed validation.
RATE_LIMITED — error.details contains structured retry metadata. Callers should also inspect the Retry-After response header (see Idempotency and retries). Note: when the export endpoint itself turns an export away with rate-limited — for example, because another export is already streaming for the organization — the body uses the flat export shape instead; see the export-errors note above.
{ "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded", "retryAfter": 4, "details": { "reason": "rate_limit_reset", "retryAfterSeconds": 4, "resetAt": "2024-06-01T00:00:04Z" } }}The top-level error.retryAfter field (in seconds) is the stable field to read for retry timing on standard REST endpoints; error.details carries the same value alongside reason and resetAt for callers that need the structured form. The export endpoint’s own rate-limited error is an exception — its body is the flat { "code", "message" } shape, so read retry timing from the Retry-After response header.
UNAUTHENTICATED (presented-but-invalid bearer) — when a bearer token is present but cannot be verified (expired, revoked, forged, malformed, or associated with a disabled account), the response is 401 UNAUTHENTICATED and error.details carries a stable reason discriminator callers can branch on:
{ "error": { "code": "UNAUTHENTICATED", "message": "Invalid token", "details": { "reason": "invalid_token" } }}Branch on error.details.reason === "invalid_token" to distinguish a bad credential from other UNAUTHENTICATED responses (such as a missing token on a protected endpoint). Do not match on error.message, which is not a stable contract.
Thing names are unique per graph, whatever Shapes a Thing declares. A write that claims a name another active Thing already holds is refused with 409 CONFLICT when the two share a declared Shape (or neither declares any), and with 409 NAME_TAKEN when their declared Shapes are disjoint or you cannot read the holder. A rename onto a name that an earlier rename in the same commit already claimed also gets 409 NAME_TAKEN. Handle both codes as a name collision. The NAME_TAKEN refusal is terminal, so retrying the same name cannot succeed. error.details carries { "reason": "name_taken", "name", "takenBy": { "durableId" } }. The message names no Shape and the refusal offers no replacement name. Guard the optional member before reading it: takenBy is conditional and may be withheld, while reason and name are present whenever details is — and in rare cases details is omitted altogether. To learn the holder’s Shapes, get the durableId: a Thing can have several Shapes or none.
Other error codes may also populate error.details when the domain error carries structured context; treat it as an optional, code-specific extension. When error.details is absent, the code and message fields are sufficient for error handling.
| HTTP Status | Common Error Codes |
|---|---|
400 | VALIDATION_ERROR, SHAPE_MISMATCH, RESERVED_NAME, ILLEGAL_OP_SEQUENCE |
401 | UNAUTHENTICATED |
403 | FORBIDDEN |
404 | NOT_FOUND |
409 | CONFLICT, NAME_TAKEN, ARCHIVED |
412 | CLIENT_INCOMPATIBLE, PRECONDITION_FAILED |
413 | PAYLOAD_TOO_LARGE |
429 | RATE_LIMITED |
500 | INTERNAL_ERROR |
SDK callers receive these as WarmHubError.code / kind. See the ErrorKind reference for retryability and corrective actions per kind.
Graph read endpoints (/head, /about/:wref, /query) collapse missing-graph and unauthorized-private-graph cases into the same 404 so graph existence stays opaque. Action observability endpoints also collapse anonymous, under-scoped, and missing-graph deny paths to opaque 404 responses. See Queries and Actions for the full deny-path behavior.
Early /sse failures use the same standard envelope as other REST errors. A missing ticket parameter returns 400 VALIDATION_ERROR; an invalid ticket returns 401 UNAUTHENTICATED. Both follow the { "error": { "code": "...", "message": "..." } } shape shown above.
When standard REST endpoints return 429 RATE_LIMITED, they may include a Retry-After response header. Clients should back off until that interval has elapsed. (The export endpoint’s own rate-limited error also sets Retry-After, but its body is the flat { "code", "message" } shape — see the export-errors note above.)
A 412 means one of two things, and error.code tells you which:
CLIENT_INCOMPATIBLE— your client was not accepted. Upgrade it.- SDK and CLI. They identify themselves for you, and the server checks their version before a write, so an out-of-date client fails here rather than mid-write. An out-of-date client can still sign in, preview a commit before submitting it, and open a live stream to read.
- Raw HTTP callers. Only some endpoints check the client: write calls made through the same API the SDK uses, the component registry’s
setup-callandcli/:methodroutes (notresolve), and streaming submissions. On those, sendX-WarmHub-Client: <client-name>/<version>, for examplewarmhub-cli/1.4.2. Other endpoints, such as action callbacks, and the MCP server don’t check it. Sending the header is not authorization and does not make an unsupported client safe, so prefer a released WarmHub client over hand-rolling it. - Why a header is refused. It is missing or malformed, names a client family the server does not recognize, or carries a version that is not valid SemVer or is below that family’s floor.
PRECONDITION_FAILED— a component’s credentials are not usable, so the problem is that component’s configuration rather than your request. Credentials can be missing, unreachable from the install’s graph, or carry no auth scheme the caller supports. See the credentials and cli sections of the manifest reference.
A 413 PAYLOAD_TOO_LARGE is returned when a request body exceeds the endpoint’s size limit, or when a write operation exceeds semantic size limits — for example, a collection add or revise that would push membership past 10,000 members, or shaped write data that exceeds 10,000 wref occurrences. Raw HTTP callers can receive 413 from either transport-level or domain-level validation.
SSE stream contract
Section titled “SSE stream contract”The /sse endpoint streams text/event-stream and delivers live invalidation signals to connected callers. Raw HTTP callers building against this surface need to understand the event sequence, ticket lifetime, and filtering rules.
Connecting. A caller opens the stream by supplying a short-lived ticket as a query parameter:
GET https://api.warmhub.ai/sse?ticket=<ticket>The ticket is signed by WarmHub and names one graph and the part of it the issuing token can read. There is no REST route for minting one: the TypeScript SDK’s live methods mint a ticket for each connection and renew it for you, so use them unless you need to read the stream yourself.
Event sequence. Once the connection is established, the server emits events in this order:
- A
readyevent — signals that the stream is open and the caller can begin treating subsequent events as live. No payload action is required; its presence confirms the connection succeeded. invalidateevents — each one signals that something the caller can read has changed and their local view should be refreshed.
Ticket expiry and stream lifetime. Tickets are valid for 5 minutes from issuance. The server closes the stream when the ticket reaches its expiry (exp). Callers should obtain a fresh ticket and reconnect before that point if they need continuous coverage.
Invalidation filtering. The server filters each invalidate event to the readable slice encoded in the ticket:
- A write that changes nothing within the caller’s readable slice produces no
invalidateevent — the stream stays silent for that write. - Changes that create no new Thing version, such as a rename, and action status updates still emit an
invalidateevent, because they don’t name a Thing the filter can check.
This means a connected caller only receives signals for changes that are relevant to what they can read. Absence of an event is not evidence that nothing changed in the graph — only that nothing changed within the caller’s slice.
Compatibility response headers
Section titled “Compatibility response headers”Raw HTTP callers that identify themselves can receive advisory compatibility headers on any response, not only on 412 errors:
X-WarmHub-Client-Minimum— present when the version in yourX-WarmHub-Clientheader is below the server’s floor for that first-party client family (development versions never receive it). The value is the minimum supported version (for example,0.142.0for the CLI). Reads still succeed, but writes from a client below the floor are already refused with412 CLIENT_INCOMPATIBLEunless the server honors acompatibility-overrideflag, so upgrade.X-WarmHub-Client-Flags-Honored— present whenever your request declared flags inX-WarmHub-Client-Flags, independent ofX-WarmHub-Client. The value is the sorted, comma-separated subset of your declared flags that this backend honored; an empty value means none were honored. It never lists flags you did not send.
The TypeScript SDK and the CLI read these headers automatically; the Python SDK does not.
Server-Timing
Section titled “Server-Timing”To see how long the server spent handling a request, send x-warmhub-server-timing: 1 with it. The header is on the CORS allowlist, so browser clients can send it too.
When you send the header, what comes back depends on how you called:
| Caller | Response |
|---|---|
| Anonymous (no token) | No Server-Timing header |
| Authenticated | Server-Timing with a total entry: end-to-end handling time in milliseconds |
Example response header:
Server-Timing: total;dur=42.3Durations carry one decimal place. Parse the header by entry name rather than position: WarmHub may add diagnostic entries to it for its own troubleshooting.
Idempotency and retries
Section titled “Idempotency and retries”GET endpoints — graph reads and action observability — are idempotent. Retrying one returns the same result with no side effects, so they are always safe to retry after a network error.
When a request returns 429 RATE_LIMITED, the response may carry a Retry-After header. On standard REST endpoints, the same value is mirrored in the body as error.retryAfter (in seconds). Back off until that interval has elapsed before retrying.
The action callback endpoint, POST /api/action-runs/:runId/callback, is safe to retry with the same status: re-reporting a status the run has already reached succeeds without repeating side effects such as notifications. Reporting a status that conflicts with the run’s current state returns 409 CONFLICT. A retry_requested status is the exception — it is a command, not a report, so each accepted one queues a new delivery attempt and it is rejected once the run’s attempts are exhausted.
WarmHub does not accept an inbound Idempotency-Key header. For action delivery, WarmHub sends your webhook handler an X-WarmHub-Idempotency-Key header so the handler can recognize and discard duplicate deliveries.
Pagination
Section titled “Pagination”Pagination behavior differs by endpoint family:
- Graph query endpoints (
/head,/about/:wref,/query) — acceptlimitandcursor; return anextCursorfield when more pages are available. PassnextCursorascursoron the next request. - Export endpoint (
/export) — does not usecursor/nextCursor. Resume an interrupted stream usingafterDurableIdcombined with the pinnedatGraphSeqand the requiredformatVersion. See Graph export for the full export pagination details. - Action runs (
GET /api/graphs/:orgName/:graphName/actions/runs) — acceptlimit,since, andcursor;sinceandcursorare mutually exclusive and cannot be combined in the same request. Returns anextCursorfield when more pages are available. - Action notifications (
GET /api/graphs/:orgName/:graphName/actions/notifications) — acceptlimitandsinceonly; returns a plain array with no cursor-based pagination.
See Actions for the per-endpoint details.
| Parameter | Description |
|---|---|
limit | Maximum number of items to return per page. |
cursor | Opaque pagination token from a previous response’s nextCursor field. Supported on graph query endpoints and the action runs endpoint. Cannot be combined with since on the action runs endpoint. |
since | Filter action records after this epoch-milliseconds timestamp. Cannot be combined with cursor on the action runs endpoint. |
afterDurableId | Resume an export stream after the last successfully received record. Must be combined with atGraphSeq and formatVersion. Supported on the export endpoint only. |
afterVersion | With afterDurableId, when the last received record was a Shape version: resume with that Shape’s later versions. Supported on the export endpoint only. |
atGraphSeq | Pins the export to a specific graph sequence, ensuring a consistent snapshot across resumed requests. Required when afterDurableId is present. Supported on the export endpoint only. |
formatVersion | Specifies the export format version. Required on every request that includes afterDurableId; the server rejects resume requests without it. Supported on the export endpoint only. |
Endpoint reference
Section titled “Endpoint reference”| Need | Page |
|---|---|
| The complete map of mounted endpoints + per-endpoint auth | Endpoints |
| Authenticate requests and manage tokens | Authentication |
| Read graph data (HEAD, about, query, export) | Queries |
| Action observability and the callback endpoint | Actions |
| Rate limits and backoff behavior | Rate Limiting |
Endpoints is the complete map — including the surfaces handled through the SDK, CLI, and MCP rather than REST.