# Changelog

> Dated changes to the public API: new routes, scopes, error codes and behaviour, newest first.

Only changes visible to an API client are listed: routes, scopes, headers, error codes, limits and billing behaviour. Internal fixes and the desktop app's own release notes are not. Entries are grouped by day, newest first. The API is not versioned by date or header; additive changes ship continuously, and anything that could break a client is marked **Breaking** or **Behaviour change**.

## 2026-10-11

**Added: Reflex as code.** `GET /engine/flows/:id/export` returns a portable `subsidia.flow/v1` document (no workspace id, no secret, no `allowUnattendedOutbound`; connections by name). `POST /engine/flows/validate` checks a document or a graph without writing anything, and `POST /engine/flows/import` creates a **disabled** flow from it, with a fresh webhook secret returned once. `PUT /engine/flows/:id/graph` accepts `If-Match: <version>` (or `expectedVersion`) and answers `409 version_conflict` with `currentVersion` when the graph moved; the version is also sent as `ETag`. See [Reflex](https://dev.subsidia.protypa.fr/docs/reflex.md).

**Added: an MCP server.** `POST /mcp` (Streamable HTTP, stateless) exposes `subsidia_ask`, `cortex_search`, `subsidia_verify`, `poste_run`, `flow_list`, `flow_run`, `run_status` and `approvals_list` to Claude Code, Cursor, n8n and other MCP clients. Each tool checks its own key scope; no tool decides an approval. See [MCP](https://dev.subsidia.protypa.fr/docs/mcp.md).

**Added: an embeddable widget.** A public `pk_live_` identifier, allowed origins, a monthly ceiling and a per-IP rate limit let you put an agent chat or a contact form on a website without exposing a key. `GET/POST/PATCH/DELETE /engine/widgets` manage them. An agent widget requires an agent limited to chosen documents or dossiers. See [Widget](https://dev.subsidia.protypa.fr/docs/widget.md).

**Behaviour change: `/v1/postes` is under the `agents` key scope.** A key without that scope no longer reaches it.

**Behaviour change: `/engine/flows*` routes are typed in the spec.** They now appear in the OpenAPI spec and the SDK, and a wrongly typed body field is rejected with `400` instead of being coerced.

## 2026-10-09

**Added: the Vérificateur and the Registre over the API.**

- `POST /v1/verify` gives every claim of a text a verdict (verified, unsupported, contradicted, not checkable) against passages you send, typically what your own retrieval returned, or against Cortex collections. No model is called. The report is signed in the same hash chain as Gateway certificates. With passages you supply, the certificate commits to the whole pool and states that it does not attest where the passages came from.
- `GET /v1/verify` (paginated), `GET /v1/verify/:id`, `GET /v1/verify/:id/certificate`, `GET /v1/verify/:id/export` and `GET /v1/verify/usage`.
- `GET /v1/registre`, `GET /v1/registre/summary` and `GET /v1/registre/export` (signed archive). Same plan requirement as in the app: without the proof journal feature they answer `402 PLAN_UPGRADE_REQUIRED`.
- New key scope **`proof`** for these two families.

**Billing: controls.** A Vérificateur report is counted as a *control*, a unit separate from questions. A control consumes no question and is not stopped by a key's `monthlyQuestionLimit`. Controls are shown on integrator statements; no price is charged yet. See [Rate limits and quotas](https://dev.subsidia.protypa.fr/docs/rate-limits.md). Docs: [Le Vérificateur](https://dev.subsidia.protypa.fr/docs/verify.md), [Le Registre](https://dev.subsidia.protypa.fr/docs/registre.md).

## 2026-10-08

**Behaviour change: the documented surface is the infrastructure.** The developer portal, the SDK and the app now cover the engine only: Gateway, Cortex, agents, conversations, tools, webhooks, proof, Reflex, Light and the integrator space. The optional modules Life Copilot, SimEngine, Market Analysis and Risk Evaluator are no longer documented, and the SDK no longer has namespaces for them. Do not build new integrations on them.

**Fixed: security findings of the 08/10 audit.** Several routes were tightened following the audit, in line with the changes of 4 October below.

## 2026-10-06

**Added: `403 provider_unpaid`.** For client workspaces managed by an integrator: when the integrator's own invoice is overdue past the grace period, the keys of its clients stop with this code. The integrator's own keys keep working so it can pay, and nothing is deleted. See [Integrators](https://dev.subsidia.protypa.fr/docs/integrators.md).

## 2026-10-04

**Fixed: security hardening.** A server-side request forgery on a public route, unauthenticated routes and cross-tenant reads were closed. Webhook target URLs are validated when you create a webhook (`400` with the reason when a URL is not allowed). Changing the platform-wide AI model and PII mode is restricted to platform administrators.

## 2026-10-03

**Billing: model weights.** Questions are now weighted by the class of the model that answered: light models count 1x, standard 3x, advanced 6x, premium 12x, frontier 30x. The token counts in `usage` are unchanged. See [Rate limits and quotas](https://dev.subsidia.protypa.fr/docs/rate-limits.md).

## 2026-10-02

**Added: `403 client_suspended`.** An integrator can suspend a client workspace with one switch. Its keys are kept and work again when access is restored; no key is reissued.

**Added: budget alert.** An email is sent when a key approaches its monthly question ceiling (`monthlyQuestionLimit`).

**Added: API sandbox** for integrators, a ready-made environment to try the partner API and the new routes.

## 2026-09-27

**Added: Cortex write and original-document access** (the app's "open the original" and "ask me" loop) and **poste runs** through `POST /v1/postes/:key/run`. **Performance:** several scalability bottlenecks found in the 27/09 audit were fixed; no contract change.

## 2026-09-25

**Added: poste runs** through `POST /v1/postes/:key/run`, and Light provenance and proofs exposed to the engine. See [Postes](https://dev.subsidia.protypa.fr/docs/postes.md).

## 2026-09-20

**Added: API keys with real scopes.** Keys can be restricted to route families (`engine`, `knowledge`, `reflex`, `light`, `webhooks`, `partner`; `proof` followed on 9 October), made read-only with `readonly`, capped with `monthlyQuestionLimit` (questions per calendar month) and `ratePerMinute`, and given an expiry. New errors: `403 scope_denied`, `403 read_only_key`, `429 rate_limited` with `retry-after`, `402 API_KEY_BUDGET_EXCEEDED`.

**Compatibility:** a key that holds only the six legacy module scopes remains unrestricted, exactly as before. Restrictions apply as soon as a key carries a capability scope. See [Authentication](https://dev.subsidia.protypa.fr/docs/authentication.md).

**Added: partner program** for integrators: gated access, a partner API, client consent, resale. See [Partner API](https://dev.subsidia.protypa.fr/docs/partner.md).

## 2026-09-16

**Billing: customers buy questions.** Plans Essentiel, Pro and Cabinet per user, question packs and a 14-day trial replace token-based licences. One question is one answer up to 8 000 tokens. Quota errors carry a `code` (`QUESTION_LIMIT`, `SUBSCRIPTION_INACTIVE`, `PLAN_UPGRADE_REQUIRED`, `DOCUMENT_LIMIT`, `SEAT_LIMIT`). See [Rate limits and quotas](https://dev.subsidia.protypa.fr/docs/rate-limits.md) and [Errors](https://dev.subsidia.protypa.fr/docs/errors.md).

## 2026-07-26 and 2026-07-27

**Added: the Gateway.** `POST /v1/chat/completions` (OpenAI dialect) with a signed, hash-chained proof certificate per call, returned in the `x-pulse-proof` header; `GET /v1/proofs/:id`, `GET /v1/proofs/:id/verify` and `GET /v1/gateway/public-key`. The certificate is persisted before the response completes.

**Added: the Anthropic dialect.** `POST /v1/messages` and `POST /v1/messages/count_tokens`, so Claude Code can point at the Gateway. Agent-grade routing followed on 27 July: tool-using clients are routed to the full model. See [Gateway](https://dev.subsidia.protypa.fr/docs/gateway.md).
