REST API
Every endpoint is served from https://api.falcata.io and goes through the same pipeline: resolve the bearer token, apply the per-caller limit, check API access, then run the handler. The same modules also produce the MCP tool list and the OpenAPI document, so REST, MCP and the reference describe one surface. This page covers what all endpoints have in common; the generated API reference lists each endpoint with its input and output schema.
Route families
| Family | Shape | Where it comes from |
|---|---|---|
| v1 resource routes | GET, POST, PUT, PATCH, DELETE on /api/v1/<domain>/..., for example /api/v1/me | Hand-written per domain. Live for a deprecation window. |
| v2 app operations | POST /api/v2/<app>/<read|write>/<operation> | Generated from each app's operation contracts. Nothing is hand-listed. |
| v2 platform capabilities | POST /api/v2/platform/<read|write|action|page>/<capability> | Generated from the platform capability catalogs, for every capability whose contract declares it exposed. |
On v2 the input is the JSON body, which must be a JSON object; an empty body counts as {}. A read operation is only reachable through the read path and a write only through write, so a write can never be called with read access. An unknown or unexposed operation answers 404.
A v1 module that already has a v2 successor is marked deprecated: its OpenAPI entries carry deprecated: true and its description says to move to the v2 route and the <app>_<operation> MCP tool. Prefer v2 wherever the reference offers both.
Paged platform reads (page) take the contract's input plus cursor (string or null) and limit. They answer a page object with page, isDone and continueCursor; send continueCursor back as cursor for the next page.
Authentication and access
Send a bearer token in the Authorization header:
Authorization: Bearer <token>
A personal access token or an OAuth access token resolves to the account that owns it. A Falcata ID session token is accepted only on routes that opt in to it. A missing or unrecognised token answers 401 with a WWW-Authenticate: Bearer realm="furnace", resource_metadata="..." challenge that points at the protected-resource metadata, so an OAuth-aware client can discover how to sign in.
Each route is either a read or a write. A token must be allowed that mode, and the person behind it needs the matching API access permission; otherwise the call answers 403. After that, the operation or capability runs its own permission check, and a token's scope can only narrow what its owner may do. See Permissions and From request to data for the full order of checks.
Generated platform capabilities act for a person, so they need a user-bound token.
Response envelope
A successful call answers JSON with the result under data:
{ "data": { "...": "..." } }
Some v1 list routes add a meta object beside data, for example { "total": 12, "hasMore": true } or { "nextCursor": "..." }. A create can answer 201 instead of 200. The reference gives the exact output schema per endpoint.
Errors
A failed call answers a non-2xx status with an error message, and on v2 and generated capability routes usually a machine-readable code:
{ "error": "This action is switched off right now.", "code": "capability_disabled" }
| Status | When |
|---|---|
400 | The input is invalid (code: "invalid_input" on v2 operations), the body is not a JSON object, or an operation reported a client-visible failure without its own status. |
401 | No bearer token, or one that does not resolve. |
403 | The token or its owner lacks API access, or a permission check refused the call. A permission refusal starts with Permission denied, or with Permission denied by token scope when the token's scope is what refused it. |
404 | The operation or capability does not exist or is not exposed, or a record the capability looked up was not found. |
409 | A conflict reported by the capability, or an idempotency conflict (below). |
429 | The caller is over its request limit. |
500 | An unexpected failure. The body is always { "error": "Internal error" }; details stay on the server. |
503 | The capability is switched off by an operator (code: "capability_disabled"). The switch only refuses; it never grants anything. |
An operation can also declare its own code and status for a failure it reports to callers; the reference and the operation's description name them. Error messages are redacted before they are sent.
Request limits
Each account has a request budget per kind of credential (tokens, sessions), and REST and MCP calls draw on the same one. Responses carry the budget as structured headers:
RateLimit: "api-caller";r=<remaining>
RateLimit-Policy: "api-caller";q=<quota>;w=<window seconds>;falcata-burst=<burst>
When the budget is spent the call answers 429 with { "error": "Rate limit exceeded" }, a Retry-After header in seconds, and the RateLimit header gains a t=<seconds> parameter. Wait that long before retrying. The values themselves are in the headers, not on this page.
Idempotency keys
Write routes accept an Idempotency-Key header so a retried write does not run twice. The key is a string of 1 to 256 characters, scoped to the caller and the route.
| Situation | Answer |
|---|---|
| First use of the key | The write runs. A 2xx answer is stored against the key; any other answer releases the key so you can retry. |
| Same key, same method, path, query and body, after it completed | The stored answer is replayed with Idempotency-Replayed: true. The write does not run again. |
| Same key while the first request is still running | 409, code: "idempotency_in_progress", Retry-After: 5. |
| Same key with a different request | 400, code: "idempotency_key_reuse". |
| Key empty or too long | 400, code: "idempotency_key_invalid". |
| Completed answer too large to store | 409, code: "idempotency_replay_unavailable". |
Read routes ignore the header.
CORS
Every API response allows any origin and the headers Authorization, Content-Type and Idempotency-Key, so a browser client can call the API directly with a token.
One contract, three doors
A user-facing action in Furnace is one capability or operation with one contract. Its contract declares whether REST and MCP serve it, with a description an agent can act on, or why it stays in the UI. The REST route, the MCP tool and the button in an app run the same validation, kill switch, permission check and audit, so the API never has a weaker path than the UI. See MCP for how tool names map to the same operations.