{"openapi":"3.1.0","info":{"title":"Prudai Developer API","version":"0.1.0-draft","summary":"OpenAI-compatible legal AI and licence-filtered legal sources.","description":"The Prudai Developer API gives your application the same legal AI that powers LEO, with\nserver-side research over Prudai's sources, verified citations and per-request cost in\ncredits.\n\n* **OpenAI-compatible.** `POST /chat/completions` and `GET /models` follow the OpenAI Chat\n  Completions shape, so the official OpenAI SDKs work with `base_url` set to\n  `https://api.prudai.com/v1`. Prudai-specific request options go in a `prudai` object\n  (`extra_body` in the SDKs); Prudai-specific results come back in a `prudai` object.\n* **The model is the product.** `model` is a Prudai product (`leo`, `leo-fiscaal`, `zia`,\n  `vera`, `bever`), optionally with a specialisation (`leo/arbeidsrecht`). Provider model\n  names never appear on the wire.\n* **Tools run on our side.** Research tools run server-side inside the Prudai harness.\n  Client-side function calling (`tools`) is not supported and returns `400`.\n* **Credits.** 1 credit = EUR 0.01. Every metered response (chat, sources search/fetch/answer,\n  citation check) reports `prudai.cost_credits` (0 for free operations) and\n  `prudai.price_list_version`. Free operations never return `402`.\n  Balance and ledger are readable through `/credits/*`.\n* **Sources (phase 1, planned; the first release).** `/sources/*` and `/citations/verify`\n  return Dutch open legal information: catalogue, search with verified passages, full text\n  where the licence permits redistribution, and citation checks. **Free at launch** (authentication\n  is still required; fair-use limits apply). A small per-request fee may follow later and\n  is announced in advance. `POST /sources/answer` (phase 2) adds short sourced answers and\n  is priced per request. The same sources tools are available over MCP (`/mcp`) from\n  phase 1, with a service key, personal token or an OAuth login.\n\n`/v1` is additive: Prudai's existing app API is not changed by it.\n\n## Environments\n\n| Key prefix | Server | Data |\n|---|---|---|\n| `prudai_sk_live_` | `https://api.prudai.com/v1` | production |\n| `prudai_sk_test_` | `https://api.staging.prudai.com/v1` | staging, synthetic data |\n\nA live key is rejected by staging and a test key by production (`401 key_environment_mismatch`).\n\n## Reserved paths (no operations yet)\n\n`/v1/agents` is reserved for a later phase. Workflows and runs are available through\n`/v1/workflows` and `/v1/workflow-runs` with the signed-in user's existing app rights.\n\n## MCP endpoint (phase 1 for public sources, planned)\n\n`https://api.prudai.com/v1/mcp` serves the sources product over the MCP Streamable HTTP\ntransport with the same rights, limits and prices as REST. It exposes only the dynamic\nmeta-tools `list_tools` / `search_tools`, `describe_tool` and `execute_tool`. Discovery\ndefaults to task tools: \"bron zoeken\", \"citaat controleren\", \"brondocument ophalen\"\n(phase 1), and \"bronantwoord\" (phase 2); each may combine multiple REST calls. Fine-grained\noperations are discovered on request or through `next`. Inputs, approval policy and DFA\ntransitions are generated from the same public spec and approval-policy file as CLI and\ndocs. `next` contains ready-made transitions; no internal tool registry is published.\n\nAuthenticate with a service key (`Authorization: Bearer prudai_sk_…`), a personal token\n(`prudai_pat_…`), or an **OAuth 2.1\nlogin** with a Prudai account through login.prudai.com, following the MCP authorization\nspecification (the login flow that MCP clients with OAuth support use). With OAuth the\norganisation comes from the logged-in account; usage and fair-use limits are counted per\nuser and organisation.\n\nThe phase-1 MCP serves **public sources only**: no organisation data, no knowledge bases. MCP\naccess to organisation data comes later and only after the external pentest and a database\nrole with row-level security. The endpoint does not expose Prudai's internal tool registry,\ntool documentation, prompts or skills. The MCP JSON-RPC surface is specified by the MCP\nspecification and is therefore not modelled as operations in this document.\n\n## Conventions\n\n* Every response carries `X-Request-Id`. Quote it when you contact support.\n* Idempotency replay is supported only where the operation explicitly declares an `Idempotency-Key` header.\n* All non-OpenAI JSON responses, including errors, use the six-field task envelope\n  `{data, context, completeness, notIncluded, provenance, next}`. Domain payloads are in\n  `data`; search/answer routing is in `context.routing`; follow-up calls are in `next`.\n  `completeness.total` is the exact total or null when unknown (never an estimate),\n  `returned` counts returned items and `truncated` signals incomplete results. Source\n  coverage gaps are explicit in `notIncluded`. Errors have `data: null` and `context.error`.\n* Exception: `/openapi.json` returns the OpenAPI document directly. `/chat/completions`, `/models` and `/models/{model}` keep their OpenAI\n  response/error shapes and existing `prudai` extensions because wrapping them breaks\n  OpenAI SDKs. SSE framing is unchanged.\n* Scopes use `<product>:<object>:<verb>`, replacing\n  the old `object:verb` rule for the central token service. A required scope matches\n  `^(?:[a-z][a-z0-9-]*:[a-z][a-z0-9_]*:(?:read|write|delete)|prudai:capabilities:request)$`. The verb is the HITL class:\n  `read` changes no shared product object and runs without a human (also POST search,\n  verify and answer generation); `write` follows the effect: reversible writing in the person's own\n  workspace runs directly (`none`), writing to what the organisation shares, outside the organisation,\n  money and rights waits for a human (`confirm` or stricter); `delete` always waits (`review` or stricter).\n  Each operation's `x-prudai-approval` states it, enforced by the coverage test.\n  The optional `prudai:chat:write` right is an explicit exception: the completion itself\n  remains ungated, and its tools apply the same per-action approval policy as the app.\n  `prudai:capabilities:request` records a human-reviewed activation request, never grants\n  entitlements and requires an exact grant (no request wildcard).\n  Developer API scopes use `prudai:`; organisation, usage and credits use `account:`. The\n  `irma` and `ordo` namespaces are reserved with no available scopes. Phase 1 issues\n  only the sources and observability scopes; other scopes return `422 scope_not_available`.\n  A grant may use `*` on the object position only (`prudai:*:read`): it is stored as\n  written and covers, per call, every issuable scope with that product and verb except\n  objects marked `explicit_only` in `x-prudai-scope-objects` (licensed full text and\n  credit-spending computation). The\n  generated scope catalogue is `scope-catalog.generated.json`. Bundles\n  expand at issue time; a personal token has exactly its user's current app rights and\n  organisation read scope, never independent service privileges. Bearer alternatives are\n  ORed; `x-prudai-scopes` specifies the required service-key scope.\n* Device login for `@prudai/cli` (binary `prudai`): `prudai auth login` obtains a single-use\n  device code (`ABCD-EFGH`, no 0/O/1/I) and app approval URL. Approval binds a `prudai_pat_…`\n  token to the approving user and chosen organisation, stores only its hash, defaults to\n  90 days, and permits listing, renaming and revoking in Personal tokens. `auth status`\n  checks it; `auth logout` revokes it server-side. Rate-limit code guesses, protect approval\n  with CSRF, print URL/code for SSH/WSL, and never put tokens in URLs or logs. The public\n  device routes `POST /auth/device` and `POST /auth/device/token` use RFC 8628 response shapes\n  (not the task envelope, like chat completions) and need no credential\n  (`x-prudai-auth: none`, `x-prudai-scopes: []`); `POST /auth/session/revoke` is the logout.\n  Approval and token management run in account.prudai.com, not in this API.\n* Sources are read-only: POST search/verify/answer computes results without mutating source\n  objects. Every operation declares an explicit `x-prudai-approval` level. Future workflow/agent\n  writes use `none`, `instruct`, `confirm`, `review`, `forbidden_for_agents` in one central\n  policy; defaults GET none, POST/PUT/PATCH confirm, DELETE review. Missing write levels\n  fail the coverage test. Gated calls without a grant return 202 ApprovalRequest and run\n  only the approved argsHash; every write records actor_type and grant in the audit trail.\n* Static HTML docs are generated from this spec at\n  `https://docs.prudai.com/developer-api/api`, with per-resource SEO, Markdown negotiation\n  (`Accept: text/markdown`), llms.txt and a CI stale check; no embedded Swagger viewer.\n* Timestamps are Unix seconds (`created`) or RFC 3339 UTC strings (`*_at`). Dates are UTC.\n* Credit amounts are decimal numbers with at most three decimals (0.001 credit = EUR 0.00001).\n* Request bodies are strict: unknown fields return `400`. Response objects may gain new\n  fields and enums may gain new values at any time; clients must ignore what they do not know.\n* Every successful response carries `X-Request-Id` and the `RateLimit-*` headers of the\n  tightest window that applies.\n","contact":{"name":"Prudai support","url":"https://support.prudai.com"},"license":{"name":"Proprietary — use subject to the Prudai API terms (draft, pending legal review)","identifier":"LicenseRef-Prudai-API-Terms"},"x-prudai-contract-status":"draft","x-prudai-generated-from":"hand-written (phase 0); route manifest audience 'public' from phase 1"},"x-prudai-scope-objects":{"prudai:voice_memos":{"description":"Own audio recordings, their transcription and assignment within the person's current rights. Personal credentials only; service keys never receive these scopes.","label_nl":"Spraakmemo's"},"prudai:link_targets":{"description":"Search writable LEO projects, ORDO dossier projects and delegated CATO records within the person's rights.","label_nl":"Koppeldoelen"},"prudai:form_profile":{"description":"Form details for filling in forms (Zammad 59095) - the organisation's company data (KvK, VAT, address) and the person's own personal details. Personal fields are visible only to that person unless they share them with colleagues. Personal credentials only; service keys never receive these scopes.","label_nl":"Invulgegevens"},"prudai:push_devices":{"description":"The person's own phones and browsers that receive push notifications (metadata only, never customer content). Personal credentials only; service keys never receive these scopes.","label_nl":"Pushtoestellen"},"prudai:skills":{"description":"Product- and organisation-filtered Prudai skill descriptions and instructions.","label_nl":"Vaardigheden"},"prudai:capabilities":{"description":"Features and existing app settings available to the caller. write changes permitted settings; request records a human-reviewed plan request without granting entitlements. Personal credentials only for write and request.","label_nl":"Functies"},"prudai:integrations":{"description":"Integration availability, current connection status and consent guidance.","label_nl":"Koppelingen"},"prudai:models":{"description":"Models available to the organisation.","label_nl":"Modellen"},"prudai:chat":{"description":"OpenAI-compatible chat completions. Spends credits; never covered by a wildcard.","label_nl":"Chat","explicit_only":true},"prudai:chat_zia":{"description":"Chat with ZIA. Requires an explicit scope and organisation entitlement.","label_nl":"Chat met ZIA","explicit_only":true},"prudai:chat_maia":{"description":"Chat with MAIA. Requires an explicit scope and organisation entitlement.","label_nl":"Chat met MAIA","explicit_only":true},"prudai:conversations":{"description":"API-created conversations. Requires an explicit scope; never covered by a wildcard.","label_nl":"Gesprekken","explicit_only":true},"prudai:sources":{"description":"Source catalogue, search and document metadata.","label_nl":"Bronnen"},"prudai:source_texts":{"description":"Licensed full text of source documents. Never covered by a wildcard.","label_nl":"Volledige brontekst","explicit_only":true},"prudai:citations":{"description":"Citation verification against sources.","label_nl":"Citaten"},"prudai:source_answers":{"description":"Answers generated from sources. Spends credits; never covered by a wildcard.","label_nl":"Bronantwoorden","explicit_only":true},"prudai:archive_sources":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Linked archive libraries and items; delegated Keycloak users only, with current knowledge base and Microsoft access.","label_nl":"Gekoppeld archief"},"prudai:word_import":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Import Word into a new editable concept; personal tokens with a writing role only.","label_nl":"Word importeren"},"prudai:register_links":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Linked external registers; personal identities only, with knowledge base and delegated source access checked for each call.","label_nl":"Registerkoppelingen"},"prudai:artifacts":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Document and workbook artifacts; personal tokens only, with the same source access and editing locks as the app.","label_nl":"Documenten en werkboeken"},"prudai:modules":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Private and published office modules and app availability; personal tokens only, following the existing app access and approval rules.","label_nl":"Kantoormodules","explicit_only":true},"prudai:workflows":{"description":"Workflow definitions and curated templates; personal tokens only, with the app workflow capability. Delete is reserved until soft delete exists.","label_nl":"Workflows"},"prudai:workflow_runs":{"description":"Workflow runs, human gates and deliverables; personal tokens only. Starting or continuing a run spends credits.","label_nl":"Workflowuitvoeringen","explicit_only":true},"prudai:org_skills":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Organisation procedures; explicit published reads and personal Owner/Admin management writes.","label_nl":"Kantoorwerkwijzen","explicit_only":true},"prudai:exact_settlements":{"description":"Afletter-voorstellen (Exact Online, MAIA) of the own organisation; offering a specification and deciding (approve, reject, send again). Personal tokens only; never issuable to a service key.","label_nl":"Afletteren"},"prudai:integration_administrations":{"description":"Administrations of the bookkeeping koppelingen (Moneybird, Exact Online) of the own organisation in MAIA; read for every member, link/unlink/add/remove for an owner or admin with approval. Personal tokens only; never issuable to a service key.","label_nl":"Administraties van koppelingen","explicit_only":true},"prudai:exact_connection":{"description":"The Exact Online connection (MAIA) of the own organisation; connect, invite the person with the Exact login, choose the administrations, disconnect. Read-only towards Exact. Personal tokens only; never issuable to a service key; writing and disconnecting need an owner or admin.","label_nl":"Exact-koppeling"},"prudai:twaka":{"description":"Twaka (u-logi) data of the own organisation in MAIA, read only from the nightly replica (invoices, payment matching, relations, orders, revenue, batch tracing). Personal tokens only; never issuable to a service key.","label_nl":"Twaka"},"prudai:anonymization":{"description":"Mask personal data in a file or text the caller sends (nothing stored). Personal tokens only; never issuable to a service key.","label_nl":"Anonimiseren"},"prudai:feed":{"description":"Read the LEO news feed of the token user (as in the app). Personal tokens only; never issuable to a service key.","label_nl":"Nieuwsfeed"},"prudai:secure_shares":{"description":"The token user's own Veilig delen links (list, create with review, revoke). Personal tokens only; never issuable to a service key.","label_nl":"Veilig delen"},"prudai:projects":{"description":"LEO projects (dossiers) of the token user and their documents (upload, text, original, delete). Personal tokens only; never issuable to a service key.","label_nl":"Dossiers"},"account:organizations":{"description":"The organisation and credential the call runs as.","label_nl":"Organisatie"},"account:usage":{"description":"Usage and rate-limit figures of the organisation.","label_nl":"Gebruik"},"account:credits":{"description":"Credit balance and credit ledger.","label_nl":"Credits"},"prudai:tables":{"requiresFlag":"ARTIFACT_ENGINE_ENABLED","description":"Organisation register tables and records, SQL queries, import and export. Writes require an active writing member; schema changes require Owner or Admin.","label_nl":"Registers"},"prudai:knowledge_bases":{"description":"Knowledge bases of the organisation and their documents; read includes retrieval queries.","label_nl":"Kennisbanken"},"prudai:knowledge_base_answers":{"description":"Answers generated from a knowledge base. Spends credits; never covered by a wildcard.","label_nl":"Kennisbankantwoorden","explicit_only":true},"account:api_keys":{"description":"Service keys of the organisation. write = mint (attenuated) and rotate, delete = revoke with descendants. Opt-in, never in a bundle or wildcard.","label_nl":"API-sleutels","explicit_only":true},"account:members":{"description":"Members of the organisation (list, switch off or on, file a removal request). Personal tokens of an owner only; never issuable to a service key; writes wait for a different owner.","label_nl":"Leden","explicit_only":true},"account:approvals":{"description":"Read all approval requests in the organisation. Own requests remain accessible with account:organizations:read.","label_nl":"Goedkeuringen"}},"x-prudai-scope-bundles":{"discovery_read":["prudai:skills:read","prudai:capabilities:read","prudai:integrations:read"],"sources_read":["prudai:sources:read","prudai:source_texts:read","prudai:citations:read"],"observability_read":["account:organizations:read","account:usage:read","account:credits:read","account:approvals:read"],"chat":["prudai:models:read","prudai:chat:read"],"conversations":["prudai:conversations:read","prudai:conversations:write","prudai:conversations:delete"],"source_answer":["prudai:sources:read","prudai:source_texts:read","prudai:citations:read","prudai:source_answers:read"]},"servers":[{"url":"https://api.prudai.com/v1","description":"Production. Accepts live service keys and production personal tokens."},{"url":"https://api.staging.prudai.com/v1","description":"Staging (synthetic data). Accepts test service keys and staging personal tokens."}],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"tags":[{"name":"Discovery","description":"Public contract and scope metadata for CLI clients and the spec registry."},{"name":"Docs","description":"Search and read the Prudai product documentation (docs.prudai.com) on the same hybrid index the chat\nassistants and the support assistant use: heading-level sections, keyword search with Dutch and English\nstemming and synonyms, plus meaning search across languages, fused by rank. `visibility` defaults to\n`public`; `gated` adds the pages behind the docs single sign-on, `staff` is for Prudai staff only.\n"},{"name":"Models","description":"Phase 2 (planned). The Prudai products (and specialisations) your key may use as `model`."},{"name":"Chat","description":"Phase 2 (planned). OpenAI-compatible chat completions, streaming and non-streaming."},{"name":"Usage","description":"Aggregated usage of your organisation's keys."},{"name":"Credits","description":"Read-only credit balance and ledger. Top-ups and grants are managed in the account dashboard."},{"name":"Account","description":"Phase 1 (planned). The calling principal and limit status; free, service keys require account:organizations:read."},{"name":"Auth","description":"Phase 1. Device login for the `prudai` CLI (RFC 8628) and logout of a personal token.\nThe two device routes are a documented exception to the task envelope: standard OAuth\ndevice-flow clients read their RFC 8628 shapes.\n"},{"name":"Exact connection","description":"Exact Online zelf koppelen in MAIA: connect the organisation's Exact Online (a person logs in at Exact), or mail a\nsingle-use invite to the person who holds the Exact login; then choose which administrations count. Stored in\nPrudai, no restart. Disconnecting wipes the tokens and keeps the choice and the data already fetched. Read-only\ntowards Exact.\n"},{"name":"Twaka","description":"Twaka (u-logi) in MAIA, read only: invoices, payment-to-invoice matching, relations and contact persons, orders and\ntheir status, revenue per customer/article/group and batch tracing. From the nightly replica of the organisation's\nown Twaka database, never live from the customer server. Personal tokens only. Generic per organisation: every\norganisation with a Twaka connection reads only its own replica (the organisation comes from the token); an\norganisation without a connection gets `403 twaka_not_connected`, without MAIA `403 twaka_not_available`.\n"},{"name":"Exact settlements","description":"Afletteren in MAIA (Exact Online): offer a payment specification (PDF) and MAIA proposes the settlement; an\napprover of the organisation who did not ask approves it (four-eyes), and only then MAIA books the memorial entry\nand the matching in Exact, if writing to Exact is switched on for the organisation. Personal tokens only\n(`prudai login`), the same rights as on `/exact/controle`; never a service key.\n"},{"name":"Integration administrations","description":"Administrations of a bookkeeping koppeling in MAIA (`prudai integrations`): which Moneybird administrations and\nExact Online divisions the organisation has, which are linked, and the last check or sync. An owner or admin adds a\nMoneybird administration with its own API token, links or unlinks one, or removes one the organisation added itself\n(soft delete, restorable). Every change waits for a human approval. Personal tokens only; never a service key.\n"},{"name":"Anonymization","description":"Mask personal data in a file or text you send (`prudai anonymize`): Prudai's own anonymizer service, nothing stored.\n"},{"name":"Feed","description":"The LEO news feed (`prudai news`): per day and legal area, with links to the original sources.\n"},{"name":"Members","description":"Members of your organisation: list, switch off or on, and file a removal request; a different owner approves every change.\n"},{"name":"SecureShares","description":"Veilig delen (`prudai share`): links to send files to, or request files from, an external recipient; review before sending.\n"},{"name":"Projects","description":"LEO projects (\"dossiers\") and their documents, for personal tokens only (`prudai projects`,\n`prudai memos`): the rights are exactly the token user's rights in LEO. Reading works directly;\nupload and restore run directly too (`none`); delete and purge (`review`) and an anonymised or filled-in copy\n(`confirm`) wait for a human: the first call answers `202` with an approval request, and the same call with `x-prudai-approval: apr_…` runs once it is approved.\n"},{"name":"Conversations","description":"Phase 2. Organisation-scoped API conversation register and messages. Delete requires human approval (`review`); restore runs directly."},{"name":"Sources","description":"Phase 1 (planned; the first release, free at launch) and phase 2 (answers). Catalogue, search with verified passages, licence-filtered full text,\ncitation verification and short generated answers grounded in verified passages. Full\ntext and quotes only for sources whose licence permits redistribution; all other served\nsources return references (title, identifier such as ECLI/CELEX, location, date, URL).\n"},{"name":"Knowledge bases","description":"Knowledge bases of the organisation that owns the key; create, upload documents, query."},{"name":"Workflows","description":"Workflow definitions and curated templates with the same access as the app."},{"name":"Workflow runs","description":"Personal workflow runs, human checkpoints, deliverables and named tables."}],"paths":{"/tables":{"get":{"operationId":"listTables","tags":["Registers"],"summary":"List organisation register tables","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator.\n\nZoektermen (NL): Registers en tabellen van het kantoor bekijken.","x-prudai-search-terms":["Registers en tabellen van het kantoor bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":10000}},{"name":"knowledge_base_id","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createTable","tags":["Registers"],"summary":"Create a typed register table (Owner or Admin)","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.  Execution requires Idempotency-Key; exact request/grant retries return the stored result without running the write again.\n\nZoektermen (NL): Een register of getypeerde tabel maken.","x-prudai-search-terms":["Een register of getypeerde tabel maken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Required for execution; exact retries replay the stored result. Reusing the key for changed arguments is refused before approval. A preview needs no key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterTableInput"}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}":{"get":{"operationId":"getTable","tags":["Registers"],"summary":"Read one register table","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator.\n\nZoektermen (NL): De velden en eigenschappen van een register bekijken.","x-prudai-search-terms":["De velden en eigenschappen van een register bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteTable","tags":["Registers"],"summary":"Soft-delete a register table (Owner or Admin)","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.\n\nZoektermen (NL): Een register naar de prullenbak verplaatsen.","x-prudai-search-terms":["Een register naar de prullenbak verplaatsen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:delete"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateTable","tags":["Registers"],"summary":"Change table fields with a lossless conversion report (Owner or Admin)","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409. A failed field conversion returns 409 with per-field failed counts and preserves all data.\n\nZoektermen (NL): Registervelden toevoegen hernoemen of van type veranderen.","x-prudai-search-terms":["Registervelden toevoegen hernoemen of van type veranderen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":10000},"knowledge_base_id":{"type":["string","null"],"maxLength":100},"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/TableField"}},"views":{"type":"array","maxItems":50,"description":"Shared views of this register (filters, sort, columns, presentation). Owner/Admin only; replaces the whole list. A field change that breaks a view the call does not resend is refused with 409 reason view_references_changed_field.","items":{"$ref":"#/components/schemas/TableView"}},"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved. A field change that breaks a shared view the call does not resend gives details.reason view_references_changed_field with details.views: resend views, do not retry unchanged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/restore":{"post":{"operationId":"restoreTable","tags":["Registers"],"summary":"Restore a register table (Owner or Admin)","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.\n\nZoektermen (NL): Een register uit de prullenbak herstellen.","x-prudai-search-terms":["Een register uit de prullenbak herstellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/records":{"get":{"operationId":"listTableRecords","tags":["Registers"],"summary":"Filter, sort and paginate register records","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. The result identifies the applied filters and matching count; next_cursor continues the same query.\n\nZoektermen (NL): Registerregels filteren sorteren en doorbladeren.","x-prudai-search-terms":["Registerregels filteren sorteren en doorbladeren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":10000}},{"name":"filters","in":"query","required":false,"schema":{"type":"string","maxLength":20000},"description":"JSON array of TableFilter objects."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":20000},"description":"JSON array of TableSort objects."}],"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createTableRecord","tags":["Registers"],"summary":"Create one register record","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.  Execution requires Idempotency-Key; exact request/grant retries return the stored result without running the write again.\n\nZoektermen (NL): Een nieuwe regel aan een register toevoegen.","x-prudai-search-terms":["Een nieuwe regel aan een register toevoegen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Required for execution; exact retries replay the stored result. Reusing the key for changed arguments is refused before approval. A preview needs no key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableRecordInput"}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/records/bulk":{"post":{"operationId":"bulkCreateTableRecords","tags":["Registers"],"summary":"Create register records in one approved batch","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.  Execution requires Idempotency-Key; exact request/grant retries return the stored result without running the write again.\n\nZoektermen (NL): Meerdere registerregels in een keer toevoegen.","x-prudai-search-terms":["Meerdere registerregels in een keer toevoegen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Required for execution; exact retries replay the stored result. Reusing the key for changed arguments is refused before approval. A preview needs no key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["records"],"properties":{"records":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/TableRecordInput"}}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/records/{rid}":{"get":{"operationId":"getTableRecord","tags":["Registers"],"summary":"Read one register record","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator.\n\nZoektermen (NL): De waarden en herkomst van een registerregel bekijken.","x-prudai-search-terms":["De waarden en herkomst van een registerregel bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteTableRecord","tags":["Registers"],"summary":"Soft-delete a register record","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.\n\nZoektermen (NL): Een registerregel naar de prullenbak verplaatsen.","x-prudai-search-terms":["Een registerregel naar de prullenbak verplaatsen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:delete"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateTableRecord","tags":["Registers"],"summary":"Merge record values with optimistic concurrency","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.\n\nZoektermen (NL): De waarden van een bestaande registerregel wijzigen.","x-prudai-search-terms":["De waarden van een bestaande registerregel wijzigen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"provenance":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TableCellProvenance"}},"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/records/{rid}/restore":{"post":{"operationId":"restoreTableRecord","tags":["Registers"],"summary":"Restore a register record","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409.\n\nZoektermen (NL): Een registerregel uit de prullenbak herstellen.","x-prudai-search-terms":["Een registerregel uit de prullenbak herstellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Current positive version, bare or double-quoted. Required unless body.version is provided."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/query":{"post":{"operationId":"queryTable","tags":["Registers"],"summary":"Filter, sort, aggregate and group register records in SQL","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. The result identifies the applied filters and matching count; next_cursor continues the same query.\n\nZoektermen (NL): Registerregels filteren tellen optellen middelen en groeperen.","x-prudai-search-terms":["Registerregels filteren tellen optellen middelen en groeperen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Read-only SQL query; no record or schema changes are made."},"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableQueryInput"}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/import":{"post":{"operationId":"importTableRecords","tags":["Registers"],"summary":"Preview or import CSV/XLSX with column mapping","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. dryRun=true returns a preview without persisting records, schema or indexes. Mutations of existing rows require If-Match or version; stale versions return 409. dryRun=true returns count, sample and row errors; apply waits for the central approval grant.  Execution requires Idempotency-Key; exact request/grant retries return the stored result without running the write again.\n\nZoektermen (NL): Een CSV of Excelbestand met kolomkoppeling in een register importeren.","x-prudai-search-terms":["Een CSV of Excelbestand met kolomkoppeling in een register importeren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview with no persistent changes."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Required for execution; exact retries replay the stored result. Reusing the key for changed arguments is refused before approval. A preview needs no key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["format","content"],"properties":{"format":{"enum":["csv","xlsx"]},"content":{"type":"string","maxLength":10000000,"description":"CSV text or base64-encoded XLSX workbook."},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for the existing central human approval; repeat the exact request with x-prudai-approval after approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tables/{id}/export":{"get":{"operationId":"exportTableRecords","tags":["Registers"],"summary":"Export records as CSV, XLSX or JSON in an envelope","description":"Same organisation only; another organisation’s id returns 404. Every response uses the standard six-key envelope. Record writes require a writing role; schema changes and table restore require Owner or Admin. Service keys require an active, person-bound creator. data contains format, content, encoding (utf8 or base64) and count; exports the full filtered result up to 100,000 records. Cursor and limit are not supported and are rejected.\n\nZoektermen (NL): Een register als CSV Excelbestand of JSON exporteren.","x-prudai-search-terms":["Een register als CSV Excelbestand of JSON exporteren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-scopes":["prudai:tables:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"filters","in":"query","required":false,"schema":{"type":"string","maxLength":20000},"description":"JSON array of TableFilter objects."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":20000},"description":"JSON array of TableSort objects."},{"name":"format","in":"query","required":false,"schema":{"enum":["csv","xlsx","json"],"default":"csv"}}],"responses":{"200":{"description":"Result or read-only preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Register or record does not exist in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or unconvertible field values; existing data is preserved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Invalid schema, query, mapping or missing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/docs/search":{"get":{"operationId":"searchDocs","tags":["Docs"],"summary":"Search the product documentation","description":"Ranked documentation pages for a question, each with the best matching section (`section`,\n`section_url` with its anchor) and a snippet. The index is rebuilt with every documentation\ndeploy, not per request; `provenance.index_build_id` names the build. `visibility=public`\n(default) leaves out the pages behind the docs single sign-on and says so in `notIncluded`.\n\nZoektermen (NL): Zoeken in de handleiding en documentatie van Prudai.\n","x-prudai-search-terms":["Zoeken in de handleiding en documentatie van Prudai"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leest alleen productdocumentatie; wijzigt geen gegevens."},"x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Credential-bound read of the product documentation, the same class as the guide: it reads no organisation data."},"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"q","in":"query","required":true,"description":"The question or keywords, in Dutch or English.","schema":{"type":"string","minLength":3,"maxLength":500}},{"$ref":"#/components/parameters/DocsLanguage"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5}},{"$ref":"#/components/parameters/DocsVisibility"}],"responses":{"200":{"description":"Matching pages in the task envelope, best first.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DocsSearchResult"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/docs/pages/{slug}":{"get":{"operationId":"getDocsPage","tags":["Docs"],"summary":"Read one documentation page","description":"The Markdown of one documentation page (at most 30,000 characters; `truncated` and\n`notIncluded` say when it was cut). A page outside the requested `visibility` is a 404,\nexactly like a page that does not exist.\n\nZoektermen (NL): Een pagina uit de handleiding van Prudai lezen.\n","x-prudai-search-terms":["Een pagina uit de handleiding van Prudai lezen"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leest alleen productdocumentatie; wijzigt geen gegevens."},"x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Credential-bound read of the product documentation, the same class as the guide: it reads no organisation data."},"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Page slug without language prefix, for example `chat`, `files` or `irma/beheer`.","schema":{"type":"string","minLength":1,"maxLength":300}},{"$ref":"#/components/parameters/DocsLanguage"},{"$ref":"#/components/parameters/DocsVisibility"}],"responses":{"200":{"description":"The page in the task envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DocsPage"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/skills":{"get":{"operationId":"listSkills","tags":["Discovery"],"summary":"List Prudai and organisation skills available to the caller","description":"Read-only skill discovery using the same product and capability gates as chat.\nPublished organisation procedures use org:<slug>. Drafts, archives and trash are hidden by default.\nOwner/Admin personal credentials may request include_unpublished=true and include_deleted=true.\nOmit product to list skills across the caller's entitled products. The cursor is opaque\nand bound to that selection. Instructions are returned by getSkill.\n\nZoektermen (NL): Vaardigheden en skills bekijken voor je product.\n","x-prudai-search-terms":["Vaardigheden en skills bekijken voor je product"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:skills:read"],"x-prudai-approval":"none","parameters":[{"$ref":"#/components/parameters/DiscoveryProduct"},{"name":"include_unpublished","in":"query","description":"Owner/Admin personal credentials only; includes organisation drafts and archives.","schema":{"type":"boolean","default":false}},{"name":"include_deleted","in":"query","description":"Owner/Admin personal credentials only; includes the organisation trash.","schema":{"type":"boolean","default":false}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Skills in the task envelope; completeness and next describe pagination.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DiscoverySkill"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}},"post":{"operationId":"createSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Create an organisation skill draft","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze als concept aanmaken","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":"confirm","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSkillInput"}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze als concept aanmaken"]}},"/skills/{name}":{"get":{"operationId":"getSkill","tags":["Discovery"],"summary":"Read one available Prudai or organisation skill","description":"Returns registry frontmatter and instructions through the same product, capability, role and callable-tool gates as the app loader. The specialization focus filters the list only; it does not restrict reading an available skill by name.\n\nZoektermen (NL): Een vaardigheid of skill lezen met instructies.\n","x-prudai-search-terms":["Een vaardigheid of skill lezen met instructies"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:skills:read"],"x-prudai-approval":"none","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":44,"pattern":"^(?:org:)?[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}},{"$ref":"#/components/parameters/DiscoveryProduct"},{"name":"include_unpublished","in":"query","description":"Owner/Admin personal credentials only; includes organisation drafts and archives.","schema":{"type":"boolean","default":false}},{"name":"include_deleted","in":"query","description":"Owner/Admin personal credentials only; includes the organisation trash.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"The available skill and instructions in the task envelope.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/DiscoverySkill"},{"type":"object","required":["frontmatter","body"],"properties":{"frontmatter":{"type":"object","additionalProperties":true},"body":{"type":"string"}}}]}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The skill does not exist or is unavailable to the caller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}},"put":{"operationId":"updateSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Edit an organisation skill; its published version stays live until the replacement is published","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze als concept wijzigen","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":"confirm","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSkillInput"}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze als concept wijzigen"]},"delete":{"operationId":"deleteSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Soft delete an organisation skill","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze naar de prullenbak verplaatsen","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:delete"],"x-prudai-approval":"review","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}}],"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze naar de prullenbak verplaatsen"]}},"/skills/test":{"post":{"operationId":"testSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Estimate skill relevance without writing","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze met een voorbeeldvraag testen","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:skills:read"],"x-prudai-approval":{"level":"none","reason":"Read-only lexical estimate; no model call, state change or publication."},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSkillTestInput"}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze met een voorbeeldvraag testen"]}},"/skills/{name}/publish":{"post":{"operationId":"publishSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Publish an organisation skill","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze na beoordeling publiceren","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":{"level":"review","reason":"Publishing changes the shared organisation library and requires review by another Owner/Admin."},"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze na beoordeling publiceren"]}},"/skills/{name}/archive":{"post":{"operationId":"archiveSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Archive an organisation skill","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze archiveren","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":"confirm","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze archiveren"]}},"/skills/{name}/restore":{"post":{"operationId":"restoreSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Restore an organisation skill as a draft","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een kantoorwerkwijze als concept herstellen","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":"confirm","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een kantoorwerkwijze als concept herstellen"]}},"/skills/{name}/versions":{"get":{"operationId":"listSkillVersions","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"List publication version metadata","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): De publicatiegeschiedenis van een kantoorwerkwijze bekijken","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:skills:read"],"x-prudai-approval":"none","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string","pattern":"^[1-9]\\d*$"}}],"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["De publicatiegeschiedenis van een kantoorwerkwijze bekijken"]}},"/skills/{name}/versions/{version}/restore":{"post":{"operationId":"restoreSkillVersion","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Restore a publication version for editing; the current publication stays live","description":"Personal credentials only. The current organisation Owner/Admin role is rechecked before approval and execution. All writes are limited to the org namespace; Prudai skills cannot be modified.\n\nZoektermen (NL): Een eerdere versie van een kantoorwerkwijze als concept herstellen","x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:org_skills:write"],"x-prudai-approval":"confirm","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^org:[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Result in the task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedOrgSkillResponse"}}}},"202":{"description":"Existing approval request; decide in the Console and replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Current state or name conflicts with the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}},"x-prudai-search-terms":["Een eerdere versie van een kantoorwerkwijze als concept herstellen"]}},"/capabilities":{"get":{"operationId":"listCapabilities","tags":["Discovery"],"summary":"Read available features and activation guidance","description":"Uses current product entitlements and feature gates for this organisation and user.\nEnabled describes current entitlement and configuration status; each operation still\nchecks user and object rights. scope_granted independently describes access through\nthis credential. Activation is guidance only; this operation changes no setting.\nenable.kind is self for an existing app setting (exact POST, scope and product),\nconnect for a consent flow from GET /v1/integrations, and request for paid features\nor extra products (human-reviewed POST, never direct entitlement changes).\nUnknown costs are explicitly unknown and are never a promise of free activation.\n\nZoektermen (NL): Functies bekijken en zien hoe je ze kunt aanzetten.\n","x-prudai-search-terms":["Functies bekijken en zien hoe je ze kunt aanzetten"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:capabilities:read"],"x-prudai-approval":"none","parameters":[{"$ref":"#/components/parameters/DiscoveryProduct"}],"responses":{"200":{"description":"Feature metadata in the task envelope.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveryCapability"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}}},"/capabilities/{id}/enable":{"post":{"operationId":"enableCapability","tags":["Discovery"],"summary":"Turn a feature or setting on","description":"Changes only an existing app setting through its existing service and role checks. Organisation settings require the same owner or administrator role as the app; personal settings affect only the caller. Unsupported settings, paid capabilities and integrations cannot be enabled or disabled here. No entitlement is granted.\nPersonal and signed-in user tokens only; service credentials are rejected.\nIdempotency-Key is mandatory. dryRun=true validates and previews without changing\nsettings, creating an approval request or granting any capability.\n\nZoektermen (NL): Een functie of instelling aanzetten.\n","x-prudai-search-terms":["Een functie of instelling aanzetten"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:capabilities:write"],"x-prudai-approval":"confirm","security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/CapabilityId"},{"$ref":"#/components/parameters/CapabilityDryRun"},{"$ref":"#/components/parameters/ConversationIdempotencyKey"},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitySettingRequest"}}}},"responses":{"200":{"description":"Validated dry-run preview or the recorded idempotent result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Human approval is required; no setting or entitlement has been changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"description":"Invalid input or missing Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Unknown or unavailable capability or setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Capability needs another activation kind, or the setting cannot be changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}}},"/capabilities/{id}/disable":{"post":{"operationId":"disableCapability","tags":["Discovery"],"summary":"Turn a feature or setting off","description":"Changes only an existing app setting through its existing service and role checks. Organisation settings require the same owner or administrator role as the app; personal settings affect only the caller. Unsupported settings, paid capabilities and integrations cannot be enabled or disabled here. No entitlement is granted.\nPersonal and signed-in user tokens only; service credentials are rejected.\nIdempotency-Key is mandatory. dryRun=true validates and previews without changing\nsettings, creating an approval request or granting any capability.\n\nOnly the toggles (`writing-style`, `organization-social`, `feed-quiz`) have an off switch: they keep their data. The settings that hold your own content (`source-settings`, `publisher-subscriptions`, `organization-prompt`, `escalation-settings`) return `422 validation_error` here, because switching them off would overwrite that content; clear one with `enable` and the exact new value instead.\n\nZoektermen (NL): Een functie of instelling uitzetten.\n","x-prudai-search-terms":["Een functie of instelling uitzetten"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:capabilities:write"],"x-prudai-approval":"confirm","security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/CapabilityId"},{"$ref":"#/components/parameters/CapabilityDryRun"},{"$ref":"#/components/parameters/ConversationIdempotencyKey"},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitySettingRequest"}}}},"responses":{"200":{"description":"Validated dry-run preview or the recorded idempotent result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Human approval is required; no setting or entitlement has been changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"description":"Invalid input or missing Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Unknown or unavailable capability or setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Capability needs another activation kind, or the setting cannot be changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}}},"/capabilities/{id}/request":{"post":{"operationId":"requestCapability","tags":["Discovery"],"summary":"Request a paid feature or extra product","description":"Records an activation request in the existing human-approval store. Never changes entitlements, starts a subscription or makes a payment. Only a Prudai platform administrator can grant plan capabilities. Costs remain unknown unless an authoritative price is available. Returns the upgrade link https://account.prudai.com/console. Approval or replay never activates the feature.\nPersonal and signed-in user tokens only; service credentials are rejected.\nIdempotency-Key is mandatory. dryRun=true validates and previews without changing\nsettings, creating an approval request or granting any capability.\n\nZoektermen (NL): Een betaalde functie of extra product aanvragen.\n","x-prudai-search-terms":["Een betaalde functie of extra product aanvragen"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:capabilities:request"],"x-prudai-approval":{"level":"review","reason":"Aanvraag voor een betaald plan of extra product; een mens beoordeelt de wijziging en eventuele kosten."},"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/CapabilityId"},{"$ref":"#/components/parameters/CapabilityDryRun"},{"$ref":"#/components/parameters/ConversationIdempotencyKey"},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityActivationRequest"}}}},"responses":{"200":{"description":"Validated dry-run preview or the recorded idempotent result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Human approval is required; no setting or entitlement has been changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityActivationResponse"}}}},"400":{"description":"Invalid input or missing Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Unknown or unavailable capability or setting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Capability needs another activation kind, or the setting cannot be changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}}},"/integrations":{"get":{"operationId":"listIntegrations","tags":["Discovery"],"summary":"Read integration availability and connection guidance","description":"Lists available integrations and the current user or organisation status through\ntheir existing integration gates. Does not connect, disconnect or grant consent.\nConsent links are app routes that require the user's authenticated browser session;\ncredentials and provider tokens are never returned. An unavailable status check\nis reported as unknown rather than disconnected.\n\nZoektermen (NL): Koppelingen bekijken en verbinden met consent.\n","x-prudai-search-terms":["Koppelingen bekijken en verbinden met consent"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":["prudai:integrations:read"],"x-prudai-approval":"none","parameters":[{"$ref":"#/components/parameters/DiscoveryProduct"}],"responses":{"200":{"description":"Integration metadata and connection steps in the task envelope.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"}}}},"/guide":{"get":{"operationId":"getGuide","tags":["Discovery"],"summary":"Read the caller's agent guide","description":"A short factual guide generated from the same product, scope and integration\nsources as discovery. Includes device login, approval requests and follow-up calls.\nExplains self, connect and request activation with examples; org entitlements remain\nunder Prudai platform-admin control and payment always requires a person.\nAny valid credential may read this guide without an additional scope. It contains\nno customer content. Send Accept text/markdown for the Markdown text directly;\napplication/json returns the same text under data.markdown in the task envelope.\n\nZoektermen (NL): Handleiding lezen voor agents en aanzetten van functies.\n","x-prudai-search-terms":["Handleiding lezen voor agents en aanzetten van functies"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Credential-bound read of the caller's own guide: it describes operations and reads no organisation data."},"x-prudai-approval":"none","responses":{"200":{"x-prudai-envelope-exception":{"reason":"Content negotiation: with Accept: text/markdown the guide is plain Markdown for coding agents; application/json returns the same guide in the Prudai envelope."},"description":"Agent guide in the requested representation.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["markdown"],"properties":{"markdown":{"type":"string"}}}}}]}},"text/markdown":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List the models your key may use","description":"Returns the products (and their specialisations) that both your organisation is\nentitled to and your key is allowed to use. Products your organisation does not\nhave are never listed.\n\nZoektermen (NL): Beschikbare modellen en producten bekijken.\n","x-prudai-search-terms":["Beschikbare modellen en producten bekijken"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:models:read"],"x-prudai-conditional-scopes":["prudai:chat_zia:read","prudai:chat_maia:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"responses":{"200":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible list body ({object: list, data: [...]}): OpenAI SDKs parse it unchanged, so it keeps that shape instead of the Prudai envelope."},"description":"The models available to this key.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"401":{"$ref":"#/components/responses/OpenAIUnauthorized"},"403":{"$ref":"#/components/responses/OpenAIForbidden"},"429":{"$ref":"#/components/responses/OpenAITooManyRequests"},"500":{"$ref":"#/components/responses/OpenAIInternalError"},"503":{"$ref":"#/components/responses/OpenAIServiceUnavailable"}}}},"/models/{model}":{"get":{"operationId":"retrieveModel","tags":["Models"],"summary":"Retrieve one model","description":"Zoektermen (NL): Een model of product bekijken.\n","x-prudai-search-terms":["Een model of product bekijken"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:models:read"],"x-prudai-conditional-scopes":["prudai:chat_zia:read","prudai:chat_maia:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"model","in":"path","required":true,"description":"Model id. A specialisation contains a slash; URL-encode it\n(`leo%2Farbeidsrecht`) or pass it as `leo/arbeidsrecht`.\n","schema":{"$ref":"#/components/schemas/ModelId"}}],"responses":{"200":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible model object: OpenAI SDKs parse it unchanged, so it keeps that shape instead of the Prudai envelope."},"description":"The model.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"401":{"$ref":"#/components/responses/OpenAIUnauthorized"},"403":{"$ref":"#/components/responses/OpenAIForbidden"},"404":{"$ref":"#/components/responses/OpenAINotFound"},"429":{"$ref":"#/components/responses/OpenAITooManyRequests"},"500":{"$ref":"#/components/responses/OpenAIInternalError"}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Chat"],"summary":"Create a chat completion","description":"OpenAI-compatible chat completion. Prudai runs its research harness server-side\n(sources, citation checks, depth ladder) and returns the answer with citations.\n\n**Streaming.** With `\"stream\": true` the response is `text/event-stream`. Each event is\none line `data: <json>` followed by a blank line. The JSON is a\n`ChatCompletionChunk` (or, mid-stream, a `StreamErrorEvent`). The stream always ends\nwith the literal line `data: [DONE]`. Keep-alive comments (`: keep-alive`) may be sent\nwhile the harness is researching; SSE clients ignore them.\n\n**Not supported (400).** `tools`, `tool_choice`, `functions`, `function_call`,\n`parallel_tool_calls` (code `tools_not_supported`); `n` other than 1, `logprobs: true`,\n`top_logprobs`, `response_format` other than `{\"type\":\"text\"}`, `audio`, `modalities`,\n`prediction`, `store: false`, image or file content parts, and messages with role\n`tool`/`function` (code `unsupported_parameter`). Any other unknown top-level request\nproperty is also a `400`, so mistakes are not silently ignored.\n\n**Accepted and ignored.** `temperature`, `top_p`, `presence_penalty`,\n`frequency_penalty`, `seed`, `stop`, `metadata`, `max_tokens`,\n`max_completion_tokens`, `logprobs: false`, `response_format: {\"type\":\"text\"}`.\nThe harness controls sampling and answer length.\n\n**Idempotency.** Send `Idempotency-Key` to retry safely. Within 24 hours the same key\nwith the same body returns the stored result (header `Idempotent-Replayed: true`) and\nis charged once; while the first request is still running a retry gets\n`409 idempotency_request_in_progress`; the same key with a different body gets\n`422 idempotency_key_reused`. A request that fails before its conversation was created\n(for example a 429 or 502 from the upstream) releases the key, so the retry runs. A request\nthat fails after its conversation was created keeps the key reserved until it expires after\n24 hours, so a retry never starts a second harness turn. Streaming requests cannot be\nreplayed after completion; reuse of their key returns 409.\n\nChat runs with a user Keycloak access token obtained through product token exchange, or with a\nservice key that holds the `chat` bundle (`prudai:models:read`, `prudai:chat:read`). A service key\nasks as its own machine identity inside its own organisation: never as a person, read-only, without\nprojects, knowledge bases, memories or conversations of employees, and only for the products the\norganisation holds and the key is limited to (`chat_products`, set in the Console). ZIA and MAIA\nare not available to service keys. Each question with a service key counts against a daily\nquestion budget per key and per organisation (`chat_requests_per_day`, see `GET /v1/account`)\nand against the organisation's fair-use budget. Personal API tokens return\n`403 chat_requires_user_token`.\nRequests time out after 240 seconds and answers are bounded to 1 MiB.\n\nWriting follows the signed-in person: a user token whose account role is a writing role\nin the signed-in account (owner, admin, member or sales) carries `prudai:chat:write`; a\nviewer does not. No request field or header grants it, and it is never issued to service\nkeys or personal API tokens. Without it the harness retains its\nread-only tool policy. With it, internal reversible actions run directly; actions needing\napproval in the app create a pending approval request.\nPending actions return HTTP 202 for non-streaming JSON, including idempotency replay;\nstreaming keeps HTTP 200 and reports the pending actions in its final result.\nRead-only and completed direct-action responses retain HTTP 200.\nBoth JSON responses and the final SSE result report `prudai.approvals` and\n`finish_reason` / `stop_reason: approval_required`. Approve through the existing human\nconsole flow, then continue with a new message on the same `conversation_id`.\n\nZoektermen (NL): Chatten en een vraag beantwoorden met bronnen en tools.\n","x-prudai-search-terms":["Chatten en een vraag beantwoorden met bronnen en tools"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":{"level":"none","reason":"Read-only chat needs no approval; optional actions follow their individual app approval policy."},"x-prudai-scopes":["prudai:chat:read"],"x-prudai-conditional-scopes":["prudai:chat_zia:read","prudai:chat_maia:read","prudai:chat:write"],"x-prudai-conditional-scope-approvals":{"prudai:chat:write":{"level":"confirm","reason":"acties binnen de chat; externe en onomkeerbare acties vragen per keer goedkeuring"}},"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/ClientRequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"},"examples":{"basic":{"summary":"Non-streaming question to LEO, specialisation employment law","value":{"model":"leo/arbeidsrecht","reasoning_effort":"medium","messages":[{"role":"user","content":"Wanneer is een ontslag op staande voet onverwijld gegeven?"}]}},"ultraStream":{"summary":"Streaming at Ultra depth with tool progress events","value":{"model":"leo","stream":true,"stream_options":{"include_usage":true},"messages":[{"role":"system","content":"Answer in English."},{"role":"user","content":"Summarise the case law on the duty to investigate before summary dismissal."}],"prudai":{"depth":"ultra","tool_events":true}}}}}}},"responses":{"200":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream, terminated by data: [DONE]): OpenAI SDKs parse them unchanged, so both keep that shape instead of the Prudai envelope. Prudai-specific fields (sources, citations, usage, conversation id) are in the `prudai` member."},"description":"The completion. `application/json` when `stream` is false or absent,\n`text/event-stream` when `stream` is true.\n","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatCompletionStreamEvent"},"x-prudai-sse-framing":"data: <JSON of ChatCompletionStreamEvent>\\n\\n, terminated by data: [DONE]\\n\\n"}}},"202":{"x-prudai-envelope-exception":{"reason":"Pending chat actions retain the OpenAI-compatible ChatCompletion shape with approval requests in `prudai.approvals`."},"description":"Non-streaming completion with actions awaiting human approval. The response includes\n`prudai.approvals` and `finish_reason` / `prudai.stop_reason: approval_required`.\nReplaying its Idempotency-Key preserves HTTP 202. Streaming uses HTTP 200 and the\nfinal SSE result carries the same pending-action details.\n\nThe `prudai.next` member says what to do: read each request with `getApproval`, let a human decide in the Console, then send a new message on the same `conversation_id`. The approved call runs as soon as it is approved, with the requester's rights checked again, and its outcome stands in the conversation as a tool result (`getApproval` then shows it `used`); this works when the approval comes within about 5 minutes of the question (the lifetime of the requester's turn credential); a later approval runs the call when that next message arrives instead. Either way the next answer reports the outcome.\n","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/OpenAIBadRequest"},"401":{"$ref":"#/components/responses/OpenAIUnauthorized"},"402":{"$ref":"#/components/responses/OpenAIPaymentRequired"},"403":{"$ref":"#/components/responses/OpenAIForbidden"},"404":{"$ref":"#/components/responses/OpenAINotFound"},"409":{"$ref":"#/components/responses/OpenAIConflict"},"422":{"$ref":"#/components/responses/OpenAIUnprocessableEntity"},"429":{"$ref":"#/components/responses/OpenAITooManyRequests"},"500":{"$ref":"#/components/responses/OpenAIInternalError"},"502":{"$ref":"#/components/responses/OpenAIBadGateway"},"503":{"$ref":"#/components/responses/OpenAIServiceUnavailable"},"504":{"$ref":"#/components/responses/OpenAIGatewayTimeout"}}}},"/usage":{"get":{"operationId":"getUsage","tags":["Usage"],"summary":"Aggregated usage","description":"Usage of all keys of your organisation in the same environment as the calling key\n(live keys see live usage, test keys see test usage), aggregated per UTC day, key,\nmodel and/or operation. Contains metadata only, never content.\nCredit amounts are null until credit accounting is enabled; free operations then cost 0.\nSource grouping and filtering are reserved and return 422 `unsupported_parameter`\nuntil source metadata is recorded. Personal credentials require an Owner or Admin role.\n`workflow_runs` lists the cost of each workflow run (model calls and tokens) in the period, next to the API buckets.\n\nZoektermen (NL): Verbruik en gebruikskosten bekijken.\n","x-prudai-search-terms":["Verbruik en gebruikskosten bekijken"],"x-prudai-phase":1,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["account:usage:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"start_date","in":"query","required":true,"description":"First UTC day (inclusive).","schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":false,"description":"Last UTC day (inclusive). Defaults to today. The range is at most 366 days.","schema":{"type":"string","format":"date"}},{"name":"group_by","in":"query","required":false,"description":"Dimensions to group by, comma-separated. Default `day`. The reserved `source` dimension returns 422 `unsupported_parameter`.","style":"form","explode":false,"schema":{"type":"array","uniqueItems":true,"minItems":1,"maxItems":5,"items":{"type":"string","enum":["day","key","model","operation","source"]}}},{"name":"key_id","in":"query","required":false,"description":"Only usage of this key.","schema":{"$ref":"#/components/schemas/KeyId"}},{"name":"model","in":"query","required":false,"description":"Only usage of this model (product or product/specialisation).","schema":{"$ref":"#/components/schemas/ModelId"}},{"name":"operation","in":"query","required":false,"description":"Only usage of this operation.","schema":{"$ref":"#/components/schemas/UsageOperation"}},{"name":"source_id","in":"query","required":false,"description":"Reserved source filter. Currently returns 422 `unsupported_parameter`.","schema":{"$ref":"#/components/schemas/SourceId"}}],"responses":{"200":{"description":"The usage report.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/account":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"The calling principal, organisation and limit status (phase 1)","description":"Planned for phase 1. Free and not booked. Service keys require `account:organizations:read`;\npersonal tokens use the user's current app account-read rights. Returns non-secret\ncredential metadata, the organisation, and current fair-use and rate-limit status.\n`key` is null for personal tokens; `personal_token` and `user` are null for service keys.\nA personal token acts on `/v1` only when its `products` contain `prudai` (otherwise\n`403 insufficient_scope`), and only while its user is still a member of the organisation\n(`403 membership_required`). Its rights follow the user's current role: every member gets\nthe `sources_read` and `chat` bundles plus `account:organizations:read`; `account:usage:read`\nand `account:credits:read` need a current Owner or Admin role.\n\nZoektermen (NL): Eigen account, organisatie en limieten bekijken.\n","x-prudai-search-terms":["Eigen account, organisatie en limieten bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["account:organizations:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"Principal and organisation status.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/auth/device":{"post":{"operationId":"startDeviceLogin","tags":["Auth"],"summary":"Start a device login for the CLI (RFC 8628)","description":"Anonymous: the CLI starts a login and shows `user_code` (`ABCD-EFGH`, no 0/O/1/I) and\n`verification_uri`. A human approves in account.prudai.com and chooses the\norganisation; the token is then bound to that user, not to the CLI. The `device_code`\nis the CLI's poll secret: keep it out of URLs and logs. Expires after 10 minutes.\nRFC 8628 response shapes, not the task envelope. `429 rate_limited` when too many\ndevice logins are open from one address. Never cached. A standard RFC 8628 client\nworks as is: JSON or form-encoded, `client_id` and `scope` accepted and ignored (the\nrights come from the approver and `products`), an empty body starts a `prudai` login.\n\nZoektermen (NL): Inloggen met een koppelcode voor de CLI.\n","x-prudai-search-terms":["Inloggen met een koppelcode voor de CLI"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-auth":"none","x-prudai-approval":{"level":"none","reason":"Starts an anonymous device login; issues nothing until a human approves in account.prudai.com."},"x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Anonymous device login (RFC 8628, x-prudai-auth: none): the CLI has no credential yet, and nothing is issued until a human approves."},"security":[],"x-prudai-request-media-type":{"mediaType":"application/json","reason":"Both representations carry the same schema: application/x-www-form-urlencoded is accepted for RFC 8628 clients over HTTP; CLI and MCP send JSON."},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorizationRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/DeviceAuthorizationRequest"}}}},"responses":{"200":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Device login started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthorization"}}}},"400":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Invalid request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthError"}}}},"429":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Too many open device logins from this address, or overall.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRateLimited"}}}},"503":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"The Developer API is disabled or not configured (`developer_api_disabled`, `developer_api_not_configured`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthError"}}}}}}},"/auth/device/token":{"post":{"operationId":"pollDeviceToken","tags":["Auth"],"summary":"Poll a device login; returns the personal token once (RFC 8628)","description":"Poll every `interval` seconds. Until a human approves: `400 authorization_pending`.\nPolling too fast: `400 slow_down` and the interval grows by 5 seconds. After approval\nthe token is returned exactly once (approved → consumed atomically); a second poll gets\n`invalid_grant`. `access_denied` when denied, `expired_token` when expired or unknown.\n`503 temporarily_unavailable` when the approval cannot be verified right now: poll again.\nIf the approver left the organisation before collection, `invalid_grant`.\nRFC 8628 response shapes, not the task envelope. Never cached.\n\nZoektermen (NL): Inloggen afronden en persoonlijk token ophalen.\n","x-prudai-search-terms":["Inloggen afronden en persoonlijk token ophalen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-auth":"none","x-prudai-approval":{"level":"none","reason":"Polls a device login; the token is returned once, only after human approval."},"x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Anonymous device login (RFC 8628, x-prudai-auth: none): the CLI has no credential yet, and the token is returned only after a human approved."},"security":[],"x-prudai-request-media-type":{"mediaType":"application/json","reason":"Both representations carry the same schema: application/x-www-form-urlencoded is accepted for RFC 8628 clients over HTTP; CLI and MCP send JSON."},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}}}},"responses":{"200":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Approved; the personal token, returned once.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceToken"}}}},"400":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Not yet, too fast, denied, expired, already collected or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenError"}}}},"429":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Too many polls from this address.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRateLimited"}}}},"503":{"x-prudai-envelope-exception":{"reason":"RFC 8628 / RFC 6749 section 5.2 wire format: OAuth device clients read device_code, user_code, access_token and the error codes (authorization_pending, slow_down) at the top level, so the device flow keeps that shape instead of the Prudai envelope."},"description":"Approval cannot be verified right now (`temporarily_unavailable`), or the Developer API is disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenError"}}}}}}},"/auth/session/revoke":{"post":{"operationId":"revokeSession","tags":["Auth"],"summary":"Revoke the presented personal token (prudai auth logout)","description":"Revokes the personal token in the `Authorization` header, server-side, and returns 204.\nOnly personal tokens: a service key gets `403 personal_token_required` (service keys are\nmanaged in account.prudai.com). The revocation takes effect for introspecting products\nwithin their cache time (at most 60 seconds).\n\nZoektermen (NL): Uitloggen en persoonlijk token intrekken.\n","x-prudai-search-terms":["Uitloggen en persoonlijk token intrekken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"A personal token may always revoke itself (prudai auth logout)."},"x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Self-revoke: a token that revokes itself only lowers rights, so no scope is required."},"security":[{"PersonalTokenAuth":[]}],"responses":{"204":{"x-prudai-envelope-exception":{"reason":"HTTP 204 No Content: a successful revocation has no body."},"description":"Revoked. No content.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","tags":["Discovery"],"summary":"Read the implemented public API contract","description":"Public discovery without credentials. Returns the OpenAPI document directly, so spec\nregistries and CLI generators can consume it. Paths contain implemented/live operations;\nx-prudai-planned-operations lists the planned operation ids, methods and paths with their\nplanned status. This document describes public API metadata only, never tenant data.\n\nZoektermen (NL): Publieke API-specificatie en operaties bekijken.\n","x-prudai-search-terms":["Publieke API-specificatie en operaties bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-auth":"none","x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Anonymous public discovery (x-prudai-auth: none, security: []): there is no credential, so no scope can apply."},"x-prudai-approval":"none","security":[],"responses":{"200":{"x-prudai-envelope-exception":{"reason":"Returns the OpenAPI 3.1 document itself, unwrapped, so spec registries and CLI generators consume it directly."},"description":"An OpenAPI 3.1 document (a documented raw-response exception).","headers":{"ETag":{"description":"Stable validator for this public metadata snapshot.","schema":{"type":"string"}},"Cache-Control":{"description":"Public cache lifetime, independent of credentials.","schema":{"type":"string","const":"public, max-age=300"}}},"content":{"application/json":{"schema":{"type":"object","required":["openapi","info","paths","components","x-prudai-planned-operations"],"properties":{"openapi":{"type":"string","const":"3.1.0"},"info":{"type":"object"},"paths":{"type":"object"},"components":{"type":"object"},"x-prudai-planned-operations":{"type":"array","items":{"type":"object","required":["operationId","method","path","x-prudai-status"],"properties":{"operationId":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"x-prudai-status":{"const":"planned"}}}}}}}}},"304":{"x-prudai-envelope-exception":{"reason":"HTTP 304 Not Modified has no body by definition (RFC 9110 section 15.4.5)."},"description":"The public metadata snapshot has not changed (empty body)."}}}},"/scopes":{"get":{"operationId":"listScopes","tags":["Discovery"],"summary":"Read the public scope catalogue","description":"Public discovery without credentials. Returns the same generated scope catalogue as\nthe console; issuable and explicit_only describe availability and wildcard matching.\nThe catalogue describes scopes and operations, not the caller's grants.\n\nZoektermen (NL): Rechten en scopes bekijken.\n","x-prudai-search-terms":["Rechten en scopes bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-auth":"none","x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Anonymous public discovery (x-prudai-auth: none, security: []): there is no credential, so no scope can apply."},"x-prudai-approval":"none","security":[],"responses":{"200":{"description":"Generated scope catalogue in the task envelope.","headers":{"ETag":{"description":"Stable validator for this public metadata snapshot.","schema":{"type":"string"}},"Cache-Control":{"description":"Public cache lifetime, independent of credentials.","schema":{"type":"string","const":"public, max-age=300"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["schema","wildcards","products"],"properties":{"schema":{"const":1},"wildcards":{"type":"object"},"products":{"type":"array","items":{"type":"object"}}}}}}]}}}},"304":{"x-prudai-envelope-exception":{"reason":"HTTP 304 Not Modified has no body by definition (RFC 9110 section 15.4.5)."},"description":"The public metadata snapshot has not changed (empty body)."}}}},"/org-skills":{"get":{"operationId":"listOrgSkills","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"List published office procedures","description":"Metadata only, ordered by name and id ascending. The organisation comes from the\nauthenticated credential. Every role, including owners and admins, sees only\npublished, non-deleted procedures. Use getOrgSkill to retrieve a body.\n\n\nZoektermen (NL): Gepubliceerde kantoorwerkwijzen bekijken","x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:org_skills:read"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":25}},{"name":"cursor","in":"query","description":"Opaque position from next_cursor; keep the same limit.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Published metadata page with an exact total and explicit continuation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSkillList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"x-prudai-search-terms":["Gepubliceerde kantoorwerkwijzen bekijken"]}},"/org-skills/{id}":{"get":{"operationId":"getOrgSkill","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Organisation skills"],"summary":"Read a published office procedure","description":"Includes the published body. Unknown, foreign-organisation, draft, archived and\ndeleted procedures return the same 404 document_not_found for every role.\nUse /skills with org:<slug> names for management, testing and publication.\n\n\nZoektermen (NL): Een gepubliceerde kantoorwerkwijze lezen","x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:org_skills:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The published procedure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSkill"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"x-prudai-search-terms":["Een gepubliceerde kantoorwerkwijze lezen"]}},"/conversations":{"get":{"operationId":"listConversations","tags":["Conversations"],"summary":"List API conversations","description":"Lists only conversations registered through this API in the calling organisation.\nPersonal credentials see only their subject's conversations; service credentials\nsee all registered conversations of their organisation. App-only conversations\nare excluded. Deleted entries are hidden unless include_deleted is true and the\ncredential also has an explicit conversations write or delete scope.\n\nZoektermen (NL): Gesprekken en chats bekijken.\n","x-prudai-search-terms":["Gesprekken en chats bekijken"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:conversations:read"],"parameters":[{"name":"product","in":"query","schema":{"type":"string","enum":["leo","leo-fiscaal","vera","bever","zia","maia"]}},{"name":"model","in":"query","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"include_deleted","in":"query","schema":{"type":"boolean","default":false}},{"name":"q","in":"query","description":"Case-insensitive title substring. Wildcard characters are treated literally.","schema":{"type":"string","maxLength":200}},{"$ref":"#/components/parameters/ConversationPageLimit"},{"$ref":"#/components/parameters/ConversationAfter"}],"responses":{"200":{"description":"One page, ordered by creation time descending with an id tie-breaker.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createConversation","tags":["Conversations"],"summary":"Start a conversation","description":"Starts a new conversation with its first question: the same harness turn, product, depth, knowledge-base selection, tools and approvals as `POST /chat/completions`, addressed as a resource.\nThe body is the chat-completion request (`model` selects the product, `prudai.knowledge_bases` the organisation knowledge bases). `prudai.conversation_id` is refused here.\nCompletes with `201` and the completion, whose `prudai.conversation_id` is the new conversation (`conv_…`); continue it with `POST /conversations/{conversation_id}/messages`.\nPending actions return `202` with `prudai.approvals`, exactly as chat does. Streaming (`stream: true`) answers `200` `text/event-stream`.\nStart it inside a dossier with `prudai.project_id`, narrow it to chosen sources with `prudai.sources` (ids from GET /v1/sources); the conversation keeps that choice for every later message.\n\nZoektermen (NL): Een nieuw gesprek starten met een eerste vraag.\n","x-prudai-search-terms":["Een nieuw gesprek starten met een eerste vraag"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":{"level":"none","reason":"Read-only chat needs no approval; optional actions follow their individual app approval policy."},"x-prudai-scopes":["prudai:chat:read"],"x-prudai-conditional-scopes":["prudai:chat_zia:read","prudai:chat_maia:read","prudai:chat:write"],"x-prudai-conditional-scope-approvals":{"prudai:chat:write":{"level":"confirm","reason":"acties binnen de chat; externe en onomkeerbare acties vragen per keer goedkeuring"}},"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/ClientRequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream): the conversation resource forms of chat/completions return the same shape so one client handles all three; Prudai-specific fields, including the conversation id and pending approvals, are in the `prudai` member."},"description":"Streaming conversation start (`text/event-stream`); the final event carries the conversation id.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatCompletionStreamEvent"},"x-prudai-sse-framing":"data: <JSON of ChatCompletionStreamEvent>\\n\\n, terminated by data: [DONE]\\n\\n"}}},"201":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream): the conversation resource forms of chat/completions return the same shape so one client handles all three; Prudai-specific fields, including the conversation id and pending approvals, are in the `prudai` member."},"description":"The conversation was started and the first answer completed.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"202":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream): the conversation resource forms of chat/completions return the same shape so one client handles all three; Prudai-specific fields, including the conversation id and pending approvals, are in the `prudai` member."},"description":"The first answer waits for human approval of an action (`prudai.approvals`); the conversation exists and can be continued after the decision.\n\nThe `prudai.next` member says what to do: read each request with `getApproval`, let a human decide in the Console, then send a new message on the same `conversation_id`. The approved call runs as soon as it is approved, with the requester's rights checked again, and its outcome stands in the conversation as a tool result (`getApproval` then shows it `used`); this works when the approval comes within about 5 minutes of the question (the lifetime of the requester's turn credential); a later approval runs the call when that next message arrives instead. Either way the next answer reports the outcome.\n","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/conversations/{conversation_id}":{"get":{"operationId":"getConversation","tags":["Conversations"],"summary":"Get an API conversation","description":"Unknown, deleted, foreign-organisation and other users' personal conversations return 404 document_not_found without disclosing their existence.\n\nZoektermen (NL): Een gesprek of chat lezen.\n","x-prudai-search-terms":["Een gesprek of chat lezen"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:conversations:read"],"parameters":[{"$ref":"#/components/parameters/ConversationId"}],"responses":{"200":{"description":"The registered conversation metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteConversation","tags":["Conversations"],"summary":"Soft delete an API conversation","description":"Hides the API register entry from lists, gets and chat continuation. The underlying\napp conversation and messages remain subject to the existing retention policy.\nThis does not call the app's separate delete operation or remove any content.\nReturns 202 with an approval request until a human approves. dryRun=true\npreviews unchanged metadata without modifying the register. Unknown or foreign\nconversations return 404 document_not_found before approval is requested.\n\nZoektermen (NL): Een gesprek naar de prullenbak verplaatsen.\n","x-prudai-search-terms":["Een gesprek naar de prullenbak verplaatsen"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"review","x-prudai-scopes":["prudai:conversations:delete"],"parameters":[{"$ref":"#/components/parameters/ConversationId"},{"$ref":"#/components/parameters/ConversationDryRun"},{"$ref":"#/components/parameters/ConversationIdempotencyKey"},{"$ref":"#/components/parameters/ApprovalGrant"}],"responses":{"200":{"description":"Soft-deleted entry, or unchanged metadata for a dry run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"202":{"description":"Human approval required. No action has run. Open approval_url, then repeat this call with x-prudai-approval. Pending requests last 15 minutes by default; approved grants last 10 minutes and can be used once. Personal tokens follow the same policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/conversations/{conversation_id}/messages":{"get":{"operationId":"listConversationMessages","tags":["Conversations"],"summary":"List API conversation messages","description":"Returns user and assistant text in chronological order, retaining citation markers.\nTool and system rows and all internal message and conversation ids are excluded.\nverified, identifier_exists and quote_verified come from the stored citation audit, with the same\nmeaning as in a completion; citations is empty until that audit has run.\nEach text is limited to 200000 characters and carries truncated. A page has at most\n200 messages; the complete response is bounded to 1 MiB, so a page may contain fewer\nmessages. The text budget per message depends on the requested page limit; requesting\na smaller page allows longer text. Omitted audit data or citation projection also\nsets truncated. The next call advances past the last returned message and always terminates.\n\nZoektermen (NL): Berichten in een gesprek lezen.\n","x-prudai-search-terms":["Berichten in een gesprek lezen"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:conversations:read"],"parameters":[{"$ref":"#/components/parameters/ConversationId"},{"$ref":"#/components/parameters/ConversationMessagePageLimit"},{"$ref":"#/components/parameters/ConversationAfter"}],"responses":{"200":{"description":"One bounded page of messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationMessageList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createConversationMessage","tags":["Conversations"],"summary":"Send a message in a conversation","description":"Continues an existing API conversation: an alias of `POST /chat/completions` with `prudai.conversation_id` taken from the path (a body that names another conversation is refused with `422`). The response is the chat completion; pending actions return `202` with `prudai.approvals`, and an approved action has already run and its outcome stands in the conversation by the next message.\n\nZoektermen (NL): Een bericht sturen in een bestaand gesprek.\n","x-prudai-search-terms":["Een bericht sturen in een bestaand gesprek"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":{"level":"none","reason":"Read-only chat needs no approval; optional actions follow their individual app approval policy."},"x-prudai-scopes":["prudai:chat:read"],"x-prudai-conditional-scopes":["prudai:chat_zia:read","prudai:chat_maia:read","prudai:chat:write"],"x-prudai-conditional-scope-approvals":{"prudai:chat:write":{"level":"confirm","reason":"acties binnen de chat; externe en onomkeerbare acties vragen per keer goedkeuring"}},"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","pattern":"^conv_[A-Za-z0-9]{20}$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/ClientRequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream): the conversation resource forms of chat/completions return the same shape so one client handles all three; Prudai-specific fields, including the conversation id and pending approvals, are in the `prudai` member."},"description":"The completion (`application/json`) or, with `stream: true`, `text/event-stream`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatCompletionStreamEvent"},"x-prudai-sse-framing":"data: <JSON of ChatCompletionStreamEvent>\\n\\n, terminated by data: [DONE]\\n\\n"}}},"202":{"x-prudai-envelope-exception":{"reason":"OpenAI-compatible chat completion (JSON) and chat.completion.chunk events (text/event-stream): the conversation resource forms of chat/completions return the same shape so one client handles all three; Prudai-specific fields, including the conversation id and pending approvals, are in the `prudai` member."},"description":"The answer waits for human approval of an action (`prudai.approvals`).\n\nThe `prudai.next` member says what to do: read each request with `getApproval`, let a human decide in the Console, then send a new message on the same `conversation_id`. The approved call runs as soon as it is approved, with the requester's rights checked again, and its outcome stands in the conversation as a tool result (`getApproval` then shows it `used`); this works when the approval comes within about 5 minutes of the question (the lifetime of the requester's turn credential); a later approval runs the call when that next message arrives instead. Either way the next answer reports the outcome.\n","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/conversations/{conversation_id}/restore":{"post":{"operationId":"restoreConversation","tags":["Conversations"],"summary":"Restore a soft-deleted API conversation","description":"Restores the register entry only before purge_after. An expired restore returns\n410 document_not_found; foreign or unknown entries return 404 document_not_found.\nRestoring an active entry is safe and returns its current metadata.\nRuns directly, without an approval request (own workspace). dryRun=true\npreviews unchanged metadata without modifying the register. Idempotency is stored\nfor 24 hours per organisation and operation, including the conversation and dry-run\nchoice in the request fingerprint. A replay returns the stored result; a concurrent\nrequest returns 409 idempotency_request_in_progress; a changed request with the\nsame key returns 422 idempotency_key_reused.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een verwijderd gesprek herstellen.\n","x-prudai-search-terms":["Een verwijderd gesprek herstellen"],"x-prudai-phase":2,"x-prudai-status":"live","x-prudai-approval":{"level":"none","reason":"Brings back the person's own deleted conversation. Rule set: own workspace."},"x-prudai-scopes":["prudai:conversations:write"],"parameters":[{"$ref":"#/components/parameters/ConversationId"},{"$ref":"#/components/parameters/ConversationDryRun"},{"$ref":"#/components/parameters/ConversationIdempotencyKey"}],"responses":{"200":{"description":"Restored entry, or unchanged metadata for a dry run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"description":"The restore window expired. Uses document_not_found in the standard error envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sources":{"get":{"operationId":"listSources","x-prudai-fair-use":"requests","tags":["Sources"],"summary":"List sources (phase 1)","description":"Free at launch. The catalogue of sources this key may search, with jurisdiction,\nkind and licence. Sources whose redistribution status is `none` or `unknown` in\nPrudai's licence register are not served at all and therefore never listed.\n\nZoektermen (NL): Beschikbare juridische bronnen bekijken en filteren.\n","x-prudai-search-terms":["Beschikbare juridische bronnen bekijken en filteren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:sources:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"jurisdiction","in":"query","required":false,"description":"Filter on jurisdiction code, comma-separated (`NL`, `EU`, `DE`, `FR`, …).","style":"form","explode":false,"schema":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/JurisdictionCode"}}},{"name":"kind","in":"query","required":false,"style":"form","explode":false,"schema":{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/SourceKind"}}},{"name":"access","in":"query","required":false,"description":"Only sources with this access level.","schema":{"$ref":"#/components/schemas/SourceAccess"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":100}},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"One page of sources.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/sources/search":{"post":{"operationId":"searchSources","x-prudai-fair-use":"requests","tags":["Sources"],"summary":"Search sources (phase 1)","description":"Searches the sources. With `mode: auto` Prudai selects the\nsources (deterministic routing; no model fallback) and returns a\n`context.routing` block that explains the choice; envelope `next` proposes ready-made calls. With\n`mode: explicit` you name the sources in `source_ids`.\n\nFree at launch (`cost_credits: 0`, request kind `search` or `routed_search`; fair-use\nlimits apply, `429 fair_use_limited`). Every hit carries\n`passages[]` (verified passages with location; quotes only for `access: full_text`).\nSnippets are only returned for sources with `access: full_text`.\nThis release uses keyword and identifier search. With `search_mode: hybrid` (the\ndefault) a search over several sources asks every selected source for one page\n(at most four upstream calls at a time), ranks the hits on the query and on a source\nprior that follows the question (shown as `confidence` in `context.routing`), and\nfills the page from all sources; a source that is down or a text that cannot be\nfetched is a gap in `notIncluded`. With `search_mode: keyword` pages traverse sources\nin catalog order, one source per page. Date sorting and facets apply to the returned\npage. Only publication-date\nfiltering is supported. Sources without an adapter are reported in `notIncluded`.\nThere are no EU sources in the current licensed catalog. Upstream reads are limited\nto 2 MiB, documents to 200,000 characters, and excerpts to 2,000 characters.\nRetrieved excerpts use the document location unless an exact article is available;\nkeyword excerpts select a literal matching term when present. Missing source text\nis reported instead of being marked verified.\n\nZoektermen (NL): Bronnen zoeken in openbare juridische informatie.\n","x-prudai-search-terms":["Bronnen zoeken in openbare juridische informatie"],"x-prudai-phase":1,"x-prudai-status":"live","x-prudai-approval":{"level":"none","reason":"Doorzoekt en leest alleen bronnen; wijzigt geen gegevens."},"x-prudai-scopes":["prudai:sources:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/ClientRequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceSearchRequest"}}}},"responses":{"200":{"description":"Search results.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceSearchResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"description":"Temporarily unavailable (`service_unavailable`). Free operations never return `credit_check_unavailable`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Source deadline exceeded (`timeout`, details.reason_code `upstream_timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sources/{source_id}/documents/{document_id}":{"get":{"operationId":"fetchSourceDocument","x-prudai-fair-use":"requests","tags":["Sources"],"summary":"Fetch a document's full text (phase 1)","description":"Returns the full text of one document, only for sources with\n`access: full_text`. For a `reference_only` source the response is\n`403 redistribution_not_permitted`; use the `url` from the search hit instead.\nFree at launch (request kind `fetch`, `cost_credits: 0`; fair-use limits apply).\nDocuments are bounded to 200,000 characters and the transport to 2 MiB; incomplete\ntext has `completeness.truncated: true`. Wetten article identifiers accept\n`BWBR.../artikel <number>`; historical text is returned only when its validity\nperiod can be confirmed. Articles outside the bounded read are unavailable.\nA caveat the source itself attaches to the document (for example an unofficial\nconsolidation, anonymisation kept, or only the table of contents) is listed in\n`notIncluded`.\n\nZoektermen (NL): Volledige brontekst van een juridisch document ophalen.\n","x-prudai-search-terms":["Volledige brontekst van een juridisch document ophalen"],"x-prudai-phase":1,"x-prudai-status":"live","x-prudai-approval":"none","x-prudai-scopes":["prudai:source_texts:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SourceId"}},{"name":"document_id","in":"path","required":true,"description":"Document id from a search hit (URL-encoded; ECLI and CELEX ids contain colons).","schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"as_of","in":"query","required":false,"description":"The version in force on this date, where the source provides versions (legislation). Default today.\nA date in the future is refused (422). A document with no version in force on this date gives 404 with\ndetails.reason_code `not_in_force_on_date`.\n","schema":{"type":"string","format":"date"}},{"name":"format","in":"query","required":false,"description":"Both formats return the standard JSON `SourceDocument` envelope. `json` (default)\nselects plain text in `data.content`; `markdown` selects Markdown there with\n`data.content_format: markdown`. Neither format drops the envelope metadata.\n","schema":{"type":"string","enum":["json","markdown"],"default":"json"}}],"responses":{"200":{"description":"The document.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceDocument"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"description":"Temporarily unavailable (`service_unavailable`). Free operations never return `credit_check_unavailable`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Source deadline exceeded (`timeout`, details.reason_code `upstream_timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/citations/verify":{"post":{"operationId":"verifyCitations","x-prudai-fair-use":"citations","tags":["Sources"],"summary":"Verify citations (phase 1)","description":"Checks a list of citations — an ECLI, an article reference such as\n`art. 6:162 BW`, a CELEX number or a Kamerstuk reference — each with an optional\nquote. Per citation you get whether it `exists`, what it `resolved` to (source,\ndocument, URL, title, date, location), whether the quote matches (`quote_match`) and a\n`reason`. Use it to check the output of any model or author, not only Prudai's.\n\nIt works for `reference_only` sources too: Prudai confirms that the document and\nlocation exist and, where Prudai holds the text, whether the quote matches, without\npassing the text on (`matched_passage` is only returned for `full_text` sources).\nFree at launch (request kind `verify_citations`, `cost_credits: 0`; fair-use limits\napply), up to 50 citations per request.\n\nZoektermen (NL): Citaten controleren en bronverwijzingen verifiëren.\n","x-prudai-search-terms":["Citaten controleren en bronverwijzingen verifiëren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leest en controleert alleen citaten; wijzigt geen gegevens."},"x-prudai-scopes":["prudai:citations:read"],"security":[{"ApiKeyAuth":[]},{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ClientRequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CitationVerifyRequest"},"examples":{"mixed":{"value":{"citations":[{"reference":"ECLI:NL:HR:…","quote":"…","client_ref":"c1"},{"reference":"art. 6:162 BW","client_ref":"c2"}]}}}}}},"responses":{"200":{"description":"One result per submitted citation, in request order.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CitationVerifyResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"description":"Temporarily unavailable (`service_unavailable`). Free operations never return `credit_check_unavailable`.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/voice-memos":{"get":{"operationId":"listVoiceMemos","tags":["VoiceMemos"],"summary":"List own voice memos","description":"Newest first, never another person's memo. Unassigned is the default inbox filter. Lists omit transcripts; get a memo for its text. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Eigen spraakmemo’s en inbox bekijken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:voice_memos:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unassigned","assigned","all"],"default":"unassigned"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"x-prudai-search-terms":["Eigen spraakmemo’s en inbox bekijken"]},"post":{"operationId":"createVoiceMemo","tags":["VoiceMemos"],"summary":"Upload an own voice memo","description":"One audio file in multipart field file (.m4a, .webm, .mp3, .wav, .ogg, .aac, .flac, .opus or .mp4). sha256 hashes the received bytes. A required Idempotency-Key is unique per organisation and person: retrying returns the original memo (200) without another upload; changed bytes or arguments return 422 idempotency_key_reused. The personal inbox is an existing own LEO project named Transcribe, otherwise one private project named Spraakmemo's. A LEO/ORDO target uploads directly there and is assigned. CATO targets retain audio in the personal inbox. Processing uses the existing EU transcription route. dryRun returns a preview with would_upload and stores nothing. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo opnemen en uploaden.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen opname van de persoon; het doel is begrensd tot de eigen schrijfrechten."},"x-prudai-scopes":["prudai:voice_memos:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Idempotency replay, or a validation-only upload preview with no stored memo.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VoiceMemoResponse"},{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","additionalProperties":false,"required":["id","sha256","byte_size","target","would_upload"],"properties":{"id":{"type":"null"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"byte_size":{"type":"integer","minimum":1},"target":{"oneOf":[{"$ref":"#/components/schemas/VoiceMemoTarget"},{"type":"null"}]},"would_upload":{"type":"boolean","const":true}}}}}]}]}}}},"201":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string","format":"binary"},"duration_ms":{"type":"integer","minimum":0,"maximum":86400000},"target_link_type":{"type":"string","enum":["leo-project","ordo-dossier","cato-record"]},"target_link_id":{"type":"string","format":"uuid"},"target_subtype":{"type":"string","enum":["company","person","opportunity"]}}}}}},"x-prudai-search-terms":["Spraakmemo opnemen en uploaden"]}},"/voice-memos/{id}":{"get":{"operationId":"getVoiceMemo","tags":["VoiceMemos"],"summary":"Read an own voice memo and transcript","description":"The RAG document status maps completed to ready, failed to failed and pending processing to transcribing; still processing 10 minutes after the document's last change is failed, and a late transcript turns it back into ready. Assigned memos retain assigned status. The transcript is read with the user's current project access. A short Dutch summary is generated lazily when ready and cached encrypted at rest. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo en uitgeschreven tekst bekijken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:voice_memos:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-prudai-search-terms":["Spraakmemo en uitgeschreven tekst bekijken"]},"delete":{"operationId":"deleteVoiceMemo","tags":["VoiceMemos"],"summary":"Move an own voice memo to trash","description":"Soft deletion is recoverable. Requires review through the standard approval flow; without a grant the response is 202 ApprovalRequest. An inaccessible memo returns 404 before creating an approval request. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo naar de prullenbak verplaatsen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:voice_memos:delete"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"202":{"description":"Awaiting standard human review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."},{"$ref":"#/components/parameters/ApprovalGrant"}],"x-prudai-search-terms":["Spraakmemo naar de prullenbak verplaatsen"]},"patch":{"operationId":"updateVoiceMemo","tags":["VoiceMemos"],"summary":"Assign or move an own voice memo","description":"Checks current write access on each target. LEO/ORDO copy the original plus an optional Markdown summary and transcript, then soft-delete the prior audio into recoverable trash. An ORDO link_id is its LEO dossier-project UUID, not the external ORDO dossier UUID. Repeating an identical assignment is idempotent. CATO writes use the existing delegated prepare/apply path; only summary and LEO project/document references enter CRM, never audio or the full transcript. CATO requires staff and current CATO rights. options.cato_note on a project assignment also writes to options.cato_target. summary and knowledge_base default true; cato_note defaults false; cato_soort defaults ACHTERGROND. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo aan dossier of project toewijzen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen opname van de persoon; het doel is begrensd tot de eigen schrijfrechten."},"x-prudai-scopes":["prudai:voice_memos:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["target"],"properties":{"target":{"$ref":"#/components/schemas/VoiceMemoTarget"},"options":{"$ref":"#/components/schemas/VoiceMemoOptions"}}}}}},"x-prudai-search-terms":["Spraakmemo aan dossier of project toewijzen"]}},"/voice-memos/{id}/discard":{"post":{"operationId":"discardVoiceMemo","tags":["VoiceMemos"],"summary":"Discard an own unsaved voice memo","description":"Throws away an own recording that is not assigned anywhere yet (the picker right after recording). The audio and transcript in the personal inbox project go to the trash and the memo gets its soft-deletion mark. A person who taps this in the Prudai iOS app needs no approval; every other caller (personal token, MCP, CLI) is held for HITL review like every /v1 delete. An assigned memo returns 409. Retrying after a partial failure is safe. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo weggooien zonder op te slaan.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Weggooien door een agent (persoonlijk token, MCP, CLI) vraagt review zoals elke /v1-delete; de persoon in de iOS-app is zelf het akkoord."},"x-prudai-scopes":["prudai:voice_memos:delete"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"202":{"description":"Awaiting standard human review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"x-prudai-search-terms":["Spraakmemo weggooien zonder op te slaan"]}},"/voice-memos/{id}/restore":{"post":{"operationId":"restoreVoiceMemo","tags":["VoiceMemos"],"summary":"Restore an own voice memo","description":"Clears the memo's soft-deletion mark without a Console confirmation card. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Spraakmemo uit de prullenbak herstellen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen opname van de persoon; het doel is begrensd tot de eigen schrijfrechten."},"x-prudai-scopes":["prudai:voice_memos:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceMemoResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"x-prudai-search-terms":["Spraakmemo uit de prullenbak herstellen"]}},"/voice-memos/{id}/suggestions":{"get":{"operationId":"getVoiceMemoSuggestions","tags":["VoiceMemos"],"summary":"Suggest destinations for an own voice memo","description":"At most five currently accessible destinations ranked recent (the most recently active project the person can save in, never the Transcribe inbox), last_opened, meeting, calendar, mentioned. A last_opened hint never grants access. meeting = the calendar meeting during the recording (delegated CATO session, own recordings only; recording end = created_at, length = duration_ms; skipped without duration_ms): first the LEO project of that contact, then its CATO records. A confidential meeting is never suggested. Then context.meeting holds calendar_event_id, title, starts_at, ends_at, is_teams, company_name, leo_project (existing, none or unknown) and new_project_for_contact ({name} only when leo_project is none, else null). Calendar candidates use the delegated CATO calendar when available; omitted sources are explained in notIncluded. Each suggestion carries reason recent, last_opened, meeting, calendar or mentioned. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Voorgestelde doelen voor een spraakmemo bekijken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:voice_memos:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTargetList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"last_opened","in":"query","required":false,"schema":{"type":"string","maxLength":100},"description":"Hint as link_type:link_id. Only returned when currently accessible."}],"x-prudai-search-terms":["Voorgestelde doelen voor een spraakmemo bekijken"]}},"/link-targets":{"get":{"operationId":"listLinkTargets","tags":["LinkTargets"],"summary":"Search accessible memo and sharing destinations","description":"Searches within current user access. ORDO targets use the linked LEO dossier-project UUID as link_id. CATO company/person/opportunity records require staff and current delegated CATO rights; unavailable CATO is silently omitted with a notIncluded reason. Search has an unknown total; limit bounds returned items. Personal credentials only (personal token or Keycloak user token); a service key is refused. VOICE_MEMOS_V1_ENABLED=false returns 404 before authentication or body parsing.\n\nZoektermen (NL): Dossier project of relatie als koppeldoel zoeken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:link_targets:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTargetList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"types","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated leo-project,ordo-dossier,cato-record; default all three."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"x-prudai-search-terms":["Dossier project of relatie als koppeldoel zoeken"]}},"/form-profile":{"get":{"operationId":"getFormProfile","tags":["FormProfile"],"summary":"Read the stored form details","description":"Returns what is stored for filling in forms: the organisation fields (legal name, KvK, VAT, address, IBAN ...), your own personal fields (birth date, job title ...) and the personal fields colleagues chose to share. Non-shared personal fields of colleagues are never returned. Values are stored encrypted. Personal credentials only (personal token or Keycloak user token); a service key is refused.\n\nZoektermen (NL): Invulgegevens voor formulieren bekijken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:form_profile:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Also list soft-deleted own and organisation fields."}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-prudai-search-terms":["Invulgegevens voor formulieren bekijken"]}},"/form-profile/fields/{scope}/{key}":{"put":{"operationId":"putFormProfileField","tags":["FormProfile"],"summary":"Store one form detail","description":"Stores or replaces one field. organization fields need an owner or admin; person fields are always your own (there is no way to store someone else's personal details). The server validates the shape (KvK 8 digits, VAT NL123456789B01, IBAN check digits, dates) and refuses BSN, identity documents, health and other special categories of personal data. Personal credentials only.\n\nZoektermen (NL): Invulgegeven opslaan voor formulieren.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"confirm","reason":"Slaat een invulgegeven op dat later in formulieren wordt gebruikt."},"x-prudai-scopes":["prudai:form_profile:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"parameters":[{"name":"scope","in":"path","required":true,"schema":{"type":"string","enum":["organization","person"]},"description":"organization = company data (owner/admin writes); person = your own details."},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^(custom:)?[a-z][a-z0-9_]{1,47}$"},"description":"Catalog key (kvk_number, vat_number, legal_name, street_address, postal_code, city, iban, birth_date, job_title ...) or custom:<name>."},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate with no persistent changes."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"value":{"type":"string","minLength":1,"maxLength":300},"label":{"type":"string","minLength":1,"maxLength":80,"description":"Name of a custom field as the form asks it."},"shared_with_org":{"type":"boolean","description":"person only: colleagues may use this field in their forms (default false)."}}}}}},"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-prudai-search-terms":["Invulgegeven opslaan voor formulieren"]},"delete":{"operationId":"deleteFormProfileField","tags":["FormProfile"],"summary":"Remove one form detail","description":"Soft-deletes one field; restoreFormProfileField puts it back. Personal credentials only.\n\nZoektermen (NL): Invulgegeven verwijderen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Verwijdert een invulgegeven (zacht, herstelbaar)."},"x-prudai-scopes":["prudai:form_profile:delete"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"parameters":[{"name":"scope","in":"path","required":true,"schema":{"type":"string","enum":["organization","person"]},"description":"organization = company data (owner/admin writes); person = your own details."},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^(custom:)?[a-z][a-z0-9_]{1,47}$"},"description":"Catalog key (kvk_number, vat_number, legal_name, street_address, postal_code, city, iban, birth_date, job_title ...) or custom:<name>."},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate with no persistent changes."}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-prudai-search-terms":["Invulgegeven verwijderen"]}},"/form-profile/fields/{scope}/{key}/restore":{"post":{"operationId":"restoreFormProfileField","tags":["FormProfile"],"summary":"Restore a removed form detail","description":"Restores the most recently removed field with this key, unless an active field with the same key exists (409). Personal credentials only.\n\nZoektermen (NL): Verwijderd invulgegeven terugzetten.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"confirm","reason":"Zet een verwijderd invulgegeven terug."},"x-prudai-scopes":["prudai:form_profile:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"parameters":[{"name":"scope","in":"path","required":true,"schema":{"type":"string","enum":["organization","person"]},"description":"organization = company data (owner/admin writes); person = your own details."},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^(custom:)?[a-z][a-z0-9_]{1,47}$"},"description":"Catalog key (kvk_number, vat_number, legal_name, street_address, postal_code, city, iban, birth_date, job_title ...) or custom:<name>."},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate with no persistent changes."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{}}}}},"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-prudai-search-terms":["Verwijderd invulgegeven terugzetten"]}},"/push-devices":{"get":{"operationId":"listPushDevices","tags":["PushDevices"],"summary":"List my push devices","description":"Lists the devices of the signed-in person that can receive push notifications (iOS and browsers). Tokens and Web Push keys are never returned. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.\n\nZoektermen (NL): Mijn toestellen voor pushmeldingen bekijken.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:push_devices:read"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDeviceList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"x-prudai-search-terms":["Mijn toestellen voor pushmeldingen bekijken"]},"post":{"operationId":"registerPushDevice","tags":["PushDevices"],"summary":"Register this phone for push notifications","description":"Registers or refreshes the APNs device token of the signed-in person. A token is unique: when another person signs in on the same phone the device moves to that person. The response never contains the token. Notifications carry metadata only (kind and product), never customer content. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.\n\nZoektermen (NL): Telefoon aanmelden voor pushmeldingen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen toestel van de persoon; alleen meldingen voor zichzelf, geen inhoud."},"x-prudai-scopes":["prudai:push_devices:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"201":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDeviceResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","environment"],"properties":{"token":{"type":"string","pattern":"^[0-9a-fA-F]{64,200}$","description":"APNs device token as hex."},"environment":{"type":"string","enum":["sandbox","production"]},"bundle_id":{"type":"string","maxLength":155},"app_version":{"type":"string","maxLength":32}}}}}},"x-prudai-search-terms":["Telefoon aanmelden voor pushmeldingen"]}},"/push-devices/unregister":{"post":{"operationId":"unregisterPushDevice","tags":["PushDevices"],"summary":"Stop push notifications on this phone","description":"Removes the given APNs token of the signed-in person (logout, permission withdrawn). Removing a token that is not yours removes nothing. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.\n\nZoektermen (NL): Pushmeldingen op deze telefoon stoppen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen toestel van de persoon; alleen meldingen voor zichzelf, geen inhoud."},"x-prudai-scopes":["prudai:push_devices:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDeviceRemoved"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","pattern":"^[0-9a-fA-F]{64,200}$"}}}}}},"x-prudai-search-terms":["Pushmeldingen op deze telefoon stoppen"]}},"/push-devices/{id}/test":{"post":{"operationId":"testPushDevice","tags":["PushDevices"],"summary":"Send a test notification to one of my devices","description":"Sends a fixed test notification (\"Pushmeldingen werken op dit apparaat.\") to one own active device. Personal credentials only (personal token or Keycloak user token); a service key is refused. PUSH_NOTIFICATIONS_ENABLED=false returns 404.\n\nZoektermen (NL): Testmelding naar mijn telefoon sturen.","x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Eigen toestel van de persoon; alleen meldingen voor zichzelf, geen inhoud."},"x-prudai-scopes":["prudai:push_devices:write"],"security":[{"PersonalTokenAuth":[]},{"UserAccessTokenAuth":[]}],"responses":{"200":{"description":"Task envelope with the result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushTestResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]},"description":"Validate and preview the effect without changing anything."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"x-prudai-search-terms":["Testmelding naar mijn telefoon sturen"]}},"/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List the LEO projects (dossiers) you can read","description":"Personal tokens only (`403 personal_token_required` for a service key): a project is user\ndata and the rights are exactly the token user's rights in LEO. Lists the projects the user\nowns plus the projects whose knowledge base is shared with them, never another user's ORDO\ndossier project and never an IRMA environment project; only products the user's account\nhas. `role` is `owner`, `editor` (may add and remove documents) or `reader`. `q` is a\ncase-insensitive substring of the name (the CLI resolves a project name with it, exactly).\nSorted newest first. When the shared projects cannot be fetched, the page holds only owned\nprojects, `completeness.total` is null and `notIncluded` says so.\nOn by default; the server can switch it off with `DEVELOPER_API_PROJECTS_ENABLED=false`, and then personal tokens lack\n`prudai:projects:read` (`403 insufficient_scope`).\n\nZoektermen (NL): Dossiers en projecten bekijken.\n","x-prudai-search-terms":["Dossiers en projecten bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"One page of projects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectList"},"example":{"data":[{"id":"83515397-a68e-45d8-8cb6-000000000001","name":"Transcribe","description":null,"kind":"dossier","product":"leo","archived":false,"role":"owner","created_at":"2026-09-01T08:00:00.000Z","updated_at":"2026-10-29T08:00:00.000Z"}],"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"},"completeness":{"total":1,"returned":1,"truncated":false},"notIncluded":[],"provenance":{"source":"leo","scope":"user"},"next":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/duplicate-check":{"get":{"operationId":"checkProjectDuplicates","tags":["Projects"],"summary":"Check whether a colleague already has a dossier for this client","description":"Personal tokens only. Before creating a dossier: does a colleague in YOUR organisation already\nhave a dossier for the same client in this product? The name is compared on its client core\n(lower case, accents, punctuation, legal forms such as `B.V.`/`holding`, years and the words\n\"dossier\"/\"project\" removed; equal core, or the whole word sequence of the one inside the other).\nOnly active colleagues; ORDO-linked dossiers, tables and other IRMA environments do not count.\n\nConfidentiality: per match only the owner's name, the creation day, `archived` and whether you\nalready have access. Never the other dossier's name, id, description, documents or counts; only\nwhen you already have access (`has_access: true`) does `project_id` come along. `ref` is an\nopaque reference for `requestProjectAccess`, different per user. `own_match` is a hint that you\nyourself already have a dossier with this name. Same outcome as the app and LEO's\n`createDossier` tool. Nothing blocks creating a dossier anyway.\n\nZoektermen (NL): Controleren of een collega al een dossier voor deze klant heeft.\n","x-prudai-search-terms":["Controleren of een collega al een dossier voor deze klant heeft"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"product","in":"query","required":false,"description":"Product slug of the dossier layer (default `leo`); must be one of your products.","schema":{"type":"string","minLength":1,"maxLength":40,"default":"leo"}}],"responses":{"200":{"description":"The matches (possibly none).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["checked","own_match","matches"],"properties":{"checked":{"type":"boolean","description":"false when nothing was searched (name too short","or no organisation).":null},"own_match":{"type":"boolean"},"matches":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["ref","owner_name","created_on","archived","has_access"],"properties":{"ref":{"type":"string"},"owner_name":{"type":"string"},"created_on":{"type":"string","format":"date"},"archived":{"type":"boolean"},"has_access":{"type":"boolean"},"project_id":{"type":"string","format":"uuid","description":"Only when has_access is true."}}}}}}}},"example":{"data":{"checked":true,"own_match":false,"matches":[{"ref":"Zk3n9Qx0aLr5Tb2Wc8Yd1Fh6Jm4Pv7Se","owner_name":"Anna Jansen","created_on":"2026-11-12","archived":false,"has_access":false}]},"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"},"notIncluded":[],"next":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/access-requests":{"post":{"operationId":"requestProjectAccess","tags":["Projects"],"summary":"Ask a colleague for access to their dossier for this client","description":"Personal tokens only. Sends the owner of a match from `checkProjectDuplicates` a notification\n(in-app and e-mail, following their preferences) that you ask for access, with a button that\nopens that dossier (sharing goes through its usual Share action). Nothing is shared or created automatically; the owner decides, and\nyou get the usual \"added as collaborator\" notification once shared. Pass the same `name` and the\n`ref` of the match. `404 match_not_found` when the reference does not belong to a match of yours\nfor this name; `409 already_has_access` when you already have access.\n\nWaits for a human (`confirm`): it notifies a colleague.\n\nZoektermen (NL): Toegang vragen tot het dossier van een collega.\n","x-prudai-search-terms":["Toegang vragen tot het dossier van een collega"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:projects:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name","ref"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"ref":{"type":"string","minLength":1,"maxLength":64},"product":{"type":"string","minLength":1,"maxLength":40,"default":"leo"}}}}}},"responses":{"202":{"description":"The owner was notified.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","additionalProperties":false,"required":["requested","owner_name"],"properties":{"requested":{"type":"boolean","enum":[true]},"owner_name":{"type":"string"}}}}},"example":{"data":{"requested":true,"owner_name":"Anna Jansen"},"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"},"notIncluded":[],"next":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/projects/{project_id}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"Get one project (dossier)","description":"Personal tokens only. An unknown project and a project you may not read both answer\n`404 project_not_found`: no existence leak through status code or envelope in normal\noperation. During an outage of the document service (`503 service_unavailable`) and through\nresponse timing an existing project can be told apart from an unknown id; project ids are\nrandom UUIDs. `403 product_not_entitled` when your account does not have the project's product.\n\nZoektermen (NL): Een dossier of project bekijken.\n","x-prudai-search-terms":["Een dossier of project bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"responses":{"200":{"description":"The project.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/drafts/import":{"post":{"operationId":"importProjectWordDocument","tags":["Projects"],"summary":"Import Word into a new editable project concept","description":"Imports one .docx upload or one accessible document from a project or knowledge base into\na new document concept. Headings, lists, tables and emphasis are preserved. Footnotes become\nendnotes. `tracked_changes` selects accept or mark; omitted elements are counted in warnings.\nThe source and destination are checked first; the import then runs directly, without an\napproval request (own workspace). Maximum upload 15 MiB. `?dryRun=true` returns parsed structure statistics and warnings without creating a concept.\nIdempotency-Key is required for creation; retries with the same caller, key and inputs return the same concept for 24 hours.\nCreation is reversible through the existing concept deletion route; the source remains unchanged.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Word importeren als bewerkbaar concept in een dossier.\n","x-prudai-search-terms":["Word importeren als bewerkbaar concept in een dossier"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":{"level":"none","reason":"Creates a new draft in a project the person may write to. Rule set: own workspace."},"x-prudai-scopes":["prudai:word_import:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","description":"Required when creating a concept; optional for dryRun.","schema":{"type":"string","minLength":1,"maxLength":255}}],"x-prudai-request-media-type":{"mediaType":"application/json","reason":"CLI and MCP import a document that is already in the project or a knowledge base, by document_id (JSON). multipart/form-data is the direct .docx upload for HTTP clients and the app; file bytes do not travel as tool arguments."},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["document_id"],"additionalProperties":false,"properties":{"document_id":{"type":"string","format":"uuid"},"knowledge_base_id":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":200},"conversation_id":{"type":"string","format":"uuid"},"tracked_changes":{"type":"string","enum":["accept","mark"]},"doc_type":{"type":"string","enum":["brief","memo","advies","overeenkomst","processtuk","email","overig"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"additionalProperties":false,"properties":{"file":{"type":"string","format":"binary"},"title":{"type":"string","minLength":1,"maxLength":200},"conversation_id":{"type":"string","format":"uuid"},"tracked_changes":{"type":"string","enum":["accept","mark"]},"doc_type":{"type":"string","enum":["brief","memo","advies","overeenkomst","processtuk","email","overig"]}}}}}},"responses":{"200":{"description":"Parsed read-only preview, or the same concept returned for an idempotent retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"A new editable concept plus import warnings, counts and retained structure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"An import with this Idempotency-Key is already running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File exceeds the import size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents":{"get":{"operationId":"listProjectDocuments","tags":["Projects"],"summary":"List the documents of a project","description":"Personal tokens only. The documents in the project's knowledge base, newest first, with their\nprocessing status. Audio memos (`kind: audio`) and transcripts (`kind: transcript`, `.vtt`/`.srt`)\ncarry `audio` and `subtitles` metadata once processed; `uploaded_by` is who uploaded the file.\n`q` filters on the filename (case-insensitive substring). Filtering on `kind` is left to the\nclient. `completeness.total` is the total under the filters.\n\nZoektermen (NL): Documenten en bestanden in een dossier bekijken.\n","x-prudai-search-terms":["Documenten en bestanden in een dossier bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProjectDocumentStatus"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"deleted","in":"query","required":false,"description":"`true` lists the trash (documents moved there with `deleteProjectDocument`) instead of the live documents.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"One page of documents.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"uploadProjectDocument","tags":["Projects"],"summary":"Upload one file into a project","description":"Personal tokens only; you must be the owner or an editor of the project\n(`403 project_write_required` otherwise, also for an ORDO dossier: upload there).\n`multipart/form-data` with exactly ONE part, the field `file`; any other field (such as\n`uploaded_by`) is refused with `422`. The uploader recorded in `uploaded_by` is always the\ntoken's user, never a value from the request. Accepted: the file types of the LEO upload\nexcept archives (no `.zip`), including audio memos (`.m4a`, `.webm`, `.mp3`, `.wav`, ...) and\ntranscripts (`.vtt`, `.srt`); maximum size as the LEO upload (`413 request_too_large`).\n`403 uploads_restricted` when your organisation has disabled uploads for the project's product.\nProcessing is asynchronous: the answer is the document with `status: pending`; poll\n`getProjectDocument` (in `next`) until `completed` or `failed`.\n\n**Idempotency.** `Idempotency-Key` is required (8 to 255 printable ASCII characters) and\nbelongs to the project. The same key with the same file (sha256 and size) returns the same\ndocument with `200` (the first answer was `201`); with a different file\n`422 idempotency_key_reused`; while the first request still runs\n`409 idempotency_request_in_progress`. A failed upload frees the key. Deleting the document\nfrees its keys too.\n\n`?dryRun=true` checks everything (rights, type, size, key) and returns what would be uploaded\n(`id: null`, `sha256`, `would_upload`) without storing anything.\n\nRuns directly, without an approval request: uploading into a project you may write to is\nyour own, reversible workspace (HITL rule set). A caller without the right gets the error\n(`404`/`403`).\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een bestand uploaden en document aan een dossier toevoegen.\n","x-prudai-search-terms":["Een bestand uploaden en document aan een dossier toevoegen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Adds a file to a project the person may write to; reversible (trash and restore). Rule set: own workspace."},"x-prudai-scopes":["prudai:projects:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The file; its multipart filename becomes the document name."}}},"encoding":{"file":{"contentType":"application/octet-stream"}}}}},"responses":{"200":{"description":"Replay of the same Idempotency-Key and file, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentResponse"}}}},"201":{"description":"Uploaded; processing started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentResponse"},"example":{"data":{"id":"0f0e0d0c-0000-4000-8000-000000000001","project_id":"83515397-a68e-45d8-8cb6-000000000001","filename":"memo-2026-10-29.m4a","kind":"audio","content_type":"audio/mp4","status":"pending","size_bytes":482113,"chunk_count":null,"original_available":true,"uploaded_by":{"name":"Voorbeeld Gebruiker","email":"gebruiker@example.com"},"subtitles":null,"audio":null,"created_at":"2026-10-29T08:00:00.000Z","updated_at":"2026-10-29T08:00:00.000Z"},"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a","dry_run":false},"completeness":{"total":1,"returned":1,"truncated":false},"notIncluded":[],"provenance":{},"next":[{"operationId":"getProjectDocument","method":"GET","path":"/v1/projects/83515397-a68e-45d8-8cb6-000000000001/documents/0f0e0d0c-0000-4000-8000-000000000001","params":{}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The same Idempotency-Key is still running (`idempotency_request_in_progress`), the project has no document store yet (`project_not_ready`, open it once in LEO), or the document service refuses the change right now (`document_conflict`, retry later).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}":{"get":{"operationId":"getProjectDocument","tags":["Projects"],"summary":"Get one document with its processing status","description":"Personal tokens only. Metadata and live status of one document of the project. A failed\ndocument says `status: failed` without the error text (it can quote content).\n`original_available: false` when the original file is no longer stored (the text may still be).\n\nZoektermen (NL): Een dossierdocument en verwerkingsstatus bekijken.\n","x-prudai-search-terms":["Een dossierdocument en verwerkingsstatus bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"}],"responses":{"200":{"description":"The document.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"deleteProjectDocument","tags":["Projects"],"summary":"Move a document to the trash (soft delete, restorable)","description":"Personal tokens only; owner or editor of the project. **A soft delete**: the document goes\nto the trash. It disappears from every document list, from search and from LEO chat (its\nsearch fragments are removed), but the record and the original stay, so\n`restoreProjectDocument` brings it back, as long as the original file is still stored\n(`restorable` says so; without a stored original the trash is a one-way door and only\n`purgeProjectDocument` remains). `listProjectDocuments?deleted=true` shows the\ntrash. Final removal happens only with `purgeProjectDocument` (from the trash) or after\nthe trash retention period. `?dryRun=true` shows what would be moved (`would_delete`,\n`restorable` and `irreversible` follow `original_available`) and changes nothing. Waits for a human\n(`review`): the first call answers `202` with an approval request; repeat\nthe exact call with `x-prudai-approval: apr_…` once a human approved it. A caller without\nthe right gets the error (`404`/`403`), never an approval request.\n\nZoektermen (NL): Een dossierdocument naar de prullenbak verplaatsen.\n","x-prudai-search-terms":["Een dossierdocument naar de prullenbak verplaatsen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:projects:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"},{"name":"dryRun","in":"query","required":false,"description":"Show what would be deleted without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"In the trash (`{id, deleted: true, restorable, deleted_at}`; `restorable` is false when the original is no longer stored), or a dry run (`{id, would_delete: true, restorable, irreversible, original_available, ...}`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentDeleteResponse"},"example":{"data":{"id":"0f0e0d0c-0000-4000-8000-000000000001","deleted":true,"restorable":true,"deleted_at":"2026-11-07T10:30:00Z"},"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a","dry_run":false},"completeness":{"total":1,"returned":1,"truncated":false},"notIncluded":[{"reason":"Het document staat in de prullenbak; terug te zetten met restore.","next":null}],"provenance":{},"next":[]}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The project has no document store yet (`project_not_ready`), or the document service refuses the change right now (`document_conflict`, the document is still being processed or its store is being removed; retry later).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/restore":{"post":{"operationId":"restoreProjectDocument","tags":["Projects"],"summary":"Restore a document from the trash","description":"Personal tokens only; owner or editor of the project. Takes a document out of the trash; the\ndocument service processes it again from the stored original (status `pending` until it is\n`completed`). `?dryRun=true` shows the document and changes nothing (200). Runs directly,\nwithout an approval request (own workspace). A caller without the right gets the error\n(`404`/`403`).\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een verwijderd dossierdocument herstellen.\n","x-prudai-search-terms":["Een verwijderd dossierdocument herstellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Brings back a trashed document in a project the person may write to. Rule set: own workspace."},"x-prudai-scopes":["prudai:projects:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"},{"name":"dryRun","in":"query","required":false,"description":"Show what would happen without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Restored: the document (status `pending`, `deleted_at: null`); processing is queued. Or a dry run (`would_restore: true`); nothing changed.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The document is not in the trash (`document_not_in_trash`), its original is no longer stored (`original_unavailable`, it stays in the trash), or the project has no document store yet (`project_not_ready`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/purge":{"post":{"operationId":"purgeProjectDocument","tags":["Projects"],"summary":"Delete a document from the trash for good","description":"Personal tokens only; owner or editor of the project. **Irreversible**: removes a document\nthat is already in the trash completely (record, text, search fragments, audio side files,\noriginal). A live document is refused (`409 document_not_in_trash`): delete it first.\n`?dryRun=true` shows what would disappear (`would_purge`, `irreversible: true`) and changes\nnothing. Waits for a human (`review`): the first call answers `202` with an approval request;\nrepeat the exact call with `x-prudai-approval: apr_…` once a human approved it (the approver\ngives a reason). A caller without the right gets the error (`404`/`403`), never an approval request.\n\nZoektermen (NL): Een dossierdocument definitief verwijderen uit de prullenbak.\n","x-prudai-search-terms":["Een dossierdocument definitief verwijderen uit de prullenbak"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Irreversible final removal from the trash; stricter than the POST default (confirm)."},"x-prudai-scopes":["prudai:projects:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"},{"name":"dryRun","in":"query","required":false,"description":"Show what would happen without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Purged (`{id, purged: true, restorable: false}`), or a dry run (`{id, would_purge: true, irreversible: true, ...}`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest; once the approval flow exists).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The document is not in the trash (`document_not_in_trash`), the document service refuses the change right now (`document_conflict`), or the project has no document store yet (`project_not_ready`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/text":{"get":{"operationId":"getProjectDocumentText","tags":["Projects"],"summary":"Get the extracted text (or transcript) of a document","description":"Personal tokens only. Plain text as the document service extracted it; for an audio memo\nthe transcript, for a `.vtt`/`.srt` the normalised transcript. `completeness` counts text\nfragments (`total` and `returned`) when the document service reports them, and\n`truncated: true` when the text is not complete; otherwise `total` is null and `notIncluded`\nsays so. Before processing has finished the text can be empty.\n\nZoektermen (NL): Tekst of transcript van een dossierdocument lezen.\n","x-prudai-search-terms":["Tekst of transcript van een dossierdocument lezen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"}],"responses":{"200":{"description":"The text.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocumentTextResponse"},"example":{"data":{"document_id":"0f0e0d0c-0000-4000-8000-000000000001","filename":"memo-2026-10-29.m4a","format":"text/plain","text":"Synthetische voorbeeldtekst van een transcript.","characters":47},"context":{"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"},"completeness":{"total":3,"returned":3,"truncated":false},"notIncluded":[],"provenance":{"unit":"chunks","source":"rag"},"next":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/original":{"get":{"operationId":"downloadProjectDocumentOriginal","tags":["Projects"],"summary":"Download the original file of a document (raw bytes)","description":"Personal tokens only. **Not the task envelope on success**: the body is the file itself,\n`Content-Type: application/octet-stream`, `Content-Disposition: attachment` with the\nfilename (`filename*=UTF-8''…`), `X-Content-Type-Options: nosniff`, `Cache-Control: no-store`\nand `Content-Length` when known. Save it to a file; never render it. Errors are the normal\nenvelope: `404 original_unavailable` when the original is no longer stored (purged by the\nretention policy or missing; the text may still be readable), `413 request_too_large` above\nthe upload size limit. A transfer that breaks after the first byte ends in a cut connection\n(compare `Content-Length`), never in a file with an error appended.\n\nZoektermen (NL): Het oorspronkelijke dossierbestand downloaden.\n","x-prudai-search-terms":["Het oorspronkelijke dossierbestand downloaden"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"$ref":"#/components/parameters/ProjectDocumentId"}],"responses":{"200":{"x-prudai-envelope-exception":{"reason":"File download: the response is the bytes of the original document, not JSON."},"description":"The original file.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Content-Disposition":{"description":"`attachment; filename=\"<ascii fallback>\"; filename*=UTF-8''<percent-encoded name>`","schema":{"type":"string"}},"Content-Length":{"description":"Size in bytes, when the document service reports it.","schema":{"type":"integer","minimum":0}},"X-Content-Type-Options":{"schema":{"type":"string","enum":["nosniff"]}},"Cache-Control":{"schema":{"type":"string","enum":["no-store"]}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"413":{"description":"The original is larger than the download limit (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/DocumentServiceFailed"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/anonymization":{"post":{"operationId":"analyzeProjectDocumentAnonymization","tags":["Projects"],"summary":"Find personal data in a document (anonymization analysis)","description":"Personal tokens only; the same read right as the document. Analyses the document's original\n(`.docx`, `.pdf`, `.txt`, `.md`) for personal data and returns the findings per type, each with a\nconfidence and a `band` (`high`/`low`). Nothing is stored and nothing changes.\n\nRecognition runs locally (no external API): layer 1 are patterns with a check (BSN 11-proef, IBAN\nmod-97, e-mail, phone NL and international, KvK, postcode with house number, date of birth, licence\nplate, case and reference numbers plus the organisation's own patterns), layer 2 is named-entity\nrecognition (Presidio with a Dutch spaCy model) for persons, organisations and addresses. With\n`include_ai: true` an AI pass (Google Vertex AI, EU) suggests INDIRECT identifiers (a unique role,\na rare combination) with an explanation; a human decides. A scanned PDF without a text layer is\nreported in `warnings` (`scanned_pdf_no_text_layer`), never skipped silently.\n\nUse the finding `id`s with `createProjectDocumentAnonymizedCopy`. This is an aid, not a guarantee:\nthe copy is \"geanonimiseerd, controleer vóór gebruik\", not \"AVG-anoniem\".\n\nZoektermen (NL): Persoonsgegevens in een document vinden.\n","x-prudai-search-terms":["Persoonsgegevens in een document vinden"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leesactie via POST: analyseert het document, slaat niets op en wijzigt niets."},"x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"include_ai":{"type":"boolean","description":"Also ask the AI pass (Vertex AI, EU) for indirect identifiers. Default false."}}}}}},"responses":{"200":{"description":"The findings per type.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"413":{"description":"The original is too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Not a supported format (`unsupported_format`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/anonymized-copy":{"post":{"operationId":"createProjectDocumentAnonymizedCopy","tags":["Projects"],"summary":"Create an anonymized copy of a document (new file next to the original)","description":"Personal tokens only; you must be the owner or an editor of the project. Creates a NEW document\n`<name>_geanonimiseerd.<ext>` in the same project; the original stays unchanged. Every chosen\nvalue is replaced by a fixed label (`[PERSOON_1]`, `[ORGANISATIE_A]`, `[BSN]`, …), consistent within\nthe document; the mapping label ↔ value is never stored. `.docx`: tracked changes are accepted,\ncomments, hidden text, document properties and embedded objects removed, also in tables, headers,\nfooters and text boxes. `.pdf`: text is really removed (redaction), metadata and annotations too.\nA final check refuses the copy when a chosen value is still readable anywhere in the file.\n\nChoose with `accept`: `high` (default) takes all high-confidence findings of a fresh analysis,\n`all` takes all, `ids` exactly `finding_ids` (from `analyzeProjectDocumentAnonymization`). Add text\nthe recognition missed with `manual`. A PDF with pages without a text layer needs\n`acknowledge_untexted_pages: true`; a fully scanned PDF is refused (`scanned_pdf_no_text_layer`).\n\n**Idempotency.** `Idempotency-Key` is required, as for `uploadProjectDocument`.\n`?dryRun=true` returns what would be created (`would_create`, `selected`) without storing anything.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the\nexact call with `x-prudai-approval: apr_…` once a human approved it.\n\nThis is a \"geanonimiseerde kopie, controleer vóór gebruik\": no claim that it is anonymous under the GDPR.\n\nZoektermen (NL): Een geanonimiseerde kopie van een document maken.\n","x-prudai-search-terms":["Een geanonimiseerde kopie van een document maken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:projects:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"accept":{"type":"string","enum":["high","all","ids"],"default":"high"},"finding_ids":{"type":"array","maxItems":2000,"items":{"type":"string"}},"manual":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"type":{"type":"string","enum":["person","organization","address","bsn","iban","email","phone","kvk","postal_code","date_of_birth","license_plate","reference","indirect_identifier","other"]},"value":{"type":"string","minLength":2,"maxLength":500}}}},"include_ai":{"type":"boolean"},"acknowledge_untexted_pages":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Replay of the same Idempotency-Key, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"The copy was created; processing started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The same Idempotency-Key is still running (`idempotency_request_in_progress`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/form-fields":{"get":{"operationId":"getProjectDocumentFormFields","tags":["Projects"],"summary":"Recognise the fields of a PDF form","description":"Personal tokens only; the same read right as the document. Reads the PDF and returns its form\nfields (`kind: acroform`): name, type (`text`, `checkbox`, `radio`, `dropdown`, `option_list`,\n`signature`, `button`), the label a person reads next to the field (tooltip, else the nearest\nprinted text), page and position, current value, options, `required`, `read_only`, `max_length`,\n`fillable` and `suggested_profile_key` (for example `kvk_number`, `vat_number`, `legal_name`,\n`birth_date`) as a suggestion for the value from the form profile. A PDF without fields\n(`kind: flat`) returns text `anchors` (id, page, text, position) to place text next to.\nNothing is stored and nothing changes.\n\nEncrypted PDFs and XFA-only forms are refused (`422`, `encrypted` / `xfa_only`); a scan without\na text layer is reported in `warnings` (`no_text_layer`). Fill the form with\n`createProjectDocumentFilledCopy`.\n\nZoektermen (NL): Velden van een PDF-formulier herkennen.\n","x-prudai-search-terms":["Velden van een PDF-formulier herkennen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:projects:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The form fields, or the text anchors of a flat PDF.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"413":{"description":"The PDF is too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Not a PDF (`unsupported_format`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/projects/{project_id}/documents/{document_id}/filled-copy":{"post":{"operationId":"createProjectDocumentFilledCopy","tags":["Projects"],"summary":"Fill a PDF form into a new copy (new file next to the original)","description":"Personal tokens only; you must be the owner or an editor of the project. Creates a NEW document\n`<name>_ingevuld.pdf` in the same project; the original stays unchanged. `values` maps a field\nname from `getProjectDocumentFormFields` to its value (checkbox `true`/`false`; radio, dropdown\nand option list one of its `options`). For a PDF without fields, `overlays` place text next to an\nanchor (`anchor_id` or `anchor_text`, `position` `right` or `below`) or at `page`/`x`/`y` in PDF\npoints from the bottom-left. The fields stay editable so a person can check and correct the copy\nbefore use; `flatten: true` makes them final.\n\nThe response `report` says what was filled, what was skipped and why (`unknown_field`,\n`read_only`, `signature_not_supported`, `not_one_of_the_options`, `longer_than_max_length_<n>`,\n`unsupported_characters`, …), which required fields stay empty, and whether the copy was read\nback with every value in place (`verified`). Signatures are never set.\n\n**Idempotency.** `Idempotency-Key` is required, as for `uploadProjectDocument`.\n`?dryRun=true` returns the report of a trial fill (`would_create`) without storing anything.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the\nexact call with `x-prudai-approval: apr_…` once a human approved it.\n\nZoektermen (NL): Een PDF-formulier invullen.\n","x-prudai-search-terms":["Een PDF-formulier invullen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:projects:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProjectId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"values":{"type":"object","description":"Field name → value as text; a checkbox takes \"true\"/\"false\" (or ja/nee). JSON booleans and numbers are accepted too.","maxProperties":300,"additionalProperties":{"type":"string","maxLength":2000}},"overlays":{"type":"array","maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":2000},"anchor_id":{"type":"string","maxLength":20},"anchor_text":{"type":"string","maxLength":200},"position":{"type":"string","enum":["right","below"]},"page":{"type":"integer","minimum":1},"x":{"type":"number"},"y":{"type":"number"},"size":{"type":"number","minimum":6,"maximum":24}}}},"flatten":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Replay of the same Idempotency-Key, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"The filled copy was created; processing started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/ProjectNotFound"},"409":{"description":"The same Idempotency-Key is still running (`idempotency_request_in_progress`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Not a PDF (`unsupported_format`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/sync-status":{"get":{"operationId":"getTwakaSyncStatus","tags":["Twaka"],"summary":"How fresh is the Twaka data (last change per table)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nLatest `Modified`/`Created` per core table (invoices, orders, relations, batches, registrations) and the sync schedule.\n\nZoektermen (NL): Twaka-versheid, wanneer is Twaka bijgewerkt.\n","x-prudai-search-terms":["Twaka-versheid, wanneer is Twaka bijgewerkt"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/invoices":{"get":{"operationId":"listTwakaInvoices","tags":["Twaka"],"summary":"List Twaka invoices per debtor and period (open, paid, credit)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nFilters: `debtor_number` or `relation_id`, invoice date `from`/`to`, `status` open (open amount ≠ 0), paid, credit or all. Per invoice: number, dates, amounts incl./excl. VAT, open amount, credit link, raw `status_code`/`type_code` and the relation.\n\nZoektermen (NL): Openstaande facturen per debiteur, gecrediteerde facturen, facturen in Twaka.\n","x-prudai-search-terms":["Openstaande facturen per debiteur, gecrediteerde facturen, facturen in Twaka"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"debtor_number","in":"query","required":false,"description":"Debtor number of the relation.","schema":{"type":"string"}},{"name":"relation_id","in":"query","required":false,"description":"Twaka relation id.","schema":{"type":"integer"}},{"name":"from","in":"query","required":false,"description":"Invoice date from (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Invoice date to (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","required":false,"description":"open, paid, credit or all (default).","schema":{"type":"string","enum":["open","paid","credit","all"]}},{"name":"limit","in":"query","required":false,"description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"Offset.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/invoices/{invoice_number}":{"get":{"operationId":"getTwakaInvoice","tags":["Twaka"],"summary":"One Twaka invoice with lines and VAT per rate","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nThe invoice by its number, with up to 500 lines (article, quantities, kg, price, total, VAT %, order and customer reference) and the VAT summary per rate. No PDF (Twaka keeps none).\n\nZoektermen (NL): Factuur opzoeken, factuurregels en BTW bekijken.\n","x-prudai-search-terms":["Factuur opzoeken, factuurregels en BTW bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"invoice_number","in":"path","required":true,"description":"Twaka invoice number.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/invoice-matches":{"get":{"operationId":"matchTwakaPayment","tags":["Twaka"],"summary":"Which invoices belong to this payment (candidates with a score)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nGive a payment `amount`, the payment `reference` (description/specification text; invoice numbers in it are recognised), optionally `debtor_number` and `date`. Returns up to 25 candidate invoices with a score (0-100) and the reasons. Combinations of several invoices and booking are done by the settlement proposal in MAIA (Exact).\n\nZoektermen (NL): Betaling aan factuur koppelen, afletteren voorbereiden, welke factuur hoort bij deze betaling.\n","x-prudai-search-terms":["Betaling aan factuur koppelen, afletteren voorbereiden, welke factuur hoort bij deze betaling"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"amount","in":"query","required":false,"description":"Payment amount in euro (e.g. 1234.56).","schema":{"type":"number"}},{"name":"reference","in":"query","required":false,"description":"Payment description or specification text.","schema":{"type":"string","maxLength":500}},{"name":"debtor_number","in":"query","required":false,"description":"Debtor number, if known.","schema":{"type":"string"}},{"name":"date","in":"query","required":false,"description":"Payment date (YYYY-MM-DD); without a debtor, amount matches are searched in the 400 days before it.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/relations":{"get":{"operationId":"listTwakaRelations","tags":["Twaka"],"summary":"Find Twaka relations (customers, suppliers) by debtor number or name","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nSearch by `debtor_number` or `q` (name, code or debtor number). Per relation: code, name, debtor/creditor number, customer/supplier flags, blocked, billing city.\n\nZoektermen (NL): Klant opzoeken in Twaka, debiteurnummer zoeken.\n","x-prudai-search-terms":["Klant opzoeken in Twaka, debiteurnummer zoeken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"debtor_number","in":"query","required":false,"description":"Exact debtor number.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Name, code or debtor number (min. 2 characters).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"Offset.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/relations/{relation_id}":{"get":{"operationId":"getTwakaRelation","tags":["Twaka"],"summary":"One Twaka relation with its contact persons (invoice contact first)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nThe relation and its active contact persons: name, e-mail, phone and roles (invoice, purchase, quality, general). Nothing else about contacts is copied.\n\nZoektermen (NL): Factuurcontactpersoon bij debiteur, contactpersoon opzoeken.\n","x-prudai-search-terms":["Factuurcontactpersoon bij debiteur, contactpersoon opzoeken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"relation_id","in":"path","required":true,"description":"Twaka relation id.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/orders":{"get":{"operationId":"listTwakaOrders","tags":["Twaka"],"summary":"List Twaka orders by customer reference, delivered but not invoiced, or stuck in a status","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nFilters: `customer_reference`, `debtor_number`, `uninvoiced=true` (sales order delivered, no invoice, not cancelled), `status_code` with `older_than_days` (orders that hang), delivery date `from`/`to`.\n\nZoektermen (NL): Orderstatus, geleverd maar niet gefactureerd, welke orders hangen.\n","x-prudai-search-terms":["Orderstatus, geleverd maar niet gefactureerd, welke orders hangen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"customer_reference","in":"query","required":false,"description":"Customer reference on the order.","schema":{"type":"string"}},{"name":"debtor_number","in":"query","required":false,"description":"Debtor number.","schema":{"type":"string"}},{"name":"uninvoiced","in":"query","required":false,"description":"Only delivered sales orders without an invoice.","schema":{"type":"boolean"}},{"name":"status_code","in":"query","required":false,"description":"Twaka order status code.","schema":{"type":"integer"}},{"name":"older_than_days","in":"query","required":false,"description":"Status unchanged for more than this many days.","schema":{"type":"integer","minimum":1}},{"name":"from","in":"query","required":false,"description":"Delivery date from (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Delivery date to (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","required":false,"description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"Offset.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/orders/{order_id}/history":{"get":{"operationId":"getTwakaOrderHistory","tags":["Twaka"],"summary":"Status history of one Twaka order","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nEvery status change of the order with its date (up to 200).\n\nZoektermen (NL): Statusverloop order, hoe lang stond de order in productie.\n","x-prudai-search-terms":["Statusverloop order, hoe lang stond de order in productie"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"description":"Twaka order id.","schema":{"type":"integer"}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/revenue":{"get":{"operationId":"getTwakaRevenue","tags":["Twaka"],"summary":"Revenue per customer, article or main group over a period (vs. previous year)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nSum of invoice line totals (sales invoices, by invoice date, credits included) per `group_by` over `from`-`to` (max. 400 days), with kg and number of invoices, sorted by revenue. `compare=previous_year` adds the same period a year earlier. Margin is not included (no reliable cost price in Twaka).\n\nZoektermen (NL): Omzet per klant, omzet per artikel, omzet per artikelgroep, vergelijken met vorig jaar.\n","x-prudai-search-terms":["Omzet per klant, omzet per artikel, omzet per artikelgroep, vergelijken met vorig jaar"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"group_by","in":"query","required":true,"description":"customer, article or main_group.","schema":{"type":"string","enum":["customer","article","main_group"]}},{"name":"from","in":"query","required":true,"description":"From (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"description":"To (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"compare","in":"query","required":false,"description":"previous_year.","schema":{"type":"string","enum":["previous_year"]}},{"name":"limit","in":"query","required":false,"description":"Number of groups.","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/article-prices":{"get":{"operationId":"getTwakaArticlePrices","tags":["Twaka"],"summary":"Price and margin per article over a period, with cost price coverage","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nPer article (sales invoices, by invoice date, credits included, max. 400 days): revenue, kg, quantity in the price unit, average/min/max price, number of invoices and customers. Optional filter on main group or debtor number. Margin only where Twaka has a cost price (`Article.PurchasePrice` > 0); `cost_coverage` reports how many articles and which share of revenue have one. No estimated margins.\n\nZoektermen (NL): Prijs per artikel, marge per artikel, gemiddelde verkoopprijs, kostprijs, prijsontwikkeling, rapportage artikelen.\n","x-prudai-search-terms":["Prijs per artikel, marge per artikel, gemiddelde verkoopprijs, kostprijs, prijsontwikkeling, rapportage artikelen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"from","in":"query","required":true,"description":"From (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"description":"To (YYYY-MM-DD).","schema":{"type":"string","format":"date"}},{"name":"main_group_id","in":"query","required":false,"description":"Only articles of this main group (id from getTwakaRevenue group_by=main_group).","schema":{"type":"integer","minimum":0}},{"name":"debtor_number","in":"query","required":false,"description":"Only sales to this debtor.","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Number of articles.","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/twaka/batches/{batch}/trace":{"get":{"operationId":"traceTwakaBatch","tags":["Twaka"],"summary":"Trace a batch to the orders, customers and invoices did it go (recall, HACCP)","description":"Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection `403 twaka_not_connected`. Data from the nightly replica (04:30), never live from the customer server.\nBy batch id or external batch code: registrations of the batch grouped per order, customer, article and invoice (kg and count), plus what is not on an order yet.\n\nZoektermen (NL): Tracering batch, terugroepactie, bij welke klanten is deze batch geleverd.\n","x-prudai-search-terms":["Tracering batch, terugroepactie, bij welke klanten is deze batch geleverd"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:twaka:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"batch","in":"path","required":true,"description":"Batch id or external batch code.","schema":{"type":"string"}}],"responses":{"200":{"description":"The result.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-proposals":{"get":{"operationId":"listExactSettlementProposals","tags":["Exact settlements"],"summary":"List settlement proposals (afletter-voorstellen) and whether you may decide them","description":"Personal tokens only; MAIA with an Exact Online connection (`404 exact_not_available` otherwise).\nDefault `status=proposed,approved` (waiting for approval, or approved but not yet booked). Per proposal:\ncounts (specification lines, items to settle), `can_decide` and `decide_blocked_reason`\n(`exact_proposal_self_approval`: you asked for it yourself, another approver decides). No invoice lines or amounts, except `bank_difference` (bank minus specification total in cents, the account and the limit; `null` = exact receipt).\n`writeback` per proposal: `state` (`waiting`: approved, booked in Exact as soon as write-back is on;\n`booked`; `needs_review`: not booked because it no longer matches Exact, review again; `failed`; `retry_later`)\nand a plain-language `message`.\n\nZoektermen (NL): Afletter-voorstellen bekijken, wachtende betalingen afletteren.\n","x-prudai-search-terms":["Afletter-voorstellen bekijken, wachtende betalingen afletteren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_settlements:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Comma-separated statuses (proposed, approved, rejected, executed, failed).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The proposals.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createExactSettlementProposal","tags":["Exact settlements"],"summary":"Offer a payment specification (PDF); MAIA makes the settlement proposal","description":"Personal tokens only. `multipart/form-data` with one PDF in `file` (at most 25 MB) and optionally `division`\n(default: the primary administration). The proposal is made in your name, so you can never approve it yourself\n(four-eyes); the approvers of the organisation get a notification. The same PDF or specification number again\nreturns the existing proposal (`outcome: existing`). When no proposal can be made (no text layer, the sum does\nnot match, the payment is not yet in Exact) `outcome: blocked` with the reasons in `blockers`, and nothing is stored.\nNothing is written to Exact.\n\n`?dryRun=true` only checks the PDF against the administration and stores nothing (`outcome: would_propose` or `blocked`).\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request (the PDF bytes are part\nof what is approved); repeat the exact call with `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Betaalspecificatie aanbieden, verzamelbetaling afletteren, specificatie uploaden.\n","x-prudai-search-terms":["Betaalspecificatie aanbieden, verzamelbetaling afletteren, specificatie uploaden"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_settlements:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The payment specification (PDF)."},"division":{"type":"integer","description":"Administration code; default the primary administration."}}},"encoding":{"file":{"contentType":"application/pdf"}}}}},"responses":{"200":{"description":"Existing proposal, blocked, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"A new proposal was made.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A demo organisation has no live Exact administration (`exact_demo_mode`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"The file is not a PDF (`exact_settlement_not_pdf`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-proposals/{proposal_id}":{"get":{"operationId":"getExactSettlementProposal","tags":["Exact settlements"],"summary":"One settlement proposal","description":"Personal tokens only. Status, counts, the plain-language rationale and whether you may decide it.\n\nZoektermen (NL): Eén afletter-voorstel bekijken.\n","x-prudai-search-terms":["Eén afletter-voorstel bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_settlements:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The proposal.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-proposals/decisions":{"post":{"operationId":"decideExactSettlementProposals","tags":["Exact settlements"],"summary":"Approve, reject or send again one or more settlement proposals","description":"Personal tokens only. `action`: `approve`, `reject` or `execute` (send an approved proposal to Exact again), for\nup to 50 `proposal_ids`, one after the other. Approve and execute: only an approver of your own organisation\n(the designated approvers, or without designation an owner/admin), never for a proposal you asked for yourself\n(four-eyes); such a proposal gets `outcome: skipped` with the reason in `error_code`. Each approved proposal is\nbooked on its own, fail-closed, and only when writing to Exact is switched on for the organisation;\notherwise `outcome: writeback_disabled` (approved, not booked). Such a proposal is booked automatically, in\norder of approval and with the same approval, as soon as write-back is switched on for the organisation; right\nbefore booking it is checked again against Exact (invoices still open, not processed yet, period not closed,\napproval not expired). No longer matching: not booked, `writeback.state: needs_review`. `execute` still works.\nWhen you may decide none of them: `403` with the reason, before any approval request.\n\n`?dryRun=true` shows per proposal what would happen.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Afletter-voorstellen goedkeuren, geselecteerde goedkeuren, afwijzen, opnieuw versturen.\n","x-prudai-search-terms":["Afletter-voorstellen goedkeuren, geselecteerde goedkeuren, afwijzen, opnieuw versturen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_settlements:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action","proposal_ids"],"properties":{"action":{"type":"string","enum":["approve","reject","execute"]},"proposal_ids":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","format":"uuid"}},"note":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"The outcome per proposal.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-readiness":{"get":{"operationId":"getExactSettlementReadiness","tags":["Exact settlements"],"summary":"Ready to book? Writing switched on, memorial right in Exact, approvers","description":"Personal tokens only; read only. `writeback_enabled` (writing to Exact switched on for the organisation),\n`memorial_right` (the connection user may create memorial entries, measured live in Exact; `null` = cannot be\nmeasured now), the approvers and `ready_to_book`. Exact does not report the matching right separately.\n\nZoektermen (NL): Klaar om af te letteren, rechten in Exact controleren.\n","x-prudai-search-terms":["Klaar om af te letteren, rechten in Exact controleren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_settlements:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"division","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The readiness.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-parked":{"get":{"operationId":"listExactSettlementParked","tags":["Exact settlements"],"summary":"Parking list per payer (debit notes waiting for your credit note)","description":"Personal tokens only; read only. Debit notes the payer deducted on a collective payment, without a counter item\nof your own yet (\"parked\"), per payer, with candidate credit notes: open credit notes of the payer with exactly\nthe same amount (one that mentions the debit note number first). MAIA never chooses; `next` suggests a release\nonly for items with exactly one candidate.\n\nZoektermen (NL): Parkeerlijst debetnota's, geparkeerde debetnota's per betaler.\n","x-prudai-search-terms":["Parkeerlijst debetnota's, geparkeerde debetnota's per betaler"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_settlements:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"division","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The parking list.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-parked/release":{"post":{"operationId":"releaseExactSettlementParked","tags":["Exact settlements"],"summary":"Settle parked debit notes with the chosen credit notes (new proposal)","description":"Personal tokens only. Up to 50 parked debit notes of one administration, each with one of its candidate credit\nnotes (`journal` + `entry`). Creates ONE new settlement proposal (memorial: debit the debtor, credit the account\nthe debit note is held on; then a match set credit note ↔ memorial line per relation). Nothing is written to\nExact; an approver who is not you approves it (four-eyes). Items that cannot be released are returned in\n`skipped` with the reason.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Debetnota afletteren met creditnota, geparkeerde posten vrijgeven.\n","x-prudai-search-terms":["Debetnota afletteren met creditnota, geparkeerde posten vrijgeven"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_settlements:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["key","credit_note"],"properties":{"key":{"type":"string"},"credit_note":{"type":"object","additionalProperties":false,"required":["journal","entry"],"properties":{"journal":{"type":"string"},"entry":{"type":"string"}}}}}}}}}}},"responses":{"200":{"description":"Nothing to release (all skipped).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"The release proposal.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-proposals/{proposal_id}/booking":{"patch":{"operationId":"updateExactSettlementBooking","tags":["Exact settlements"],"summary":"Change the booking period of a settlement proposal before approval","description":"Personal tokens only. The proposer or an approver of your own organisation, only while the proposal is open\n(`409` after a decision). The booking date becomes the bank date when it falls in the chosen period, otherwise\nthe nearest day of that period. Who, when and from which period is kept on the proposal; `booking.warnings`\nflags a closed period, a period other than the bank receipt's, a period before or after the current one.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Boekingsperiode aanpassen, periode van het memoriaal wijzigen.\n","x-prudai-search-terms":["Boekingsperiode aanpassen, periode van het memoriaal wijzigen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_settlements:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["fin_year","fin_period"],"properties":{"fin_year":{"type":"integer","minimum":2000,"maximum":2100},"fin_period":{"type":"integer","minimum":1,"maximum":13}}}}}},"responses":{"200":{"description":"The proposal with its new booking.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/settlement-settings":{"get":{"operationId":"getExactSettlementSettings","tags":["Exact settlements"],"summary":"Settlement settings (debit-note account, closed through, bank-difference tolerance)","description":"Personal tokens only; read only. `parking_gl`: the general ledger account on which MAIA books the payer's\ndebit notes, one line per debit note (`null` = they stay on the payment's clearing account and only appear on\nthe parking list). `closed_through`: bookings up to and including this year/period count as closed (Exact does\nnot report period closing through its API). `current_period` from Exact's period table (or calendar months).\n`bank_difference_max_cents` + `bank_difference_gl`: bank-difference tolerance, off by default (`null`). When no\nreceipt matches the specification total exactly but exactly one receipt of the payer differs by at most this\nmany cents (inclusive, both directions), that receipt becomes the payment; \"Totaal betalingen\" stays the\nspecification total and the difference is a separate journal line \"Bankverschil\" on `bank_difference_gl`.\nAbove the limit nothing changes. `updated_by_user_id` / `updated_at`: who last changed the settings, and when.\n\nZoektermen (NL): Afletterinstellingen, tussenrekening debetnota's, afgesloten periode, bankverschil, tolerantie.\n","x-prudai-search-terms":["Afletterinstellingen, tussenrekening debetnota's, afgesloten periode, bankverschil, tolerantie"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_settlements:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"division","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The settings.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"put":{"operationId":"updateExactSettlementSettings","tags":["Exact settlements"],"summary":"Change the settlement settings (owner or admin)","description":"Personal tokens only; an owner or admin of your own organisation. `parking_gl` must exist and not be blocked in\nthe administration; `null` switches separate debit-note booking off. `bank_difference_max_cents` (1 to 100000,\nin cents; `null` = off) and `bank_difference_gl` (must exist and not be blocked) set the bank-difference\ntolerance; set both or neither (otherwise `422`), and not the receivables or clearing account itself. Omitted\nfields stay as they are.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Tussenrekening debetnota's instellen, afgesloten t/m instellen, bankverschil-tolerantie instellen.\n","x-prudai-search-terms":["Tussenrekening debetnota's instellen, afgesloten t/m instellen, bankverschil-tolerantie instellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_settlements:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"division":{"type":"integer"},"parking_gl":{"type":["string","null"],"maxLength":20},"closed_through":{"type":["object","null"],"additionalProperties":false,"required":["fin_year","fin_period"],"properties":{"fin_year":{"type":"integer","minimum":2000,"maximum":2100},"fin_period":{"type":"integer","minimum":1,"maximum":13}}},"bank_difference_max_cents":{"type":["integer","null"],"minimum":1,"maximum":100000},"bank_difference_gl":{"type":["string","null"],"maxLength":20}}}}}},"responses":{"200":{"description":"The settings after the change.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/integrations/{provider}/administrations":{"get":{"operationId":"listIntegrationAdministrations","tags":["Integration administrations"],"summary":"List the administrations of a bookkeeping koppeling","description":"Personal tokens only; every member with MAIA and the koppeling. Per administration (Moneybird) or division\n(Exact Online): `linked`, `state` (`active`, `unlinked`, `needs_attention`, `not_connected`), `source`\n(`managed` = set up by Prudai, can be switched off but not removed; `org` = added by the organisation),\n`last_check_at`/`last_check_status` and, for Exact, `last_sync_at`. `can_manage` says whether the token user may\nchange anything. API tokens are never returned. Exact divisions are managed on the Exact Online connection page\n(`manage_path`).\n\nZoektermen (NL): Administraties van de koppeling bekijken, welke administraties zijn gekoppeld, holding gekoppeld.\n","x-prudai-search-terms":["Administraties van de koppeling bekijken, welke administraties zijn gekoppeld, holding gekoppeld"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:integration_administrations:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["moneybird","exact"]}}],"responses":{"200":{"description":"OK.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createIntegrationAdministration","tags":["Integration administrations"],"summary":"Add an administration with its own API token (owner or admin)","description":"Moneybird only. Personal tokens only; an owner or admin of your own organisation. Create a personal API token in\nMoneybird (Instellingen → Koppelingen → Externe applicaties; rights \"Alleen lezen\" is enough and advised) in the\nadministration you want to link, and send it as `token`. The token decides which administration it is; when it\nsees more than one, the answer is 422 `administration_choice_required` with the choices and you repeat with\n`administration_id`. The token is stored encrypted and never returned.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Administratie koppelen, holding koppelen, Moneybird-administratie toevoegen.\n","x-prudai-search-terms":["Administratie koppelen, holding koppelen, Moneybird-administratie toevoegen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:integration_administrations:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["moneybird","exact"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token"],"properties":{"token":{"type":"string","minLength":1,"maxLength":400,"writeOnly":true},"administration_id":{"type":"string","pattern":"^\\d{1,24}$"}}}}}},"responses":{"201":{"description":"The administration is linked.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/integrations/{provider}/administrations/{administration_id}":{"delete":{"operationId":"deleteIntegrationAdministration","tags":["Integration administrations"],"summary":"Remove an administration the organisation added itself (soft delete)","description":"Moneybird only. Personal tokens only; an owner or admin of your own organisation. Only administrations with\n`source: org`; one set up by Prudai can be switched off instead (409 `managed_cannot_delete`). Restorable with\n`restoreIntegrationAdministration`.\n\nWaits for a reviewer (`review`): another owner or admin approves with a reason.\n\nZoektermen (NL): Administratie verwijderen uit de koppeling.\n","x-prudai-search-terms":["Administratie verwijderen uit de koppeling"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:integration_administrations:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["moneybird","exact"]}},{"name":"administration_id","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,24}$"}}],"responses":{"200":{"description":"OK.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"patch":{"operationId":"updateIntegrationAdministration","tags":["Integration administrations"],"summary":"Link or unlink an administration (owner or admin)","description":"Moneybird only. Personal tokens only; an owner or admin of your own organisation. `linked: false` switches the\nadministration off for MAIA in the whole organisation (chat, reports, source links); `true` switches it on again.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Administratie ontkoppelen, administratie weer koppelen.\n","x-prudai-search-terms":["Administratie ontkoppelen, administratie weer koppelen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:integration_administrations:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["moneybird","exact"]}},{"name":"administration_id","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,24}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["linked"],"properties":{"linked":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/integrations/{provider}/administrations/{administration_id}/restore":{"post":{"operationId":"restoreIntegrationAdministration","tags":["Integration administrations"],"summary":"Restore a removed administration (owner or admin)","description":"Moneybird only. Personal tokens only; an owner or admin of your own organisation. Puts back the last removed\nadministration with this id (with its stored token), linked as it was.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Verwijderde administratie terugzetten.\n","x-prudai-search-terms":["Verwijderde administratie terugzetten"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:integration_administrations:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["moneybird","exact"]}},{"name":"administration_id","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,24}$"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"OK.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/data":{"delete":{"operationId":"deleteExactData","tags":["Exact connection"],"summary":"Delete all Exact Online data (Exact-data wissen)","description":"Personal tokens only; owner or admin. Disconnects and permanently deletes the organisation's synced copy of\nExact Online with what was derived from it (findings, proposals, agreements, budgets, forecasts), uploaded\npayment specifications, the choice of administrations and the stored connection. Not reversible: a new\nconnection starts with an empty copy. Backups expire within 80 days. Conversations and entries already booked\nin Exact Online are not touched. `?dryRun=true` only counts what would be deleted. `409 exact_busy`: a job is\nstill running (the access keys are already removed); repeat in a few minutes.\n\nWaits for a reviewer (`review`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Exact-data wissen, gegevens uit Exact Online verwijderen.\n","x-prudai-search-terms":["Exact-data wissen, gegevens uit Exact Online verwijderen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:exact_connection:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Deleted, or the preview with dryRun.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/connection":{"get":{"operationId":"getExactConnection","tags":["Exact connection"],"summary":"Exact Online connection of the organisation (app, state, administrations)","description":"Personal tokens only; read only. Which Exact app serves the organisation (`org` = its own app, `prudai` = the\napp of Prudai), whether a grant is stored, whether administrations still have to be chosen, and the state of\neach chosen administration. Never a token. MAIA with the Exact Online capability (`404 exact_not_available`\notherwise).\n\nZoektermen (NL): Exact-koppeling bekijken, staat van de koppeling met Exact Online.\n","x-prudai-search-terms":["Exact-koppeling bekijken, staat van de koppeling met Exact Online"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_connection:read"],"security":[{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"The connection.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"delete":{"operationId":"deleteExactConnection","tags":["Exact connection"],"summary":"Disconnect Exact Online (Ontkoppelen)","description":"Personal tokens only; owner or admin. Wipes the stored tokens and marks every administration disconnected; the\nchoice of administrations and the data already fetched stay. Restore = connect again (`startExactConnection` or\n`createExactInvite`).\n\nWaits for a reviewer (`review`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Exact ontkoppelen, koppeling met Exact Online verbreken.\n","x-prudai-search-terms":["Exact ontkoppelen, koppeling met Exact Online verbreken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:exact_connection:delete"],"security":[{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"Disconnected.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/connection/authorize":{"post":{"operationId":"startExactConnection","tags":["Exact connection"],"summary":"Start connecting Exact Online (authorise URL for a person)","description":"Personal tokens only; owner or admin. Returns `authorize_url`: a PERSON opens it within 10 minutes, logs in at\nExact Online (password, MFA) and gives consent; an agent cannot finish this step. Afterwards choose the\nadministrations with `updateExactDivisions` (a connection that already has a choice is restored as it was).\n`409 exact_not_configured` when no Exact app exists for the organisation yet.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Verbinden met Exact Online, Exact koppelen.\n","x-prudai-search-terms":["Verbinden met Exact Online, Exact koppelen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_connection:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"The authorise URL.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/invites":{"post":{"operationId":"createExactInvite","tags":["Exact connection"],"summary":"Invite the person with the Exact login to connect (Uitnodiging sturen)","description":"Personal tokens only; owner or admin. Creates a single-use link (default 7 days, at most 30) that lets the\nrecipient, for example the accountant, log in at Exact Online and connect the organisation without a Prudai\naccount. With `email` the platform mails the link (`email_sent`). Afterwards an owner or admin chooses the\nadministrations.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Uitnodiging sturen voor Exact Online, boekhouder laten koppelen.\n","x-prudai-search-terms":["Uitnodiging sturen voor Exact Online, boekhouder laten koppelen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_connection:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"email":{"type":"string","format":"email","maxLength":254},"ttl_days":{"type":"integer","minimum":1,"maximum":30}}}}}},"responses":{"200":{"description":"The invite.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/feature":{"get":{"operationId":"getExactFeature","tags":["Exact connection"],"summary":"Whether the Exact Online function is on for the organisation","description":"Personal tokens only; read only. `enabled` says whether Exact Online is switched on within the organisation's\nactive MAIA; `can_manage` is true for the owner or an admin. A member sees the state without managing it.\nMAIA itself is switched on by Prudai, not here.\n\nZoektermen (NL): Exact Online aanzetten, staat Exact aan.\n","x-prudai-search-terms":["Exact Online aanzetten, staat Exact aan"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_connection:read"],"security":[{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"The state of the Exact Online function.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"put":{"operationId":"updateExactFeature","tags":["Exact connection"],"summary":"Switch the Exact Online function on or off","description":"Personal tokens only; owner or admin. Switches Exact Online on or off within the organisation's active MAIA.\nNo administration codes or vault path: connecting (`startExactConnection`) and choosing administrations\n(`updateExactDivisions`) follow separately.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Exact Online aanzetten of uitzetten.\n","x-prudai-search-terms":["Exact Online aanzetten of uitzetten"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_connection:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The new state.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/exact/divisions":{"get":{"operationId":"listExactDivisions","tags":["Exact connection"],"summary":"Administrations the Exact login can reach, and which ones count","description":"Personal tokens only; read only. Every administration the last Exact login could reach, plus the chosen ones,\nwith `selected`, `reachable`, the connection `status` (`available` = covered by the grant, not chosen) and\n`primary`. `selection_source`: `database` (own choice), `server` (older connection, still the server\nsetting) or `none`.\n\nZoektermen (NL): Administraties kiezen, welke Exact-administraties tellen mee.\n","x-prudai-search-terms":["Administraties kiezen, welke Exact-administraties tellen mee"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:exact_connection:read"],"security":[{"PersonalTokenAuth":[]}],"responses":{"200":{"description":"The administrations.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"put":{"operationId":"updateExactDivisions","tags":["Exact connection"],"summary":"Choose which administrations count","description":"Personal tokens only; owner or admin. Replaces the choice (1 to 100 codes from `listExactDivisions`), stored in\nPrudai; no restart. Newly chosen administrations covered by the grant become active at once and get a first\nreplication (`sync_job_id`); `needs_connect` lists chosen ones without a usable grant. `?dryRun=true` only\nchecks. Unknown codes: `422`.\n\nWaits for a human (`confirm`): the first call answers `202` with an approval request; repeat the exact call\nwith `x-prudai-approval: apr_…` once approved.\n\nZoektermen (NL): Administraties kiezen en opslaan, Exact-administraties aanvinken.\n","x-prudai-search-terms":["Administraties kiezen en opslaan, Exact-administraties aanvinken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:exact_connection:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"schema":{"type":"boolean"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["divisions"],"properties":{"divisions":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"integer","minimum":1}},"primary_division":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"The choice after the change.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/knowledge-bases":{"get":{"operationId":"listKnowledgeBases","tags":["Knowledge bases"],"summary":"List the organisation's knowledge bases","description":"Knowledge bases of the organisation that owns the key, newest first. Soft-deleted ones only with\n`include_deleted=true`. `q` filters on the name.\n\nZoektermen (NL): Kennisbanken en bibliotheken bekijken.\n","x-prudai-search-terms":["Kennisbanken en bibliotheken bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Knowledge bases (page).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createKnowledgeBase","tags":["Knowledge bases"],"summary":"Create a knowledge base","description":"Creates an empty knowledge base for the organisation that owns the key. Limit: 50 active knowledge\nbases per organisation (`409 knowledge_base_limit_reached`). Waits for a human (`confirm`).\n\n**Idempotency (differs from the chat and source operations).** `Idempotency-Key` is required\n(8 to 255 characters). The key belongs to the organisation, not to the credential, and does not\nexpire while the knowledge base exists. A replay with the same name and description returns the\nknowledge base as it is now with `200` (the first answer was `201`); it is not a stored copy of the\nfirst response and carries no `Idempotent-Replayed` header. The same key with other content gets\n`422 idempotency_key_reused`. A concurrent request with the same key returns the winner.\n\nZoektermen (NL): Een kennisbank of bibliotheek aanmaken.\n","x-prudai-search-terms":["Een kennisbank of bibliotheek aanmaken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:knowledge_bases:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"],"maxLength":1024}}}}}},"responses":{"200":{"description":"Replay of the same Idempotency-Key, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Created.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"Limit reached (`knowledge_base_limit_reached`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/query":{"post":{"operationId":"queryKnowledgeBases","tags":["Knowledge bases"],"x-prudai-cli":"knowledge-bases query-all","summary":"Query the organisation's knowledge bases (retrieval hits with citations)","description":"Like `queryKnowledgeBase`, but over several knowledge bases at once: `POST /v1/knowledge-bases/query`\n(the path of one knowledge base is `/v1/knowledge-bases/{kb_id}/query`). Which ones is the `knowledge_bases`\nfield (default `\"all\"`, see `KnowledgeBaseSelection`). Hits come back with the knowledge base\n(`knowledge_base_id`) and document (`document_id`, `filename`) as citation. RAG gives no score that is\ncomparable across knowledge bases, so hits of different knowledge bases are interleaved by rank. A knowledge\nbase that does not answer is left out and reported in `notIncluded` (all failing gives `502`). Each knowledge\nbase contributes at most `top_k` hits and the merged list is cut at `top_k`; with a low `top_k` a knowledge base\ncan therefore be missing, and `completeness.truncated` is then `true` with a line in `notIncluded`. With `\"none\"`\nthe result is empty. Free; one call counts as one query in the 60-per-minute limit per key, however many\nknowledge bases it spans.\n\nZoektermen (NL): Kennisbanken doorzoeken met citaten.\n","x-prudai-search-terms":["Kennisbanken doorzoeken met citaten"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leesactie via POST: de vraag staat in de body; er wordt niets opgeslagen of gewijzigd."},"x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"top_k":{"type":"integer","minimum":1,"maximum":20,"default":5},"knowledge_bases":{"$ref":"#/components/schemas/KnowledgeBaseSelection"}}},"examples":{"allKnowledgeBases":{"summary":"Default, all knowledge bases of the organisation","value":{"question":"Wat is onze standaardtermijn voor bewaren?"}},"chosen":{"summary":"Two chosen knowledge bases","value":{"question":"Wat is onze standaardtermijn voor bewaren?","knowledge_bases":["kb_aaaaaaaaaaaaaaaaaaaa","kb_bbbbbbbbbbbbbbbbbbbb"]}}}}}},"responses":{"200":{"description":"Hits (possibly none). `provenance.knowledge_bases` shows what was asked for, what applied and which knowledge bases were searched.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"A chosen knowledge base does not exist in this organisation (`knowledge_base_not_found`, `param: knowledge_bases`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed for every chosen knowledge base (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}":{"get":{"operationId":"getKnowledgeBase","tags":["Knowledge bases"],"summary":"Get one knowledge base","description":"One knowledge base of the organisation. Another organisation's id answers 404.\n\nZoektermen (NL): Een kennisbank of bibliotheek bekijken.\n","x-prudai-search-terms":["Een kennisbank of bibliotheek bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The knowledge base.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteKnowledgeBase","tags":["Knowledge bases"],"summary":"Soft-delete a knowledge base","description":"Soft delete: the knowledge base disappears from lists, queries and document routes and can be\nrestored with `restoreKnowledgeBase` for 30 days. After that a cleanup job removes the RAG index, the\nfiles and the register row for good (with an audit line of ids and counts); a purged knowledge base answers\n`404`. Waits for a human (`review`).\n\nZoektermen (NL): Een kennisbank naar de prullenbak verplaatsen.\n","x-prudai-search-terms":["Een kennisbank naar de prullenbak verplaatsen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:knowledge_bases:delete"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Soft-deleted, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateKnowledgeBase","tags":["Knowledge bases"],"summary":"Rename or describe a knowledge base","description":"Optimistic concurrency: send `If-Match: \"<version>\"` from the last read; a stale version\nanswers `409 version_conflict` (not `412`: the platform uses 409 for every version conflict, so a client\nhas one code to handle). Without `If-Match` the current version is assumed. Waits for a human (`confirm`).\n\nZoektermen (NL): Een kennisbank hernoemen of beschrijven.\n","x-prudai-search-terms":["Een kennisbank hernoemen of beschrijven"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:knowledge_bases:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"],"maxLength":1024}}}}}},"responses":{"200":{"description":"Updated, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Version conflict (`version_conflict`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/restore":{"post":{"operationId":"restoreKnowledgeBase","tags":["Knowledge bases"],"summary":"Restore a soft-deleted knowledge base","description":"Undoes a soft delete. Waits for a human (`confirm`).\n\nZoektermen (NL): Een verwijderde kennisbank herstellen.\n","x-prudai-search-terms":["Een verwijderde kennisbank herstellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:knowledge_bases:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Restored, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Limit reached (`knowledge_base_limit_reached`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/register-links/{link_id}":{"delete":{"operationId":"deleteRegisterLink","tags":["Knowledge bases"],"summary":"Soft-delete a linked register","description":"Requires knowledge base management rights and human review with a reason. Soft-deletes the link without deleting upstream rows; restore it with `restoreRegisterLink`.\n\nZoektermen (NL): Een registerkoppeling verwijderen.\n","x-prudai-search-terms":["Een registerkoppeling verwijderen."],"x-prudai-cli":"register-links delete","x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":"review","x-prudai-scopes":["prudai:register_links:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"description":"Validate the KB manage right and preview without writing.","schema":{"type":"string","enum":["true","false"]}},{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operation result in the standard envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval through the existing approval flow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Link or knowledge base unavailable to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"Upstream register unavailable or returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Register source or Developer API not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/register-links":{"get":{"operationId":"listRegisterLinks","tags":["Knowledge bases"],"summary":"List linked registers for a knowledge base","description":"Lists active links. Set `include_deleted=true` to include recoverable soft-deleted links. Knowledge base read access is checked as the signed-in user.\n\nZoektermen (NL): Gekoppelde registers van een kennisbank bekijken.\n","x-prudai-search-terms":["Gekoppelde registers van een kennisbank bekijken."],"x-prudai-cli":"knowledge-bases register-links list","x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":"none","x-prudai-scopes":["prudai:register_links:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"description":"Public knowledge base id or a RAG knowledge base UUID; the same user ACL applies to both forms.","schema":{"type":"string","pattern":"^(kb_[A-Za-z0-9]{20}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"],"default":"false"}}],"responses":{"200":{"description":"Operation result in the standard envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Link or knowledge base unavailable to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"Upstream register unavailable or returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Register source or Developer API not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createRegisterLink","tags":["Knowledge bases"],"summary":"Link an external register to a knowledge base","description":"Requires knowledge base management rights and human confirmation. Stores a link only; register rows stay in IRMA or ORDO. The server derives the actor and organisation from the authenticated user.\n\nZoektermen (NL): Een register aan een kennisbank koppelen.\n","x-prudai-search-terms":["Een register aan een kennisbank koppelen."],"x-prudai-cli":"knowledge-bases register-links create","x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:register_links:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"description":"Validate the KB manage right and preview without writing.","schema":{"type":"string","enum":["true","false"]}},{"name":"kb_id","in":"path","required":true,"description":"Public knowledge base id or a RAG knowledge base UUID; the same user ACL applies to both forms.","schema":{"type":"string","pattern":"^(kb_[A-Za-z0-9]{20}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["source","source_ref","label"],"properties":{"source":{"type":"string","enum":["irma","ordo"]},"source_ref":{"type":"string","minLength":1,"maxLength":128},"label":{"type":"string","minLength":1,"maxLength":200}}}}}},"responses":{"200":{"description":"Dry-run preview; no link is stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Operation result in the standard envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval through the existing approval flow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Link or knowledge base unavailable to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"Upstream register unavailable or returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Register source or Developer API not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/register-links/{link_id}/query":{"post":{"operationId":"queryRegisterLink","tags":["Knowledge bases"],"summary":"Query rows from a linked register","description":"Requires a user Keycloak access token obtained through product token exchange. Service keys and personal API tokens are refused; no service identity or impersonation is used upstream. IRMA or ORDO enforces the user's register access on every call; an upstream 403 remains a 403 without rows. Passes filters and sorting to the source. Returns source, sourceRef, filter, rows and count, with nextCursor for another page. If a source cannot aggregate, computes over at most 5,000 fetched rows and reports \"berekend over N opgehaalde rijen\"; larger results fail explicitly without silent truncation.\n\nZoektermen (NL): Een gekoppeld register doorzoeken en berekenen.\n","x-prudai-search-terms":["Een gekoppeld register doorzoeken en berekenen."],"x-prudai-cli":"register-links query","x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":{"level":"none","reason":"Leesactie via POST: filters en berekeningen staan in de body; brongegevens worden niet gewijzigd."},"x-prudai-scopes":["prudai:register_links:read"],"security":[{"UserAccessTokenAuth":[]}],"parameters":[{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterSourceQuery"}}}},"responses":{"200":{"description":"Operation result in the standard envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Link or knowledge base unavailable to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"Upstream register unavailable or returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Register source or Developer API not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/register-links/{link_id}/restore":{"post":{"operationId":"restoreRegisterLink","tags":["Knowledge bases"],"summary":"Restore a soft-deleted register link","description":"Requires knowledge base management rights and human confirmation. Restores the same link; upstream access is checked again when querying.\n\nZoektermen (NL): Een verwijderde registerkoppeling herstellen.\n","x-prudai-search-terms":["Een verwijderde registerkoppeling herstellen."],"x-prudai-cli":"register-links restore","x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:register_links:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"dryRun","in":"query","required":false,"description":"Validate the KB manage right and preview without writing.","schema":{"type":"string","enum":["true","false"]}},{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operation result in the standard envelope.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval through the existing approval flow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Link or knowledge base unavailable to this user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"Upstream register unavailable or returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Register source or Developer API not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/documents":{"get":{"operationId":"listKnowledgeBaseDocuments","tags":["Knowledge bases"],"summary":"List documents and their processing status","description":"Documents of the knowledge base with their live processing status from RAG (`pending`,\n`processing`, `completed`, `failed`). With `status` the total is null (the filter applies after paging).\n\nZoektermen (NL): Documenten en bestanden in een kennisbank bekijken.\n","x-prudai-search-terms":["Documenten en bestanden in een kennisbank bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","processing","completed","failed"]}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Documents (page).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"uploadKnowledgeBaseDocument","tags":["Knowledge bases"],"summary":"Upload a document","description":"Multipart upload with exactly one field `file` (max 25 MB; pdf, docx, doc, odt, rtf, txt, md, html,\ncsv, xlsx, pptx, eml). Processing is asynchronous: poll\n`getKnowledgeBaseDocument` (in `next`) until `status` is `completed`. Limit: 1,000 active documents\nper knowledge base. Waits for a human (`confirm`).\n\n**Idempotency (differs from the chat and source operations).** `Idempotency-Key` is required\n(8 to 255 characters). The key belongs to the knowledge base and does not expire while the document\nexists. A replay with the same filename and size returns the document as it is now with `200` (the\nfirst answer was `201`), without `Idempotent-Replayed`; the same key with another file gets\n`422 idempotency_key_reused`. A concurrent upload with the same key returns the winner and the loser's\nbytes are removed again.\n\nZoektermen (NL): Een document uploaden naar een kennisbank.\n","x-prudai-search-terms":["Een document uploaden naar een kennisbank"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:knowledge_bases:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Replay of the same Idempotency-Key, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Uploaded; processing started.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Limit reached (`knowledge_base_limit_reached`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/documents/{document_id}":{"get":{"operationId":"getKnowledgeBaseDocument","tags":["Knowledge bases"],"summary":"Get one document with its processing status","description":"Metadata and live processing status of one document.\n\nZoektermen (NL): Een kennisbankdocument en verwerkingsstatus bekijken.\n","x-prudai-search-terms":["Een kennisbankdocument en verwerkingsstatus bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kbdoc_[A-Za-z0-9]{20}$"}}],"responses":{"200":{"description":"The document.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteKnowledgeBaseDocument","tags":["Knowledge bases"],"summary":"Soft-delete a document","description":"The document disappears from lists and query hits and can be restored for 30 days; after that the cleanup\njob removes the RAG index entry and the file for good. Waits for a human (`review`).\n\nZoektermen (NL): Een kennisbankdocument naar de prullenbak verplaatsen.\n","x-prudai-search-terms":["Een kennisbankdocument naar de prullenbak verplaatsen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:knowledge_bases:delete"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kbdoc_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Soft-deleted, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/documents/{document_id}/restore":{"post":{"operationId":"restoreKnowledgeBaseDocument","tags":["Knowledge bases"],"summary":"Restore a soft-deleted document","description":"Undoes a soft delete; no re-indexing needed. Waits for a human (`confirm`).\n\nZoektermen (NL): Een verwijderd kennisbankdocument herstellen.\n","x-prudai-search-terms":["Een verwijderd kennisbankdocument herstellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:knowledge_bases:write"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kbdoc_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and show the effect without changing anything.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Restored, or a dry run.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval (ApprovalRequest).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/knowledge-bases/{kb_id}/archive-sources":{"get":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"listArchiveSources","tags":["Knowledge bases"],"summary":"List linked archive libraries","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\n\nZoektermen (NL): Gekoppelde archiefbibliotheken bekijken.\n","x-prudai-search-terms":["Gekoppelde archiefbibliotheken bekijken"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:archive_sources:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"include_deleted","in":"query","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"createArchiveSource","tags":["Knowledge bases"],"summary":"Link an archive library without importing content","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\nLinking stores metadata only and never downloads or bulk imports content. Start sync explicitly.\nIdempotency-Key is required, bound to the organisation and retained with this source.\ndryRun=true validates and previews without changing metadata or enqueuing a job.\n\nZoektermen (NL): Een archiefbibliotheek koppelen zonder bestanden te importeren.\n","x-prudai-search-terms":["Een archiefbibliotheek koppelen zonder bestanden te importeren"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:archive_sources:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["drive_id","label"],"properties":{"label":{"type":"string","minLength":1,"maxLength":255},"provider":{"type":"string","enum":["sharepoint"],"default":"sharepoint"},"drive_id":{"type":"string","minLength":1,"maxLength":512},"site_id":{"type":"string","minLength":1,"maxLength":512}}}}}},"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval; no archive changes have run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/archive-sources/{source_id}":{"get":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"getArchiveSource","tags":["Knowledge bases"],"summary":"Read a linked archive source","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\n\nZoektermen (NL): Een gekoppelde archiefbron bekijken.\n","x-prudai-search-terms":["Een gekoppelde archiefbron bekijken"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:archive_sources:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"include_deleted","in":"query","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"deleteArchiveSource","tags":["Knowledge bases"],"summary":"Soft delete a linked archive source","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\nSoft deletion preserves metadata; restore reverses it. No source file is removed in Microsoft.\ndryRun=true validates and previews without changing metadata or enqueuing a job.\n\nZoektermen (NL): Een archiefbron ontkoppelen.\n","x-prudai-search-terms":["Een archiefbron ontkoppelen"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:archive_sources:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval; no archive changes have run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"updateArchiveSource","tags":["Knowledge bases"],"summary":"Rename a linked archive source","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\ndryRun=true validates and previews without changing metadata or enqueuing a job.\n\nZoektermen (NL): Een gekoppelde archiefbron hernoemen.\n","x-prudai-search-terms":["Een gekoppelde archiefbron hernoemen"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:archive_sources:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1,"maxLength":255}}}}}},"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval; no archive changes have run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/archive-sources/{source_id}/restore":{"post":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"restoreArchiveSource","tags":["Knowledge bases"],"summary":"Restore a linked archive source","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\ndryRun=true validates and previews without changing metadata or enqueuing a job.\n\nZoektermen (NL): Een ontkoppelde archiefbron herstellen.\n","x-prudai-search-terms":["Een ontkoppelde archiefbron herstellen"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:archive_sources:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval; no archive changes have run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/archive-sources/{source_id}/sync":{"post":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"syncArchiveSource","tags":["Knowledge bases"],"summary":"Queue a metadata-only delta sync","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\nOnly metadata is fetched by the background job. Content is never downloaded during delta sync.\nIdempotency-Key is required; the job id is stable per user/source/key while retained (at most one hour after completion).\nThe delegated token is encrypted in the queue. An expired connection requires a new user request.\ndryRun=true validates and previews without changing metadata or enqueuing a job.\n\nZoektermen (NL): Alleen gewijzigde archiefmetadata synchroniseren.\n","x-prudai-search-terms":["Alleen gewijzigde archiefmetadata synchroniseren"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:archive_sources:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval; no archive changes have run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/archive-sources/{source_id}/items":{"get":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"listArchiveItems","tags":["Knowledge bases"],"summary":"Search archive metadata with current user rights","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\nSearches names and paths only; every returned item is rechecked through the requesting user.\nMicrosoft 403/404 items are omitted. No document content is fetched; totals remain unknown.\n\nZoektermen (NL): Archiefbestanden op naam en pad doorzoeken.\n","x-prudai-search-terms":["Archiefbestanden op naam en pad doorzoeken"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:archive_sources:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","schema":{"type":"string","minLength":1,"maxLength":500}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740941,"default":0}}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/archive-sources/{source_id}/items/{item_id}":{"get":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","operationId":"getArchiveItem","tags":["Knowledge bases"],"summary":"Open an archive item through the requesting user","description":"Requires the requesting user's signed-in Keycloak token and active leo-sharepoint capability.\nService keys and personal API tokens cannot inherit Microsoft connections. The active knowledge\nbase and source must belong to the authenticated organisation. Reuses the existing delegated\nMicrosoft connection; no app-only access or new consent flow. Source delta cursors are never returned.\nChecks Microsoft permissions on every read, including cache hits. A Microsoft 403 hides the item.\nContent is downloaded only on this read, extracted locally, and cached for at most 15 minutes.\nReturns literal chunks and a citation link to the source. Unsupported formats retain metadata only.\n\nZoektermen (NL): Een archiefbestand openen en tijdelijk doorzoekbaar maken.\n","x-prudai-search-terms":["Een archiefbestand openen en tijdelijk doorzoekbaar maken"],"x-prudai-phase":2,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:archive_sources:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":512}}],"responses":{"200":{"description":"Result in the standard task envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Source, active knowledge base or readable item not found in this organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/knowledge-bases/{kb_id}/query":{"post":{"operationId":"queryKnowledgeBase","tags":["Knowledge bases"],"x-prudai-cli":"knowledge-bases query","summary":"Query a knowledge base (retrieval hits with citations)","description":"Returns the most relevant passages (`content`) with their knowledge base (`knowledge_base_id`) and\ndocument (`document_id`, `filename`) as citation. No page number or score yet (RAG does not hand them\nover). No generated answer (see `answerFromKnowledgeBase`). To query several knowledge bases at once see\n`queryKnowledgeBases`. Free; 60 queries per minute per key.\n\nZoektermen (NL): Een kennisbank doorzoeken met citaten.\n","x-prudai-search-terms":["Een kennisbank doorzoeken met citaten"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leesactie via POST: de vraag staat in de body; er wordt niets opgeslagen of gewijzigd."},"x-prudai-scopes":["prudai:knowledge_bases:read"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"top_k":{"type":"integer","minimum":1,"maximum":20,"default":5}}}}}},"responses":{"200":{"description":"Hits.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Knowledge base or document not found in this organisation (`knowledge_base_not_found`, `document_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"description":"The knowledge base service (RAG) failed (`upstream_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Knowledge bases are not configured yet (`service_unavailable`) or the Developer API is off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/approvals/{id}":{"get":{"operationId":"getApproval","tags":["Approvals"],"summary":"Read an approval request","description":"Zoektermen (NL): Een goedkeuringsaanvraag en besluit bekijken.\n","x-prudai-search-terms":["Een goedkeuringsaanvraag en besluit bekijken"],"x-prudai-phase":4,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Own approval requests: any valid credential may follow what it asked for. Other requests in the organisation need the conditional scope account:approvals:read."},"x-prudai-conditional-scopes":["account:approvals:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^apr_[A-Za-z0-9]{24}$"}},{"name":"organization_wide","in":"query","description":"Default false: only your requests. true requires account:approvals:read.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Approval request metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/approvals":{"get":{"operationId":"listApprovals","tags":["Approvals"],"summary":"List approval requests","description":"Zoektermen (NL): Goedkeuringen en openstaande aanvragen bekijken.\n","x-prudai-search-terms":["Goedkeuringen en openstaande aanvragen bekijken"],"x-prudai-phase":4,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":[],"x-prudai-scope-exception":{"reason":"Own approval requests: any valid credential may follow what it asked for. The organisation-wide list needs the conditional scope account:approvals:read."},"x-prudai-conditional-scopes":["account:approvals:read"],"parameters":[{"name":"organization_wide","in":"query","description":"Default false: only your requests. true requires account:approvals:read.","schema":{"type":"boolean","default":false}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","approved","rejected","expired","used"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string","pattern":"^apr_[A-Za-z0-9]{24}$"}}],"responses":{"200":{"description":"A page of approval requests, ordered by id descending. Follow next_cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/artifacts":{"get":{"operationId":"listArtifacts","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"List artifacts","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nZoektermen (NL): Documenten en werkboeken bekijken.\n","x-prudai-search-terms":["Documenten en werkboeken bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":"none","x-prudai-scopes":["prudai:artifacts:read"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"scope_kind","in":"query","required":true,"schema":{"type":"string","enum":["project","conversation","workflow_run"]}},{"name":"scope_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}":{"get":{"operationId":"readArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Read an artifact range or blocks","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nZoektermen (NL): Een document of werkboek lezen.\n","x-prudai-search-terms":["Een document of werkboek lezen"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":"none","x-prudai-scopes":["prudai:artifacts:read"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":30000,"default":12000}},{"name":"range","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"sheet","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"block_ids","in":"query","required":false,"schema":{"type":"string","description":"Comma-separated block identifiers."}}],"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"writeArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Write document content or workbook cells","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Documenttekst of werkboekcellen schrijven.\n","x-prudai-search-terms":["Documenttekst of werkboekcellen schrijven"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":{"level":"none","reason":"Changes a document or workbook the person may write to; every change is a version that can be restored. Rule set: own workspace."},"x-prudai-scopes":["prudai:artifacts:write"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version"],"properties":{"expected_version":{"type":"integer","minimum":0},"markdown":{"type":"string","maxLength":1000000},"sheet":{"type":"string","minLength":1,"maxLength":200},"cells":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"object","additionalProperties":false,"required":["ref"],"properties":{"ref":{"type":"string","minLength":1,"maxLength":100},"value":{"oneOf":[{"type":"string"},{"type":"number"}]},"formula":{"type":"string","minLength":1,"maxLength":10000},"format":{"type":"string","enum":["percent","currency","number","integer","date","text"]}}}}},"oneOf":[{"required":["markdown"],"not":{"required":["cells"]}},{"required":["cells"],"not":{"required":["markdown"]}}]}}}},"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/find":{"get":{"operationId":"findArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Find text inside an artifact","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nZoektermen (NL): Tekst in een document of werkboek zoeken.\n","x-prudai-search-terms":["Tekst in een document of werkboek zoeken"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":"none","x-prudai-scopes":["prudai:artifacts:read"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":10000}},{"name":"sheet","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/edit":{"post":{"operationId":"editArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Edit one uniquely identified target","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een passage of cel in een document of werkboek wijzigen.\n","x-prudai-search-terms":["Een passage of cel in een document of werkboek wijzigen"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":{"level":"none","reason":"Changes a document or workbook the person may write to; every change is a version that can be restored. Rule set: own workspace."},"x-prudai-scopes":["prudai:artifacts:write"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","replacement"],"properties":{"expected_version":{"type":"integer","minimum":0},"original":{"type":"string","minLength":1,"maxLength":1000000},"replacement":{"oneOf":[{"type":"string","maxLength":1000000},{"type":"number"}]},"address":{"type":"string","minLength":1,"maxLength":100},"sheet":{"type":"string","minLength":1,"maxLength":200}},"oneOf":[{"required":["original"],"not":{"required":["address"]}},{"required":["address"],"not":{"required":["original"]}}]}}}},"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/structure":{"post":{"operationId":"structureArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Change document or workbook structure","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Tabbladen, rijen, kolommen, koppen en secties aanpassen.\n","x-prudai-search-terms":["Tabbladen, rijen, kolommen, koppen en secties aanpassen"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":{"level":"none","reason":"Changes a document or workbook the person may write to; every change is a version that can be restored. Rule set: own workspace."},"x-prudai-scopes":["prudai:artifacts:write"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","op"],"properties":{"expected_version":{"type":"integer","minimum":0},"op":{"type":"string","enum":["insert_rows","delete_rows","insert_columns","delete_columns","hide_rows","unhide_rows","hide_columns","unhide_columns","row_height","column_width","add_sheet","rename_sheet","delete_sheet","copy_sheet","move_sheet","hide_sheet","unhide_sheet","tab_color","sort","merge","unmerge","freeze","format","set_name","delete_name","set_filter","clear_filter","set_validation","clear_validation","add_conditional_format","clear_conditional_formats","set_note","delete_note","set_hyperlink","remove_hyperlink","set_heading","insert_section","delete_section"]},"sheet":{"type":"string","minLength":1,"maxLength":200},"params":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/history":{"get":{"operationId":"listArtifactHistory","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"List artifact versions","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\nWith compare_from (and optionally compare_to) it compares two versions: what changed and who made each change.\n\nZoektermen (NL): Versies van een document of werkboek bekijken of vergelijken.\n","x-prudai-search-terms":["Versies van een document of werkboek bekijken of vergelijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":"none","x-prudai-scopes":["prudai:artifacts:read"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"compare_from","in":"query","required":false,"description":"Compare this version with compare_to instead of listing versions. The response then has `compare`, with the added/removed lines (document) or changed cells (sheet), and `changed_by` per change in between. At most 200 entries; counts stay exact.","schema":{"type":"integer","minimum":0}},{"name":"compare_to","in":"query","required":false,"description":"Later version for compare_from; defaults to the current version. Without compare_from, or with a reversed, empty or future range, the call is refused with 422. A version whose history was pruned or merged gives 404.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/restore":{"post":{"operationId":"restoreArtifact","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Artifacts"],"summary":"Restore an artifact version","description":"Personal tokens and signed-in user tokens only. The caller's current organisation,\nproduct entitlement, document/conversation access and editing presence are rechecked.\nWrites run directly (own workspace, every change is a restorable version) and use expected_version; stale versions return\n409 with the current state. AI document tools remain proposals until the user applies them.\nNo deletion operation is exposed by this family; source deletion retains its soft-delete route.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een eerdere versie van een document of werkboek herstellen.\n","x-prudai-search-terms":["Een eerdere versie van een document of werkboek herstellen"],"x-prudai-phase":3,"x-prudai-status":"implemented","security":[{"PersonalTokenAuth":[]}],"x-prudai-approval":{"level":"none","reason":"Changes a document or workbook the person may write to; every change is a version that can be restored. Rule set: own workspace."},"x-prudai-scopes":["prudai:artifacts:write"],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["expected_version","version"],"properties":{"expected_version":{"type":"integer","minimum":0},"version":{"type":"integer","minimum":0}}}}}},"responses":{"200":{"description":"Requested artifact data or exact change receipt, including completeness and next calls for pagination.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Artifact or historical version not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stale version or document editing lock; reload the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Artifact access cannot currently be verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/modules":{"get":{"operationId":"listModules","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Modules"],"summary":"List office modules and organization apps","description":"Lists published workflow modules for the selected product plus CATO, IRMA, ORDO, VERA, ZIA and BEVER with effective enabled status. Workflow entries require the existing workflow capability; app entries remain visible without it. Product activation stays a request, never an entitlement change. ORDO has no chat product slug; its activation request uses the Console URL. Zoektermen (NL): Kantoormodules en apps bouwen, publiceren en uitvoeren.","x-prudai-search-terms":["Kantoormodules en apps bouwen, publiceren en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:modules:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":false,"description":"Optional workflow product context; defaults to the first entitled chat product. Apps are always listed.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"proposeModule","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Modules"],"summary":"Build a private module draft","description":"Creates an own private module workflow through the existing builder validation. All step model tiers are standard or cheaper. Creating a private draft needs no approval; running spends credits within the plan budget and needs no approval, publication needs one Owner/Admin confirmation. Zoektermen (NL): Kantoormodules en apps bouwen, publiceren en uitvoeren.","x-prudai-search-terms":["Kantoormodules en apps bouwen, publiceren en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Stores only a private module draft; office publication waits for an Owner or Admin."},"x-prudai-scopes":["prudai:modules:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/modules/{id}/publish":{"post":{"operationId":"publishModule","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Modules"],"summary":"Publish an office module","description":"Requires one Owner/Admin confirmation through the existing approval service, including the creator when they hold that role. The recorded approval is the audit trail. Publishes the exact approved private module revision in the organization library; another organization cannot see it. A changed revision invalidates the grant. Zoektermen (NL): Kantoormodules en apps bouwen, publiceren en uitvoeren.","x-prudai-search-terms":["Kantoormodules en apps bouwen, publiceren en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"confirm","reason":"Shares the private definition after one Owner or Admin approval, including the requester when privileged."},"x-prudai-scopes":["prudai:modules:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval. Replay the exact request with its one-use approval grant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/modules/{id}/runs":{"post":{"operationId":"runModule","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Modules"],"summary":"Run an accessible module","description":"Starts an own private or published organization module as the signed-in person through the existing workflow engine and capability gates. Runs directly, without an approval request (own workspace, within the plan budget); the run is bound to the module version and exact revision. Needs a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check. Zoektermen (NL): Kantoormodules en apps bouwen, publiceren en uitvoeren.","x-prudai-search-terms":["Kantoormodules en apps bouwen, publiceren en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Runs a module the person may use within the plan budget, like a workflow run; the result is the person's own run. Rule set: own workspace."},"x-prudai-scopes":["prudai:modules:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStartRunRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows":{"get":{"operationId":"listWorkflows","tags":["Workflows"],"summary":"List workflow definitions","description":"Lists the caller's visible definitions with an exact filtered total. Soft-deleted definitions are not listed; restore one with POST /workflows/{id}/restore. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Workflows en werkstromen bekijken.\n","x-prudai-search-terms":["Workflows en werkstromen bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflows:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["name","createdAt","updatedAt"],"default":"createdAt"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createWorkflow","tags":["Workflows"],"summary":"Create a workflow definition","description":"Creates an editable definition after the app graph validation. next points to startWorkflowRun. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow of werkstroom maken.\n","x-prudai-search-terms":["Een workflow of werkstroom maken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Stores only the signed-in person's own draft definition; nothing is sent, spent or shared."},"x-prudai-scopes":["prudai:workflows:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/catalog":{"get":{"operationId":"getWorkflowCatalog","tags":["Workflows"],"summary":"Get curated templates and office workflows","description":"Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Workflow-sjablonen en kantoorwerkstromen vinden.\n","x-prudai-search-terms":["Workflow-sjablonen en kantoorwerkstromen vinden"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflows:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowCatalog"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/{id}":{"get":{"operationId":"getWorkflow","tags":["Workflows"],"summary":"Get a workflow definition","description":"Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow of werkstroom bekijken.\n","x-prudai-search-terms":["Een workflow of werkstroom bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflows:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowDefinition"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteWorkflow","tags":["Workflows"],"summary":"Soft-delete a workflow definition","description":"Moves the definition to the trash: it leaves every list and the app, and POST /workflows/{id}/restore brings it back unchanged within 30 days; after that it is removed for good. Runs keep their own snapshot, so past and running runs are not affected. Waits for a reviewer (an owner or administrator, with a reason). The app's own delete takes the same soft path. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow naar de prullenbak verplaatsen.\n","x-prudai-search-terms":["Een workflow naar de prullenbak verplaatsen"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"review","x-prudai-scopes":["prudai:workflows:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/ApprovalGrant"}],"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Waiting for human approval. Replay the exact request with its one-use approval grant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateWorkflow","tags":["Workflows"],"summary":"Update a workflow definition","description":"Partial update. If-Match binds the previously read updatedAt: without it 428 precondition_required, a stale value 409 version_conflict. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow of werkstroom wijzigen.\n","x-prudai-search-terms":["Een workflow of werkstroom wijzigen"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Stores only the signed-in person's own draft definition; nothing is sent, spent or shared."},"x-prudai-scopes":["prudai:workflows:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"If-Match","in":"header","required":true,"description":"The quoted updatedAt value from the last read. Missing returns 428 precondition_required; a stale value returns 409 version_conflict.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdateRequest"}}}},"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"428":{"description":"If-Match is missing (precondition_required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/templates/{id}/copy":{"post":{"operationId":"copyWorkflowTemplate","tags":["Workflows"],"summary":"Copy a curated template","description":"Copies a curated template into an editable definition and reports anything omitted. next points to startWorkflowRun. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow-sjabloon kopiëren.\n","x-prudai-search-terms":["Een workflow-sjabloon kopiëren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Stores only the signed-in person's own draft definition; nothing is sent, spent or shared."},"x-prudai-scopes":["prudai:workflows:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":120}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCopyRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/templates/{id}/intake-prefill":{"post":{"operationId":"prefillWorkflowIntake","tags":["Workflows"],"summary":"Pre-fill template intake from owned context","description":"Uses only caller-authorised draft, conversation and dossier context. Missing or uncertain answers remain open. It runs directly, like the app; it may spend a small amount of credits on the pre-fill itself, and starting the run needs no approval either. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): De intake van een workflow-sjabloon vooraf invullen.\n","x-prudai-search-terms":["De intake van een workflow-sjabloon vooraf invullen"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Stores only the signed-in person's own draft definition; nothing is sent, spent or shared."},"x-prudai-scopes":["prudai:workflows:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":120}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowIntakePrefillRequest"}}}},"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/{id}/runs":{"post":{"operationId":"startWorkflowRun","tags":["Workflow runs"],"summary":"Start a workflow definition run","description":"Starting runs directly, without an approval request (own workspace, within the plan budget). next points to getWorkflowRun. Per-run costs are listed in GET /v1/usage under `workflow_runs`; the run budget is shown on getWorkflowRun. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een workflow starten en uitvoeren.\n","x-prudai-search-terms":["Een workflow starten en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Starts a run of the person's own or a template workflow within the plan budget (fair use); the run can be cancelled. Rule set: own workspace."},"x-prudai-scopes":["prudai:workflow_runs:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStartRunRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/templates/{id}/runs":{"post":{"operationId":"startWorkflowTemplateRun","tags":["Workflow runs"],"summary":"Start a curated workflow template run","description":"Validates intake and selected sources through the same app service. Starting runs directly, without an approval request (own workspace, within the plan budget). next points to getWorkflowRun. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een workflow-sjabloon starten en uitvoeren.\n","x-prudai-search-terms":["Een workflow-sjabloon starten en uitvoeren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Starts a run of the person's own or a template workflow within the plan budget (fair use); the run can be cancelled. Rule set: own workspace."},"x-prudai-scopes":["prudai:workflow_runs:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":120}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key. Retry the same request safely; changed arguments with the same key are rejected.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStartTemplateRunRequest"}}}},"responses":{"200":{"description":"Idempotent replay or dry-run preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"201":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/artifacts/{id}/runs":{"get":{"operationId":"listArtifactRuns","x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","tags":["Workflow runs"],"summary":"List workflow runs that produced an artifact","description":"Returns metadata only after checking the artifact source access and the run owner. The exact total is unknown (completeness.total is null); next contains the next page when more rows exist. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Uitvoeringen achter een artifact bekijken.\n","x-prudai-search-terms":["Uitvoeringen achter een artifact bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:artifacts:read","prudai:workflows:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowArtifactRun"}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs":{"get":{"operationId":"listWorkflowRuns","tags":["Workflow runs"],"summary":"List the caller's workflow runs","description":"Only workflow runs are included. The existing app listing is capped; when the complete total is unknown completeness.total is null and notIncluded explains the source limit. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Workflow-uitvoeringen en runs bekijken.\n","x-prudai-search-terms":["Workflow-uitvoeringen en runs bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflow_runs:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}":{"get":{"operationId":"getWorkflowRun","tags":["Workflow runs"],"summary":"Get workflow status, steps and events","description":"Returns the app run state including logs, progress, budget and any waiting gate. Once completed, next points to listWorkflowRunDeliverables. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Voortgang en status van een workflow-uitvoering bekijken.\n","x-prudai-search-terms":["Voortgang en status van een workflow-uitvoering bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflow_runs:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkflowRun"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/gate":{"post":{"operationId":"submitWorkflowRunGate","tags":["Workflow runs"],"summary":"Answer a waiting human gate","description":"Approve, request revision or abort the exact waiting node. Decisions use the existing decision-event record and run ownership checks. An abort is final: the response carries status aborted (the run ends with its partial result). Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een menselijke tussenstap in een workflow beantwoorden.\n","x-prudai-search-terms":["Een menselijke tussenstap in een workflow beantwoorden"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"The owner of a run decides their own checkpoint, as in the app; the engine re-checks the current gate round and the run's ownership."},"x-prudai-scopes":["prudai:workflow_runs:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowGateDecisionRequest"}}}},"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/continue":{"post":{"operationId":"continueWorkflowRun","tags":["Workflow runs"],"summary":"Continue a resumable workflow run","description":"Preserves completed steps and starts a fresh budget window through the existing app continuation service. The owner continues their own run directly, as in the app; the run budget still applies. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een onderbroken workflow voortzetten.\n","x-prudai-search-terms":["Een onderbroken workflow voortzetten"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"The owner of a run decides their own checkpoint, as in the app; the engine re-checks the current gate round and the run's ownership."},"x-prudai-scopes":["prudai:workflow_runs:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowContinueRequest"}}}},"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/cancel":{"post":{"operationId":"cancelWorkflowRun","tags":["Workflow runs"],"summary":"Stop a workflow run","description":"Stops the caller's own run. At a waiting human gate it submits the gate abort. A queued or running run is stopped cooperatively: no further step starts, the steps already in flight finish, and the run ends as `aborted` with everything that completed as partial result (the run history is kept, nothing is deleted); the response is `status: stopping` and getWorkflowRun shows `aborted` shortly after. A run that is still waiting in the queue (for example for capacity) starts no step at all: it ends as `aborted` with an empty partial result, without a model call and therefore without cost, as soon as it is picked up; until then getWorkflowRun still shows `queued`. A run that has already ended returns 409 workflow_cancel_unavailable. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een workflow stoppen of annuleren.\n","x-prudai-search-terms":["Een workflow stoppen of annuleren"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"The owner of a run decides their own checkpoint, as in the app; the engine re-checks the current gate round and the run's ownership."},"x-prudai-scopes":["prudai:workflow_runs:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCancelRequest"}}}},"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/deliverables":{"get":{"operationId":"listWorkflowRunDeliverables","tags":["Workflow runs"],"summary":"List workflow run deliverables","description":"A run of your own without deliverables (yet) returns an empty list, not 404. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Resultaten en opleverstukken van een workflow bekijken.\n","x-prudai-search-terms":["Resultaten en opleverstukken van een workflow bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflow_runs:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/deliverables/{deliverable_id}/download":{"get":{"operationId":"downloadWorkflowRunDeliverable","tags":["Workflow runs"],"summary":"Download a workflow deliverable","description":"Returns the original rendered bytes with Content-Type and Content-Disposition, as in the app. This binary response is an explicit exception to the JSON envelope. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Een resultaat of opleverstuk van een workflow downloaden.\n","x-prudai-search-terms":["Een resultaat of opleverstuk van een workflow downloaden"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflow_runs:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"deliverable_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["docx","csv","json","markdown","xlsx"]}}],"responses":{"200":{"x-prudai-envelope-exception":{"reason":"Binary rendered deliverable; the app download stream is preserved."},"description":"The rendered deliverable.","headers":{"Content-Disposition":{"schema":{"type":"string"}}},"content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}},"text/csv":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}},"text/markdown":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflow-runs/{id}/tables":{"get":{"operationId":"listWorkflowRunTables","tags":["Workflow runs"],"summary":"List named tables produced by a workflow run","description":"Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nZoektermen (NL): Tabellen van een workflow-uitvoering bekijken.\n","x-prudai-search-terms":["Tabellen van een workflow-uitvoering bekijken"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:workflow_runs:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Requested data with completeness and follow-up actions.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/workflows/{id}/restore":{"post":{"operationId":"restoreWorkflow","tags":["Workflows"],"summary":"Restore a soft-deleted workflow definition","description":"Brings a soft-deleted definition back exactly as it was, with a fresh updatedAt. A definition deleted more than 30 days ago has been removed for good and returns 404. next points to startWorkflowRun. Personal tokens and signed-in user tokens only; service keys are rejected. The same product, organisation, workflow capability and ownership rules as the app apply, including 403 workflows_upgrade_required for VERA without Pro.\n\nNeeds a current writing role (Owner, Admin, Member, Sales); any other role gets `403 membership_required` before any other check.\n\nZoektermen (NL): Een verwijderde workflow herstellen.\n","x-prudai-search-terms":["Een verwijderde workflow herstellen"],"x-prudai-phase":3,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Brings back the person's own soft-deleted definition. Rule set: own workspace."},"x-prudai-scopes":["prudai:workflows:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"X-Product-Slug","in":"header","required":true,"description":"Product context, checked against the current user and the workflow capability.","schema":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever","irma","maia"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"dryRun","in":"query","required":false,"description":"Validate and preview without changing definitions, enqueuing jobs or recording gate decisions.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Completed. With dryRun=true, returns a preview without side effects.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Workflow, run or deliverable not found or inaccessible.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"State conflict, stale If-Match, or cancellation unavailable for the current run state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"Developer API or a required backing service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/anonymization/analyze":{"post":{"operationId":"analyzeAnonymization","tags":["Anonymization"],"summary":"Count what would be masked in a file (dry run of anonymizeDocument)","description":"Personal tokens only. Send one file (`.pdf`, `.docx`, `.txt`, `.md` or `.eml`) as multipart field `file`.\nReturns per category how many personal data items would be masked; **the values themselves are not returned**.\nNothing is stored, shared or changed. Recognition runs in Prudai's own anonymizer service (patterns with\nchecks, the organisation's own reference patterns and learned terms, and named-entity recognition); no AI\npass and no other processor. An `.eml` is read as text (headers From/To/Cc/Subject/Date plus the text\nparts); attachments are counted in `eml.attachments_not_included` and not read.\n\nCategories (`types`, comma-separated; default the first eight): `person`, `address` (with postcode), `bsn`,\n`iban`, `email`, `phone`, `date_of_birth`, `reference` (case and reference numbers), and on request\n`organization`, `kvk`, `license_plate`, `other`, or `all`. `accept=high` (default) counts only findings with\nhigh confidence; `accept=all` also the low ones.\n\nThis is an aid, not a guarantee: the copy is \"gemaskeerd, controleer vóór gebruik\", not \"AVG-anoniem\".\n\nZoektermen (NL): Persoonsgegevens in een bestand tellen.\n","x-prudai-search-terms":["Persoonsgegevens in een bestand tellen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Leesactie via POST: telt wat gemaskeerd zou worden; slaat niets op en wijzigt niets."},"x-prudai-scopes":["prudai:anonymization:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AnonymizationTypes"},{"$ref":"#/components/parameters/AnonymizationAccept"},{"$ref":"#/components/parameters/AnonymizationAcknowledgeUntexted"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The file (.pdf, .docx, .txt, .md, .eml); its multipart filename decides the format."}}},"encoding":{"file":{"contentType":"application/octet-stream"}}}}},"responses":{"200":{"description":"Counts per category.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"description":"The file exceeds the upload size limit (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Not a supported format (`unsupported_format`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/anonymization/document":{"post":{"operationId":"anonymizeDocument","tags":["Anonymization"],"summary":"Mask personal data in a file and get the masked copy (raw bytes)","description":"Personal tokens only. Same input and categories as `analyzeAnonymization`. **Not the task envelope on\nsuccess**: the body is the masked copy, `Content-Type: application/octet-stream`, `Content-Disposition:\nattachment` with the name `<name>_geanonimiseerd.<ext>`, `Cache-Control: no-store`, and the header\n`X-Prudai-Anonymization-Report`: base64 of a JSON report (`filename`, `replacements`, `counts_by_type`,\n`distinct_values`, `residual_check`, `warnings`, `eml`) without any found value. An `.eml` comes back as\na masked `<name>.eml_geanonimiseerd.txt` (headers and text parts; attachments are not included). Nothing is stored on our side;\nthe original and the copy stay with the caller. Errors are the normal envelope:\n`422 nothing_to_anonymize` when nothing of the requested types was found (no copy is made),\n`422 untexted_pages` style errors from the service for scanned PDF pages (pass\n`acknowledge_untexted_pages=true` to mask the text pages anyway).\n\nZoektermen (NL): Een document anonimiseren.\n","x-prudai-search-terms":["Een document anonimiseren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Maakt een gemaskeerde kopie en geeft die terug; er wordt niets opgeslagen, gedeeld of gewijzigd."},"x-prudai-scopes":["prudai:anonymization:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/AnonymizationTypes"},{"$ref":"#/components/parameters/AnonymizationAccept"},{"$ref":"#/components/parameters/AnonymizationAcknowledgeUntexted"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The file (.pdf, .docx, .txt, .md, .eml)."}}},"encoding":{"file":{"contentType":"application/octet-stream"}}}}},"responses":{"200":{"description":"The masked copy.","x-prudai-envelope-exception":{"reason":"The masked copy is a file; the report travels in the X-Prudai-Anonymization-Report header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Content-Disposition":{"description":"`attachment; filename=\"<ascii fallback>\"; filename*=UTF-8''<percent-encoded name>`","schema":{"type":"string"}},"X-Prudai-Anonymization-Report":{"description":"Base64 of the JSON report (counts only, never a found value).","schema":{"type":"string"}},"X-Content-Type-Options":{"schema":{"type":"string","enum":["nosniff"]}},"Cache-Control":{"schema":{"type":"string","enum":["no-store"]}}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"description":"The file exceeds the upload size limit (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Not a supported format (`unsupported_format`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/anonymization/text":{"post":{"operationId":"anonymizeText","tags":["Anonymization"],"summary":"Mask personal data in a text","description":"Personal tokens only. Returns `text` with the personal data of the requested categories replaced by labels,\nplus `counts_by_type`. Same recognition and categories as `anonymizeDocument` (own service, no AI pass, no\nother processor). Nothing is stored. Up to 100,000 characters. Use this from an assistant (MCP) to mask a\npassage before quoting or sharing it; for files use `prudai anonymize <file>`.\n\nZoektermen (NL): Een tekst anonimiseren.\n","x-prudai-search-terms":["Een tekst anonimiseren"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"none","reason":"Geeft een gemaskeerde versie van de meegestuurde tekst terug; slaat niets op."},"x-prudai-scopes":["prudai:anonymization:read"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":100000},"types":{"type":"array","maxItems":20,"items":{"type":"string","enum":["person","address","bsn","iban","email","phone","date_of_birth","reference","organization","kvk","license_plate","other","all"]},"description":"Categories to mask; default the first eight."},"accept":{"type":"string","enum":["high","all"],"default":"high"}}}}}},"responses":{"200":{"description":"The masked text.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/feed":{"get":{"operationId":"listFeedItems","tags":["Feed"],"summary":"The LEO news feed, newest day first","description":"Personal tokens only; the feed of LEO or LEO Fiscaal as the app's \"Voor jou\" day overview: per day\n(Europe/Amsterdam) and per legal area (`group`), with the same ranking, visibility rules and cursors as the\napp. Each item has `source` (name and link to the original), `topics`, `group`, `day`, `is_new`, and `url`\n(the original source; `appUrl` is the item in LEO). `topics` filters on specialisation node ids\n(comma-separated; ancestor or descendant matches); `source` filters on the source name (per page).\nOffice posts, comments and Nuttig/Bewaren stay in the app. `404 feed_not_available` when the organisation\nhas neither LEO nor LEO Fiscaal; `403 feed_disabled` when the owner switched the feed off.\n\nZoektermen (NL): Juridisch nieuws uit de LEO-feed.\n","x-prudai-search-terms":["Juridisch nieuws uit de LEO-feed"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:feed:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"product","in":"query","required":false,"schema":{"type":"string","enum":["leo","leo-fiscaal"]},"description":"Which feed; default the first of the organisation's products."},{"name":"topics","in":"query","required":false,"schema":{"type":"string","maxLength":2000},"description":"Comma-separated specialisation node ids (legal areas), e.g. `fiscaal.btw`."},{"name":"source","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Only items whose source name contains this text (case-insensitive), per page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2000}}],"responses":{"200":{"description":"News items.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/feed/{id}":{"get":{"operationId":"getFeedItem","tags":["Feed"],"summary":"One news item with the article and its citations","description":"Personal tokens only. The item as in LEO: `article_md` (the written article), `citations` (label and URL of\neach source) and `url` (the original source). `404 feed_item_not_found` when it is not visible to you.\n\nZoektermen (NL): Een nieuwsbericht lezen.\n","x-prudai-search-terms":["Een nieuwsbericht lezen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:feed:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"product","in":"query","required":false,"schema":{"type":"string","enum":["leo","leo-fiscaal"]}}],"responses":{"200":{"description":"The item.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/secure-shares":{"get":{"operationId":"listSecureShares","tags":["SecureShares"],"summary":"Your Veilig delen links","description":"Personal tokens only; the links you created in your organisation (as in app.prudai.com/veilig-delen), newest\nfirst, with status (`active`, `expired`, `revoked`), recipient, expiry and download count. The recipient's\nlink itself is never listed (it is stored as a hash).\n\nZoektermen (NL): Mijn Veilig delen-links.\n","x-prudai-search-terms":["Mijn Veilig delen-links"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:secure_shares:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","expired","revoked"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":100}}],"responses":{"200":{"description":"The links.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createSecureShare","tags":["SecureShares"],"summary":"Send files to an external recipient with a Veilig delen link (a person reviews first)","description":"Personal tokens only; a writing role. Multipart: field `meta` (JSON: `recipient_email`, optional\n`recipient_name`, `message` (≤ 2000), `expires_in_days` (1–90, default 7), `max_downloads`, `allow_upload`,\n`lang` `nl`|`en`) and 0–20 `files`. The same rules as the app: virus scan, the organisation's upload\nrestriction (`403 uploads_restricted`), the recipient opens the link only with a 6-digit code mailed to them,\nevery step in the link's log. A link to an external address leaves the organisation, so this waits for a\n**review** (202 ApprovalRequest; after approval the same call with `x-prudai-approval` runs once). The answer\nholds `recipient_link` (shown once) and `mail_sent`. A password for the link is not available here (app only).\n\n**Agents:** credentials (passwords, codes, logins) go only through a share, as a file (never in the message: it is mailed with the link in plain text; a message with credentials is refused, `422 credentials_in_message`): one share per named recipient, short expiry; never in mail, chat or output.\n\nZoektermen (NL): Bestanden veilig delen.\n","x-prudai-search-terms":["Bestanden veilig delen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Een link naar een extern adres verlaat de organisatie; een mens beoordeelt ontvanger, bericht en bestanden. Inloggegevens (wachtwoorden, codes, logins) deelt een agent alleen via Veilig delen, als bestand in de share (nooit in het bericht: dat gaat mee in de mail): één share per genoemde ontvanger, korte looptijd, nooit per mail, chat of in uitvoer."},"x-prudai-scopes":["prudai:secure_shares:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["meta"],"properties":{"meta":{"type":"string","description":"JSON object with recipient_email, recipient_name, message, expires_in_days, max_downloads, allow_upload, lang."},"files":{"type":"array","maxItems":20,"items":{"type":"string","format":"binary"}}}},"encoding":{"files":{"contentType":"application/octet-stream"}}}}},"responses":{"201":{"description":"Created; the link was mailed (see `mail_sent`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Approval request; a person decides in the Console, then replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"description":"The files are too large (`request_too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/secure-shares/requests":{"post":{"operationId":"createSecureShareRequest","tags":["SecureShares"],"summary":"Ask an external recipient to upload files (request link; a person reviews first)","description":"Personal tokens only; a writing role. A Veilig delen link without files where the recipient may upload\n(`allow_upload`), with the same rules as `createSecureShare` (6-digit e-mail code, expiry, log, review).\n\n**Agents:** never put credentials in the message of a request link (it is mailed in plain text; refused with `422 credentials_in_message`).\n\nZoektermen (NL): Bestanden opvragen met een opvraaglink.\n","x-prudai-search-terms":["Bestanden opvragen met een opvraaglink"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Een opvraaglink gaat naar een extern adres; een mens beoordeelt ontvanger en bericht. Inloggegevens (wachtwoorden, codes, logins) deelt een agent alleen via Veilig delen, als bestand in de share (nooit in het bericht: dat gaat mee in de mail): één share per genoemde ontvanger, korte looptijd, nooit per mail, chat of in uitvoer."},"x-prudai-scopes":["prudai:secure_shares:write"],"security":[{"PersonalTokenAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["recipient_email"],"properties":{"recipient_email":{"type":"string","format":"email","maxLength":320},"recipient_name":{"type":"string","maxLength":200},"message":{"type":"string","maxLength":2000},"expires_in_days":{"type":"integer","minimum":1,"maximum":90},"max_files":{"type":"integer","minimum":1,"maximum":50},"lang":{"type":"string","enum":["nl","en"]}}}}}},"responses":{"201":{"description":"Created; the link was mailed (see `mail_sent`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Approval request; a person decides in the Console, then replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableEntity"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/secure-shares/{id}":{"get":{"operationId":"getSecureShare","tags":["SecureShares"],"summary":"One Veilig delen link with its files and log","description":"Personal tokens only; your own links. Files (outbound and uploaded by the recipient) and the audit log\n(created, code requested, opened, downloaded, revoked …).\n\nZoektermen (NL): Een deel-link met logboek bekijken.\n","x-prudai-search-terms":["Een deel-link met logboek bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["prudai:secure_shares:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/SecureShareId"}],"responses":{"200":{"description":"The link.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/secure-shares/{id}/revoke":{"post":{"operationId":"revokeSecureShare","tags":["SecureShares"],"summary":"Revoke a Veilig delen link (a person confirms)","description":"Personal tokens only; a writing role, your own links. The recipient can no longer open or upload. Always\npossible; logged.\n\nZoektermen (NL): Een deel-link intrekken.\n","x-prudai-search-terms":["Een deel-link intrekken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"confirm","x-prudai-scopes":["prudai:secure_shares:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/SecureShareId"}],"responses":{"200":{"description":"Revoked.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Approval request; a person decides in the Console, then replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/organizations/{id}/members":{"get":{"operationId":"listMembers","tags":["Members"],"summary":"Members of the organisation","description":"Personal tokens of an organisation owner only. Name, e-mail, role, switched off, and whether a removal request is open.\n\nZoektermen (NL): Leden van de organisatie bekijken.\n","x-prudai-search-terms":["Leden van de organisatie bekijken"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":"none","x-prudai-scopes":["account:members:read"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MembersOrganizationId"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"The members.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/organizations/{id}/members/{user_id}/disabled":{"post":{"operationId":"setMemberDisabled","tags":["Members"],"summary":"Switch a member off or on (a different owner approves)","description":"Personal tokens of an owner only. Off closes sign-in in every product, frees the seat and keeps all data.\n\nZoektermen (NL): Lid uitzetten of weer aanzetten.\n","x-prudai-search-terms":["Lid uitzetten of weer aanzetten"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Switching a member off or on changes a person's access in every product; a different organisation owner approves."},"x-prudai-scopes":["account:members:write"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MembersOrganizationId"},{"$ref":"#/components/parameters/MemberUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["disabled","reason"],"properties":{"disabled":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":500}}}}}},"responses":{"200":{"description":"The new state.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Approval request; a different owner decides in the Console, then replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/organizations/{id}/members/{user_id}":{"delete":{"operationId":"removeMember","tags":["Members"],"summary":"Remove a member (a different owner approves; files a removal request)","description":"Personal tokens of an owner only. The member is switched off in every product at once and a removal request is filed; Prudai decides on the erasure. Nothing is erased by this call.\n\nZoektermen (NL): Lid verwijderen.\n","x-prudai-search-terms":["Lid verwijderen"],"x-prudai-phase":1,"x-prudai-status":"implemented","x-prudai-approval":{"level":"review","reason":"Access closes in every product and a removal request is filed; a different organisation owner approves. Nothing is erased here: Prudai decides on the erasure."},"x-prudai-scopes":["account:members:delete"],"security":[{"PersonalTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MembersOrganizationId"},{"$ref":"#/components/parameters/MemberUserId"}],"responses":{"200":{"description":"The removal request.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"202":{"description":"Approval request; a different owner decides in the Console, then replay the exact request with X-Prudai-Approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"prudai_sk_live_<secret> | prudai_sk_test_<secret>","description":"`Authorization: Bearer prudai_sk_live_…` (production) or `prudai_sk_test_…`\n(staging). Keys belong to exactly one organisation and carry explicit scopes or an\nobject wildcard such as `prudai:*:read` (never covering `explicit_only` objects): `prudai:models:read`, `prudai:chat:read`, `account:usage:read`, `account:credits:read`,\n`prudai:sources:read`, `prudai:source_texts:read`, `prudai:citations:read`, `prudai:source_answers:read`, `account:organizations:read`. The service scope an operation needs is listed in\n`x-prudai-scopes`. A key without that scope gets `403 insufficient_scope`. Bundles in\nx-prudai-scope-bundles expand into explicit scopes when issued.\n"},"UserAccessTokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"User Keycloak access token obtained through product token exchange. The server verifies\nthe user and organisation; upstream requests use this delegated user identity.\nService keys and personal API tokens cannot substitute for a user access token.\n"},"PersonalTokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"prudai_pat_<secret>","description":"Personal token from device-code login for the prudai CLI. Bound to the approving user,\norganisation and environment. On the shared operations it carries exactly the user's\ncurrent app role and read scope. On operations whose only security is PersonalTokenAuth\n(the Projects operations) it also carries `prudai:projects:read`, `prudai:projects:write`\nand `prudai:projects:delete` for every member while the server has projects enabled; the\nuser's own project rules (owner, editor or reader; product; organisation policy) then decide\nper call, and writes wait for human approval. The signed-in user's own access token (the\n`prudai login` session, the MCP gateway) acts the same way on these operations. No independent\nservice scopes otherwise;\nx-prudai-scopes applies to ApiKeyAuth and to those PersonalTokenAuth-only operations.\nHash-only storage, default expiry 90 days, revocable.\nNever sent as a URL, logged or accepted through a CLI credential flag.\n"}},"headers":{"XRequestId":{"description":"Unique id of this request (`req_` + 24 characters). Quote it in support requests.","schema":{"type":"string","pattern":"^req_[A-Za-z0-9]{24}$"}},"IdempotentReplayed":{"description":"Present with value `true` when the response is a stored replay of an earlier request with the same `Idempotency-Key`.","schema":{"type":"string","enum":["true"]}},"RateLimitLimit":{"description":"Request limit of the tightest window that applies to this key.","schema":{"type":"integer","minimum":0}},"RateLimitRemaining":{"description":"Requests left in that window.","schema":{"type":"integer","minimum":0}},"RateLimitReset":{"description":"Seconds until that window resets.","schema":{"type":"integer","minimum":0}},"RetryAfter":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"parameters":{"CapabilityId":{"name":"id","in":"path","required":true,"description":"Exact id from GET /v1/capabilities; product requests use product:<slug>.","schema":{"type":"string","minLength":1,"maxLength":160}},"CapabilityDryRun":{"name":"dryRun","in":"query","description":"Validate and preview without changing settings or creating an approval request.","schema":{"type":"boolean","default":false}},"DocsLanguage":{"name":"language","in":"query","required":false,"description":"Documentation language.","schema":{"type":"string","enum":["nl","en"],"default":"nl"}},"DocsVisibility":{"name":"visibility","in":"query","required":false,"description":"Highest visibility to include: `public` (default), `gated` (also the pages behind the docs single\nsign-on; any valid credential) or `staff` (Prudai staff organisation only, otherwise `403\nmembership_required`).\n","schema":{"type":"string","enum":["public","gated","staff"],"default":"public"}},"DiscoveryProduct":{"name":"product","in":"query","description":"Exact entitled product slug. Omit to use all products available to the caller.","schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,79}$"}},"AnonymizationTypes":{"name":"types","in":"query","required":false,"description":"Comma-separated categories: person, address, bsn, iban, email, phone, date_of_birth, reference (default these eight), organization, kvk, license_plate, other, or all.","schema":{"type":"string","maxLength":300}},"AnonymizationAccept":{"name":"accept","in":"query","required":false,"description":"`high` (default): only findings with high confidence; `all`: also the low ones.","schema":{"type":"string","enum":["high","all"],"default":"high"}},"AnonymizationAcknowledgeUntexted":{"name":"acknowledge_untexted_pages","in":"query","required":false,"description":"A scanned PDF page without text cannot be masked; `true` masks the text pages anyway and leaves those pages as they are.","schema":{"type":"string","enum":["true","false"]}},"MembersOrganizationId":{"name":"id","in":"path","required":true,"description":"The organisation id of the caller.","schema":{"type":"string","format":"uuid"}},"MemberUserId":{"name":"user_id","in":"path","required":true,"description":"The member's account id.","schema":{"type":"string","format":"uuid"}},"SecureShareId":{"name":"id","in":"path","required":true,"description":"The Veilig delen link id.","schema":{"type":"string","format":"uuid"}},"ProjectId":{"name":"project_id","in":"path","required":true,"description":"The LEO project (dossier) id. Anything that is not a UUID answers `404 project_not_found`.","schema":{"type":"string","format":"uuid"}},"ProjectDocumentId":{"name":"document_id","in":"path","required":true,"description":"The document id. Anything that is not a UUID answers `404 document_not_found`.","schema":{"type":"string","format":"uuid"}},"ConversationId":{"name":"conversation_id","in":"path","required":true,"description":"Opaque public API conversation id, never an internal app id.","schema":{"$ref":"#/components/schemas/ConversationId"}},"ConversationPageLimit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":100}},"ConversationMessagePageLimit":{"name":"limit","in":"query","description":"Messages per page (default 10). A message is returned in full up to 200 000 characters for pages of up to 19 messages; larger pages shorten each message proportionally and set `truncated`.","schema":{"type":"integer","minimum":1,"maximum":200,"default":10}},"ConversationAfter":{"name":"after","in":"query","description":"Opaque cursor from next_cursor. Bound to the authorised selection.","schema":{"type":"string","minLength":1,"maxLength":200}},"ConversationDryRun":{"name":"dryRun","in":"query","description":"Validate and preview the operation without changing register entries. Approval is still required.","schema":{"type":"boolean","default":false}},"ConversationIdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key, retained for 24 hours. Reusing it for different arguments returns 422 idempotency_key_reused.","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Client-chosen unique key (we suggest a UUID) to make retries safe. Stored for 24 hours\nper credential and organisation (service key or personal token). Same key and same body: stored result is replayed and charged once.\nThe knowledge-base operations (`createKnowledgeBase`, `uploadKnowledgeBaseDocument`) work differently:\nthe key is bound to the organisation or knowledge base and lives as long as the object; see their descriptions.\n","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}},"ClientRequestId":{"name":"X-Client-Request-Id","in":"header","required":false,"description":"Your own correlation id. Stored as request metadata and echoed in usage exports; not used for idempotency.","schema":{"type":"string","maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}},"ApprovalGrant":{"name":"x-prudai-approval","in":"header","required":false,"description":"Approved one-use request id. Repeat the exact method, path, query and body. The grant is consumed before execution; obtain a new approval after a failed execution. Idempotency-Key is excluded from the approval fingerprint.","schema":{"type":"string","pattern":"^apr_[A-Za-z0-9]{24}$"}}},"responses":{"ProjectNotFound":{"description":"`project_not_found` (unknown project, or one you may not read: the same answer), `document_not_found`\n(not in this project), or `original_unavailable` (the original file is no longer stored).\n","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"DocumentServiceFailed":{"description":"The document service gave an unexpected answer (`upstream_error`); nothing of its answer is passed on.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadRequest":{"description":"Malformed request or unsupported parameter (for example client-sent `tools`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"context":{"error":{"message":"Malformed JSON request body.","type":"invalid_request_error","code":"invalid_json","param":null,"request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"}},"completeness":{"total":null,"returned":0,"truncated":false},"notIncluded":[],"provenance":{},"next":[]}}}},"Unauthorized":{"description":"Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PaymentRequired":{"description":"Not enough credits, a monthly spend cap has been reached, or an Ultra request exhausted the organisation budget (fair_use_budget_exhausted).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"context":{"error":{"message":"Insufficient credits. Top up in the account dashboard (API → Credits).","type":"insufficient_credits_error","code":"insufficient_credits","param":null,"request_id":"req_2Kd8sP0qWn4Lm6Zt1Xc3Vb7e","details":{"available_credits":3.2,"required_credits":25}}},"completeness":{"total":null,"returned":0,"truncated":false},"notIncluded":[],"provenance":{},"next":[]}}}},"Forbidden":{"description":"Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Unknown model, source or document.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Conflict":{"description":"A request with the same `Idempotency-Key` is still running.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnprocessableEntity":{"description":"Well-formed request with invalid values (for example an unknown `reasoning_effort`, empty `messages`, or an `Idempotency-Key` reused with a different body).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalError":{"description":"Unexpected error on Prudai's side. Not charged, except work that completed before the failure (reported in `details.charged_credits`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"BadGateway":{"description":"An upstream model provider or source failed. Not charged, except work that completed before the failure (reported in `details.charged_credits`).","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"OpenAIBadRequest":{"description":"Malformed request or unsupported parameter (for example client-sent `tools`).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"},"example":{"error":{"message":"Client-side tools are not supported. Prudai runs its research tools server-side; remove `tools` from the request.","type":"invalid_request_error","code":"tools_not_supported","param":"tools","request_id":"req_8Fq2nV0kLm3Xc7Rt5Yb1Hs9a"}}}}},"OpenAIUnauthorized":{"description":"Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIPaymentRequired":{"description":"Not enough credits, a monthly spend cap has been reached, or an Ultra request exhausted the organisation budget (fair_use_budget_exhausted).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"},"example":{"error":{"message":"Insufficient credits. Top up in the account dashboard (API → Credits).","type":"insufficient_credits_error","code":"insufficient_credits","param":null,"request_id":"req_2Kd8sP0qWn4Lm6Zt1Xc3Vb7e","details":{"available_credits":3.2,"required_credits":25}}}}}},"OpenAIForbidden":{"description":"Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAINotFound":{"description":"Unknown model, source or document.","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIConflict":{"description":"A request with the same `Idempotency-Key` is still running.","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIUnprocessableEntity":{"description":"Well-formed request with invalid values (for example an unknown `reasoning_effort`, empty `messages`, or an `Idempotency-Key` reused with a different body).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAITooManyRequests":{"description":"Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIInternalError":{"description":"Unexpected error on Prudai's side. Not charged, except work that completed before the failure (reported in `details.charged_credits`).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIBadGateway":{"description":"An upstream model provider or source failed. Not charged, except work that completed before the failure (reported in `details.charged_credits`).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIServiceUnavailable":{"description":"Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}},"OpenAIGatewayTimeout":{"description":"The request exceeded the maximum duration. Only work that completed is charged (reported in `details.charged_credits`).","x-prudai-envelope-exception":{"reason":"OpenAI-compatible error body ({error: {message, type, code, param, request_id}}): OpenAI SDKs raise their native errors from it, so this operation keeps that shape instead of the Prudai envelope. The request id is also in the X-Request-Id header."},"headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIErrorResponse"}}}}},"schemas":{"RegisterSourceQuery":{"type":"object","additionalProperties":false,"properties":{"filter":{"type":"object","default":{},"propertyNames":{"minLength":1,"maxLength":128},"additionalProperties":{"oneOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"sort":{"type":"object","additionalProperties":false,"required":["field","direction"],"properties":{"field":{"type":"string","minLength":1,"maxLength":128},"direction":{"type":"string","enum":["asc","desc"]}}},"cursor":{"type":"string","pattern":"^\\d{1,7}$"},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50},"aggregate":{"type":"object","additionalProperties":false,"required":["operation"],"properties":{"operation":{"type":"string","enum":["count","sum","avg","min","max"]},"field":{"type":"string","minLength":1,"maxLength":128}},"allOf":[{"if":{"properties":{"operation":{"enum":["sum","avg","min","max"]}}},"then":{"required":["field"]}}]}}},"TableField":{"type":"object","additionalProperties":false,"required":["key","label","type"],"properties":{"key":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_]{0,62}$"},"label":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","enum":["text","number","amount","percentage","date","boolean","choice","multichoice","party","link"]},"options":{"type":"array","maxItems":200,"items":{"type":"string","maxLength":200,"minLength":1},"minItems":1},"required":{"type":"boolean"}}},"TableCellProvenance":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source":{"enum":["user","ai","import","link"]},"quote":{"type":"string","maxLength":10000},"document_id":{"type":"string","maxLength":200},"ts":{"type":"string","format":"date-time"}}},"TableRecordInput":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"object","additionalProperties":true},"provenance":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TableCellProvenance"}}}},"RegisterTableInput":{"type":"object","additionalProperties":false,"required":["name","schema"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":10000},"knowledge_base_id":{"type":["string","null"],"maxLength":100},"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/TableField"}},"views":{"type":"array","maxItems":50,"description":"Shared views of this register (filters, sort, columns, presentation). Owner/Admin only; replaces the whole list. A field change that breaks a view the call does not resend is refused with 409 reason view_references_changed_field.","items":{"$ref":"#/components/schemas/TableView"}}}},"TableView":{"type":"object","additionalProperties":false,"required":["id","name","kind","query","columns"],"properties":{"id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"},"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"enum":["table","cards","timeline","chart","documents"]},"query":{"type":"object","additionalProperties":false,"properties":{"filters":{"type":"array","maxItems":30,"items":{"$ref":"#/components/schemas/TableFilter"}},"sort":{"type":"array","maxItems":5,"items":{"$ref":"#/components/schemas/TableSort"}},"limit":{"type":"integer","minimum":1,"maximum":1000},"group_by":{"type":"array","maxItems":5,"items":{"type":"string","maxLength":63}},"aggregates":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"enum":["count","sum","avg","min","max","median"]},"field":{"type":"string","maxLength":100},"as":{"type":"string","maxLength":100}}}}}},"columns":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":63}},"date_field":{"type":"string","maxLength":63,"description":"A date field (timeline)."},"link_field":{"type":"string","maxLength":63,"description":"A link or party field (documents)."}}},"TableFilter":{"type":"object","additionalProperties":false,"required":["field","op"],"properties":{"field":{"type":"string","minLength":1,"maxLength":100},"op":{"enum":["eq","neq","lt","lte","gt","gte","between","in","contains","is_empty"]},"value":{}}},"TableSort":{"type":"object","additionalProperties":false,"required":["field"],"properties":{"field":{"type":"string","minLength":1,"maxLength":100},"direction":{"enum":["asc","desc"]}}},"TableQueryInput":{"type":"object","additionalProperties":false,"properties":{"filters":{"type":"array","maxItems":30,"items":{"$ref":"#/components/schemas/TableFilter"}},"sort":{"type":"array","maxItems":5,"items":{"$ref":"#/components/schemas/TableSort"}},"limit":{"type":"integer","minimum":1,"maximum":1000},"cursor":{"type":"string","maxLength":10000},"include_deleted":{"type":"boolean"},"group_by":{"type":"array","maxItems":5,"items":{"type":"string","maxLength":63}},"aggregates":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["op"],"properties":{"op":{"enum":["count","sum","avg","min","max","median"]},"field":{"type":"string","maxLength":100},"as":{"type":"string","maxLength":100}}}}}},"VoiceMemoTarget":{"type":"object","additionalProperties":false,"required":["link_type","link_id"],"properties":{"link_type":{"type":"string","enum":["leo-project","ordo-dossier","cato-record"]},"link_id":{"type":"string","format":"uuid"},"subtype":{"type":"string","enum":["company","person","opportunity"]}},"description":"CATO requires subtype; only CATO accepts subtype. ORDO link_id is the corresponding LEO dossier-project UUID."},"VoiceMemoOptions":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":"boolean","default":true},"knowledge_base":{"type":"boolean","default":true},"cato_note":{"type":"boolean","default":false},"cato_soort":{"type":"string","enum":["GESPREK","ACHTERGROND"],"default":"ACHTERGROND"},"cato_target":{"$ref":"#/components/schemas/VoiceMemoTarget"}}},"VoiceMemo":{"type":"object","required":["id","status","sha256","byte_size","created_at","target"],"properties":{"id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string","enum":["uploaded","transcribing","ready","assigned","failed"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"byte_size":{"type":"integer","minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0},"target":{"oneOf":[{"$ref":"#/components/schemas/VoiceMemoTarget"},{"type":"null"}]},"options":{"$ref":"#/components/schemas/VoiceMemoOptions"},"summary":{"type":["string","null"]},"transcript":{"type":["string","null"],"description":"Only returned by getVoiceMemo."},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"assigned_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"would_upload":{"type":"boolean","description":"Only in dryRun previews."}}},"LinkTarget":{"type":"object","additionalProperties":true,"required":["link_type","link_id","label"],"properties":{"link_type":{"type":"string","enum":["leo-project","ordo-dossier","cato-record"]},"link_id":{"type":"string","format":"uuid"},"subtype":{"type":"string","enum":["company","person","opportunity"]},"label":{"type":"string"},"subtitle":{"type":"string"},"reason":{"type":"string","enum":["recent","last_opened","meeting","calendar","mentioned"],"description":"Present only in memo suggestions. meeting = the meeting at the recording (context.meeting: the meeting, leo_project existing|none|unknown and new_project_for_contact)."}},"description":"CATO requires subtype; only CATO accepts subtype. ORDO link_id is the corresponding LEO dossier-project UUID."},"VoiceMemoResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceMemo"}}}]},"VoiceMemoList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceMemo"}}}}]},"LinkTargetList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LinkTarget"}}}}]},"PushDevice":{"type":"object","required":["id","platform","active","last_seen_at","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"platform":{"type":"string","enum":["ios","web"]},"label":{"type":["string","null"]},"apns_environment":{"type":["string","null"],"enum":["sandbox","production",null]},"app_version":{"type":["string","null"]},"active":{"type":"boolean"},"last_seen_at":{"type":"string","format":"date-time"},"last_sent_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"PushDeviceResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PushDevice"}}}]},"PushDeviceList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PushDevice"}}}}]},"PushDeviceRemoved":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"removed":{"type":"integer","minimum":0}}}}}]},"PushTestResult":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"devices":{"type":"integer","minimum":0},"sent":{"type":"integer","minimum":0}}}}}]},"ProjectDocumentStatus":{"type":"string","description":"Processing status; `completed` = searchable and its text is readable.","enum":["pending","processing","chunking","embedding","indexing","completed","failed"]},"Project":{"type":"object","required":["id","name","description","kind","product","archived","role","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["dossier","table"]},"product":{"type":"string","description":"The product the project belongs to (`leo`, `zia`, `vera`, `bever`, ...)."},"archived":{"type":"boolean"},"role":{"type":"string","enum":["owner","editor","reader"],"description":"Your role; `owner` and `editor` may upload and delete documents."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProjectDocument":{"type":"object","required":["id","project_id","filename","kind","content_type","status","size_bytes","chunk_count","original_available","uploaded_by","subtitles","audio","created_at","updated_at","deleted_at"],"properties":{"id":{"type":"string","format":"uuid"},"project_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"kind":{"type":"string","enum":["audio","transcript","document"],"description":"From the extension. audio = .m4a .webm .mp3 .wav .ogg .aac .flac .opus .mp4; transcript = .vtt .srt."},"content_type":{"type":["string","null"],"description":"Derived from the extension."},"status":{"$ref":"#/components/schemas/ProjectDocumentStatus"},"size_bytes":{"type":["integer","null"],"minimum":0},"chunk_count":{"type":["integer","null"],"minimum":0},"original_available":{"type":"boolean","description":"False when the original file is no longer stored."},"uploaded_by":{"type":["object","null"],"description":"Who uploaded it (for an API upload always the token's user).","properties":{"name":{"type":"string"},"email":{"type":"string"}}},"subtitles":{"type":["object","null"],"description":"For transcripts (.vtt/.srt) once processed.","properties":{"format":{"type":"string"},"duration_seconds":{"type":"number","minimum":0},"speakers":{"type":"array","items":{"type":"string"}}}},"audio":{"type":["object","null"],"description":"For audio memos once transcribed.","properties":{"language_code":{"type":"string"},"provider":{"type":"string"},"duration_seconds":{"type":"number","minimum":0}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time","description":"Set while the document is in the trash; null for a live document."}}},"ProjectDocumentUploadPreview":{"type":"object","description":"The answer of `uploadProjectDocument` with `?dryRun=true`; nothing was stored.","required":["id","project_id","filename","kind","size_bytes","sha256","would_upload"],"properties":{"id":{"type":"null"},"project_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"kind":{"type":"string","enum":["audio","transcript","document"]},"content_type":{"type":["string","null"]},"size_bytes":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"would_upload":{"type":"boolean"}}},"ProjectDocumentText":{"type":"object","required":["document_id","filename","format","text","characters"],"properties":{"document_id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"format":{"type":"string","const":"text/plain"},"text":{"type":"string"},"characters":{"type":"integer","minimum":0}}},"ProjectDocumentDeleted":{"type":"object","description":"The answer of `deleteProjectDocument`; the document is in the trash.","required":["id","deleted","restorable"],"properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","const":true},"restorable":{"type":"boolean","const":true},"deleted_at":{"type":["string","null"],"format":"date-time"}}},"ProjectDocumentDeletePreview":{"type":"object","description":"The answer of `deleteProjectDocument` with `?dryRun=true`; nothing was moved.","required":["id","would_delete","irreversible","restorable"],"properties":{"id":{"type":"string","format":"uuid"},"would_delete":{"type":"boolean","const":true},"irreversible":{"type":"boolean","const":false},"restorable":{"type":"boolean","const":true},"filename":{"type":"string"},"kind":{"type":"string","enum":["audio","transcript","document"]},"size_bytes":{"type":["integer","null"]},"chunk_count":{"type":["integer","null"]},"original_available":{"type":"boolean"}}},"ProjectList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}]},"ProjectResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Project"}}}]},"ProjectDocumentList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectDocument"}}}}]},"ProjectDocumentResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/ProjectDocument"},{"$ref":"#/components/schemas/ProjectDocumentUploadPreview"}]}}}]},"ProjectDocumentTextResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProjectDocumentText"}}}]},"ProjectDocumentDeleteResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/ProjectDocumentDeleted"},{"$ref":"#/components/schemas/ProjectDocumentDeletePreview"}]}}}]},"KnowledgeBaseSelection":{"description":"Which of your organisation's own knowledge bases take part in a request that searches or generates\n`\"all\"` is the default, also when the field is missing: every active knowledge base\nof the organisation. `\"none\"`: no knowledge base (public sources only). An array: exactly these public ids\n(`kb_...`, 1 to 50, duplicates ignored).\n\nThe choice is always limited to the organisation of the key. An unknown id, or an id of another\norganisation, returns `404 knowledge_base_not_found` (never 403, so existence does not leak); a\nsoft-deleted knowledge base is skipped and reported in `notIncluded`. `prudai:knowledge_bases:read` is\nneeded unless the value is `\"none\"`: a key without it gets `403 insufficient_scope`, also when it leaves the\nfield out (that means `\"all\"`). Send `\"none\"` to run without knowledge bases. The knowledge-base query\noperations themselves always require the scope, whatever the value.\n","default":"all","oneOf":[{"type":"string","enum":["all","none"]},{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","pattern":"^kb_[A-Za-z0-9]{20}$"}}]},"ConversationId":{"type":"string","pattern":"^conv_[A-Za-z0-9]{20}$"},"Conversation":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConversationData"}}}]},"ConversationData":{"type":"object","required":["id","object","product","model","title","created_at","updated_at","deleted_at","purge_after"],"properties":{"id":{"$ref":"#/components/schemas/ConversationId"},"object":{"type":"string","const":"conversation"},"product":{"type":"string","enum":["leo","leo-fiscaal","vera","bever","zia","maia"]},"model":{"type":"string","minLength":1,"maxLength":80},"title":{"type":["string","null"],"maxLength":500},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"purge_after":{"type":["string","null"],"format":"date-time","description":"Restore deadline for a deleted entry, not a promise of content deletion."},"sources":{"type":["array","null"],"items":{"type":"string"},"description":"The source ids chosen with `prudai.sources` when the conversation started; null when none were chosen."}}},"ConversationList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","maxItems":200,"items":{"$ref":"#/components/schemas/ConversationData"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"maxLength":200}}}}}]},"ConversationMessageList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","maxItems":200,"items":{"$ref":"#/components/schemas/ConversationMessage"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"maxLength":200}}}}}]},"ConversationMessage":{"type":"object","required":["role","text","citations","created_at","truncated"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string","maxLength":200000,"description":"Message text with its original citation markers."},"citations":{"type":"array","items":{"$ref":"#/components/schemas/ConversationCitation"}},"created_at":{"type":"string","format":"date-time"},"truncated":{"type":"boolean","description":"True when the text or citation projection was limited by the output budget."}}},"ConversationCitation":{"type":"object","required":["reference","verified","identifier_exists","quote_verified"],"properties":{"reference":{"type":"string","description":"Public source reference from the stored audit."},"verified":{"type":["boolean","null"],"description":"Same meaning as PrudaiCitation.verified. A stored audit is per reference: when one mention of a\nreference carries a quote, the reference reads as quoted (`verified: null` until disproved), also\nif the completion marked another, unquoted mention of it `verified: true`. Two quoted mentions can give two\nentries with the same reference. Text that could not be read in full counts as quoted, so a truncated message\ncan read `null` where the completion said `true`; a disproved citation stays `false`.\n"},"identifier_exists":{"type":["boolean","null"],"description":"Same meaning as PrudaiCitation.identifier_exists."},"quote_verified":{"type":["boolean","null"],"description":"Same meaning as PrudaiCitation.quote_verified."}}},"OrgSkillMetadata":{"allOf":[{"$ref":"#/components/schemas/OrgSkillMetadataFields"}],"unevaluatedProperties":false},"OrgSkill":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["body"],"properties":{"body":{"type":"string","minLength":1,"maxLength":6000}},"allOf":[{"$ref":"#/components/schemas/OrgSkillMetadataFields"}]}}}]},"OrgSkillMetadataFields":{"description":"Shared published procedure metadata.","type":"object","required":["id","object","name","description","triggers","products","requires_tools","status","version","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"org_skill"},"name":{"type":"string","minLength":3,"maxLength":40},"description":{"type":"string","maxLength":220},"triggers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string"}},"products":{"oneOf":[{"type":"string","const":"all"},{"type":"array","items":{"type":"string"}}]},"requires_tools":{"type":"array","items":{"type":"string"}},"status":{"type":"string","const":"published"},"version":{"type":"integer","minimum":1},"updated_at":{"type":"string","format":"date-time"}}},"OrgSkillList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/OrgSkillMetadata"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"maxLength":200}}}}}]},"OrgSkillTestInput":{"type":"object","additionalProperties":false,"required":["skill","question","product"],"properties":{"skill":{"$ref":"#/components/schemas/OrgSkillInput"},"question":{"type":"string","minLength":1,"maxLength":2000},"product":{"$ref":"#/components/schemas/CapabilityProduct"}}},"OrgSkillInput":{"type":"object","additionalProperties":false,"required":["name","description","body","triggers"],"properties":{"name":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"},"description":{"type":"string","minLength":1,"maxLength":220,"description":"One-line statement of when the user needs this procedure (NL, EN or DE)."},"body":{"type":"string","minLength":1,"maxLength":6000},"triggers":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string","minLength":2,"maxLength":100}},"products":{"oneOf":[{"type":"string","const":"all"},{"type":"array","minItems":1,"items":{"type":"string"}}]},"requires_tools":{"type":"array","items":{"type":"string"}}}},"ManagedOrgSkill":{"type":"object","required":["id","object","namespace","name","status","version","updated_at","body","deleted_at"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"org_skill"},"namespace":{"type":"string","const":"org"},"name":{"type":"string","pattern":"^org:"},"description":{"type":"string"},"triggers":{"type":"array","items":{"type":"string"}},"products":{"oneOf":[{"type":"string","const":"all"},{"type":"array","items":{"type":"string"}}]},"requires_tools":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"version":{"type":"integer","minimum":0},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}}},"ManagedOrgSkillResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManagedOrgSkill"}}}]},"DocsSearchResult":{"type":"object","required":["query","language","matches"],"properties":{"query":{"type":"string"},"language":{"type":"string","enum":["nl","en"]},"matches":{"type":"array","items":{"type":"object","required":["title","slug","url","section","section_url","snippet","score"],"properties":{"title":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string","format":"uri"},"section":{"type":["string","null"],"description":"Heading path of the best matching section (\"Heading › Subheading\"); null for the introduction."},"section_url":{"type":"string","format":"uri","description":"Page URL with the anchor of that section."},"snippet":{"type":"string"},"score":{"type":"integer","minimum":0,"description":"Relative rank score within this response; not comparable across requests."}}}}}},"DocsPage":{"type":"object","required":["title","slug","language","url","markdown","headings","characters","truncated","visibility"],"properties":{"title":{"type":"string"},"slug":{"type":"string"},"language":{"type":"string","enum":["nl","en"]},"url":{"type":"string","format":"uri"},"markdown":{"type":"string"},"headings":{"type":"array","items":{"type":"string"}},"characters":{"type":"integer","minimum":0},"truncated":{"type":"boolean"},"visibility":{"type":"string","enum":["public","gated","staff"]}}},"DiscoverySkill":{"type":"object","required":["namespace","name","title","description","products"],"properties":{"namespace":{"type":"string","enum":["prudai","org"]},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"products":{"type":"array","items":{"type":"string"}}}},"CapabilityProduct":{"type":"string","description":"Exact product slug. Runtime product and staff restrictions still apply.","enum":["leo","leo-fiscaal","zia","vera","bever","maia","irma"]},"CapabilitySettingRequest":{"type":"object","description":"Gebruik het exacte functie-id uit de functielijst. Aanzetten wijzigt alleen de\nonderstaande bestaande instelling; uitzetten herstelt de hier beschreven lege\nstand. Dezelfde rollen en productrechten als in de app blijven gelden.\n\n* source-settings: geef disabledSourceIds met de uitgesloten bron-id's.\n  Uitzetten maakt die uitsluitingslijst leeg; het schakelt niet alle bronnen uit.\n  Alleen eigenaar of beheerder.\n* publisher-subscriptions: geef publisherIds met de uitgeversdiensten waarop\n  het kantoor al een abonnement heeft. Uitzetten wist die selectie. Koopt niets\n  en kent geen abonnement toe. Alleen eigenaar of beheerder met deze functie.\n* organization-prompt: geef prompt met de kantoorinstructies voor dit product.\n  Uitzetten wist die instructies. Alleen eigenaar of beheerder.\n* escalation-settings: geef minstens één van reviewer_account_ids (account-id's\n  van juristen in hetzelfde kantoor), notice_text of response_hint. Uitzetten\n  wist de juristen en beide teksten. Voorleggen aan de jurist moet al beschikbaar\n  zijn. Juristen aanwijzen vraagt eigenaar of beheerder; teksten mogen ook door\n  een daarvoor aangewezen jurist worden gewijzigd.\n* writing-style: laat settings weg of geef een leeg object. Zet alleen je eigen\n  bestaande schrijfstijlprofiel aan of uit, na eerdere toestemming in de app.\n* organization-social: laat settings weg of geef een leeg object. Zet nieuwsfeed\n  en collega-chat voor het kantoor aan of uit. Alleen de eigenaar.\n* feed-quiz: laat settings weg of geef een leeg object. Zet de nieuwsquiz voor\n  jezelf aan of uit. De nieuwsfeed moet beschikbaar zijn.\n\nGeef bij uitzetten geen ingevulde settings mee. product kiest de instelling\nvoor dat product; het moet binnen je bestaande toegang vallen.\n","additionalProperties":false,"properties":{"product":{"$ref":"#/components/schemas/CapabilityProduct"},"settings":{"type":"object","description":"Waarden voor de gekozen instelling zoals hierboven beschreven. Andere velden\nworden geweigerd. Laat weg of geef een leeg object bij de drie aan/uit-schakelaars\nen bij elke uitzetactie.\n","examples":[{"disabledSourceIds":["example-source"]},{"publisherIds":["example-publisher"]},{"prompt":"Schrijf helder en concreet."},{"notice_text":"Leg deze vraag eerst voor aan een jurist."},{}],"additionalProperties":true}}},"CapabilityActivationRequest":{"type":"object","additionalProperties":false,"required":["product"],"properties":{"product":{"$ref":"#/components/schemas/CapabilityProduct"},"reason":{"type":"string","maxLength":1000,"description":"Optional reason shown to the human reviewer; never interpreted as permission to activate or pay."}}},"CapabilityActivationResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"object","required":["approvalRequest","capability","costs","upgrade_url","activation"],"properties":{"approvalRequest":{"$ref":"#/components/schemas/ApprovalRequest"},"capability":{"type":"object","required":["id","product"],"properties":{"id":{"type":"string"},"product":{"$ref":"#/components/schemas/CapabilityProduct"}}},"costs":{"type":"string","const":"unknown"},"upgrade_url":{"type":"string","const":"https://account.prudai.com/console"},"activation":{"type":"string","const":"not_activated"}}}}}]},"CapabilityActivationGuidance":{"type":"object","required":["kind","url","approval","costs","approver"],"properties":{"kind":{"type":"string","enum":["self","connect","request"],"description":"self changes an existing app setting; connect follows the consent flow; request asks a human for a plan or paid feature."},"method":{"type":"string","const":"POST"},"path":{"type":"string"},"scope":{"type":"string"},"params":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/CapabilityProduct"}},"additionalProperties":true},"url":{"type":["string","null"],"format":"uri"},"approval":{"type":"string","enum":["none","instruct","confirm","review","forbidden_for_agents"]},"costs":{"type":"string","const":"unknown"},"approver":{"type":"string"}}},"DiscoveryCapability":{"type":"object","required":["id","product","title","description","enabled","reason","scope","scope_granted","enable","costs"],"properties":{"id":{"type":"string"},"product":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"enabled":{"type":["boolean","null"]},"reason":{"type":["string","null"]},"scope":{"type":["string","null"]},"scope_granted":{"type":["boolean","null"]},"enable":{"$ref":"#/components/schemas/CapabilityActivationGuidance"},"disable":{"$ref":"#/components/schemas/CapabilityActivationGuidance"},"costs":{"type":"string","const":"unknown"}}},"TaskEnvelope":{"type":"object","description":"Standard task response, including failures. All six keys are always present. data contains the domain payload; next contains executable transitions. Responses remain additive.","required":["data","context","completeness","notIncluded","provenance","next"],"properties":{"data":{"description":"Operation-specific payload, or null on failure."},"context":{"$ref":"#/components/schemas/TaskContext"},"completeness":{"$ref":"#/components/schemas/Completeness"},"notIncluded":{"type":"array","items":{"$ref":"#/components/schemas/NotIncluded"}},"provenance":{"type":"object","description":"Origin and retrieval/verification metadata; never internal prompts, tool names or secrets. Attribution and source metadata in data remain available.","additionalProperties":true},"next":{"type":"array","description":"Ready-made follow-ups (including pagination). Empty when there is no valid transition; licence and authorization are checked again on execution.","items":{"$ref":"#/components/schemas/NextCall"}}}},"TaskContext":{"type":"object","properties":{"request_id":{"$ref":"#/components/schemas/RequestId"},"routing":{"oneOf":[{"$ref":"#/components/schemas/RoutingBlock"},{"type":"null"}]},"error":{"$ref":"#/components/schemas/ErrorBody"}},"additionalProperties":true},"Completeness":{"type":"object","required":["total","returned","truncated"],"properties":{"total":{"type":["integer","null"],"minimum":0,"description":"Exact total matching the authorized selection, never an estimate. Null if the upstream cannot provide an exact total; explain that gap in notIncluded."},"returned":{"type":"integer","minimum":0,"description":"Items in this page/result (1 for an account, balance, document or answer; verification results count individually; 0 on error)."},"truncated":{"type":"boolean","description":"True if pagination, budget, source coverage or another limit omitted requested results. Explain limitations in notIncluded; provide executable next calls when available."}}},"NotIncluded":{"type":"object","required":["reason","next"],"properties":{"reason":{"type":"string","minLength":1,"description":"What this result does not establish or include."},"next":{"oneOf":[{"$ref":"#/components/schemas/NextCall"},{"type":"null"}],"description":"Ready call that can resolve this gap, or null if none is available."}}},"NextCall":{"type":"object","required":["operationId","method","path","params"],"properties":{"operationId":{"type":"string","enum":["listOrgSkills","getOrgSkill","createSkill","updateSkill","deleteSkill","testSkill","publishSkill","archiveSkill","restoreSkill","listSkillVersions","restoreSkillVersion","listSkills","getSkill","listCapabilities","enableCapability","disableCapability","requestCapability","listIntegrations","getGuide","searchDocs","getDocsPage","getApproval","listApprovals","listModels","retrieveModel","createChatCompletion","createConversation","createConversationMessage","getUsage","getCreditBalance","listCreditLedger","getAccount","listSources","searchSources","fetchSourceDocument","listDocumentReferences","listDocumentElements","answerFromSources","verifyCitations","listVoiceMemos","getVoiceMemo","getVoiceMemoSuggestions","listLinkTargets","listPushDevices","listProjects","getProject","listProjectDocuments","getProjectDocument","getProjectDocumentText","checkProjectDuplicates","requestProjectAccess","analyzeProjectDocumentAnonymization","createProjectDocumentAnonymizedCopy","getProjectDocumentFormFields","createProjectDocumentFilledCopy","analyzeAnonymization","anonymizeDocument","anonymizeText","listFeedItems","getFeedItem","listMembers","setMemberDisabled","removeMember","listSecureShares","getSecureShare","createSecureShare","createSecureShareRequest","revokeSecureShare","listExactSettlementProposals","getExactSettlementProposal","getExactSettlementReadiness","createExactSettlementProposal","decideExactSettlementProposals","listExactSettlementParked","releaseExactSettlementParked","updateExactSettlementBooking","getExactSettlementSettings","updateExactSettlementSettings","listIntegrationAdministrations","createIntegrationAdministration","restoreIntegrationAdministration","getExactConnection","deleteExactConnection","deleteExactData","startExactConnection","createExactInvite","listExactDivisions","updateExactDivisions","getExactFeature","updateExactFeature","getTwakaSyncStatus","listTwakaInvoices","getTwakaInvoice","matchTwakaPayment","listTwakaRelations","getTwakaRelation","listTwakaOrders","getTwakaOrderHistory","getTwakaRevenue","traceTwakaBatch","getTwakaArticlePrices","listArtifacts","readArtifact","findArtifact","editArtifact","writeArtifact","structureArtifact","listArtifactHistory","restoreArtifact","listWorkflows","listModules","proposeModule","publishModule","runModule","getWorkflowCatalog","getWorkflow","createWorkflow","updateWorkflow","copyWorkflowTemplate","prefillWorkflowIntake","startWorkflowRun","startWorkflowTemplateRun","listArtifactRuns","listWorkflowRuns","getWorkflowRun","submitWorkflowRunGate","continueWorkflowRun","cancelWorkflowRun","restoreWorkflow","listWorkflowRunDeliverables","downloadWorkflowRunDeliverable","listWorkflowRunTables","downloadProjectDocumentOriginal","restoreProjectDocument","listKnowledgeBases","listKnowledgeBaseDocuments","getKnowledgeBaseDocument","listArchiveItems","listConversations","getConversation","listConversationMessages","deleteConversation","restoreConversation","getFormProfile","restoreFormProfileField"]},"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string","pattern":"^/v1/[^{}]+$","description":"Origin-relative executable path, including /v1. All path arguments are URL-encoded and resolved; no placeholders."},"params":{"type":"object","description":"Complete JSON body for POST or query parameters for GET. Path parameters are already encoded in path. No credentials.","additionalProperties":true}}},"ErrorResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"type":"null"},"context":{"allOf":[{"$ref":"#/components/schemas/TaskContext"},{"type":"object","required":["error"]}]}}}]},"UsageReport":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UsageReportData"}}}]},"CreditBalance":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditBalanceData"}}}]},"CreditLedgerPage":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditLedgerPageData"}}}]},"SourceList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceListData"}}}]},"SourceSearchResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceSearchResponseData"},"context":{"allOf":[{"$ref":"#/components/schemas/TaskContext"},{"type":"object","required":["routing"]}]}}}]},"SourceDocument":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceDocumentData"}}}]},"SourceAnswerResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SourceAnswerResponseData"},"context":{"allOf":[{"$ref":"#/components/schemas/TaskContext"},{"type":"object","required":["routing"]}]}}}]},"CitationVerifyResponse":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CitationVerifyResponseData"}}}]},"DocumentReferenceList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DocumentReferenceListData"}}}]},"DocumentElementList":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DocumentElementListData"}}}]},"Account":{"allOf":[{"$ref":"#/components/schemas/TaskEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountData"}}}]},"ProductSlug":{"type":"string","description":"LEO-family product offered through the shared chat API. IRMA, ORDO and CATO use their own operation sets,\nbut a chat turn runs with the rights of the signed-in user and can read what that user's product connects:\nfor example mail, calendar, SharePoint and, for `leo`, ORDO dossiers. A chat turn never writes to connected systems; the model only keeps its own notes and task list within the conversation.\n","enum":["leo","leo-fiscaal","zia","vera","bever","maia"]},"ModelId":{"type":"string","description":"A product, optionally followed by `/` and a specialisation slug (e.g. `leo/arbeidsrecht`).","pattern":"^(leo|leo-fiscaal|zia|vera|bever|maia)(/[a-z0-9]+(-[a-z0-9]+)*)?$","maxLength":80,"examples":["leo","leo/arbeidsrecht","leo-fiscaal","zia","maia"]},"KeyId":{"type":"string","description":"Public id of an API key (not the secret).","pattern":"^key_[A-Za-z0-9]{20}$"},"RequestId":{"type":"string","pattern":"^req_[A-Za-z0-9]{24}$"},"PriceListVersion":{"type":"string","minLength":1,"description":"Version of the published price list this metered request was priced with (see the\ncredits and billing guide), also for free operations (priced at 0). A new version is published with its effective date whenever a model or\nprovider price changes. Treat the value as an opaque identifier.\n","examples":["2026-11-01"]},"Credits":{"type":"number","description":"Credit amount; 1 credit = EUR 0.01. Prudai rounds to at most three decimals (internally integer millicredits); do not rely on binary floating-point equality."},"PublicDepth":{"type":"string","description":"Depth actually used. `fast`, `standard`, `thorough` correspond to `reasoning_effort`\n`low`, `medium`, `high`; `ultra` is only reachable through `prudai.depth`.\n","enum":["fast","standard","thorough","ultra"]},"JurisdictionCode":{"type":"string","description":"`EU`, `INT` (international bodies such as the European Patent Office) or an ISO 3166-1 alpha-2 country code.","pattern":"^(EU|INT|[A-Z]{2})$"},"SourceId":{"type":"string","description":"Public source id from the Prudai source catalogue.","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":80},"OpenAIErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}}},"ErrorBody":{"type":"object","required":["message","type","code","param","request_id"],"properties":{"message":{"type":"string","description":"Human-readable explanation. Do not parse; use `code`."},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","conflict_error","insufficient_credits_error","rate_limit_error","api_error"]},"code":{"$ref":"#/components/schemas/ErrorCode"},"param":{"type":["string","null"],"description":"The request parameter the error is about, if any."},"request_id":{"$ref":"#/components/schemas/RequestId"},"details":{"$ref":"#/components/schemas/ErrorDetails"}}},"ErrorCode":{"type":"string","description":"Stable machine-readable code. HTTP status per code:\n400 `invalid_json`, `unsupported_parameter`, `tools_not_supported`; other rejected client requests use `invalid_request` with their 4xx status;\n401 `missing_api_key`, `invalid_api_key`, `api_key_revoked`, `api_key_expired`, `key_environment_mismatch`;\n402 `insufficient_credits`, `spend_cap_reached`, `fair_use_budget_exhausted`;\n403 `origin_not_allowed`, `insufficient_scope`, `model_not_permitted`, `organization_suspended`, `api_access_not_enabled`, `ip_not_allowed`, `depth_not_permitted`, `redistribution_not_permitted`, `approval_required` (legacy), `approval_invalid`, `approval_expired`, `forbidden_for_agents`;\n404 `model_not_found`, `source_not_found`, `document_not_found`, `unknown_operation`, `approval_invalid` (approval request not found);\n413 `request_too_large`; 415 `unsupported_charset`, `unsupported_encoding`;\n409 `idempotency_request_in_progress`;\n422 `validation_error`, `idempotency_key_reused`; 428 `precondition_required` (If-Match missing on a versioned update);\n429 `rate_limited`, `concurrency_limited`, `ultra_quota_exhausted`, `fair_use_limited`;\n500 `internal_error`; 502 `upstream_error`; 503 `service_unavailable`, `credit_check_unavailable`, `developer_api_disabled`; 504 `timeout`.\nAdditional phase-1 authentication codes: 401 `personal_tokens_not_enabled` (no longer returned since personal tokens are enabled; kept for compatibility); 503 `org_status_unavailable`; 503 `developer_api_not_configured`. Central approvals: 503 `approvals_central_unavailable` (the approval service is temporarily unavailable; nothing was executed, retry later), 409 `approval_decided_centrally` (this request is decided in the Console), 500 `approval_policy_missing`.\nExact-data wissen (`deleteExactData`): 409 `exact_busy` (an Exact job is running; retry later), 503 `exact_files_not_deleted` (some uploaded files remain; run the deletion again).\nPersonal tokens: 403 `membership_required` (the token's user is no longer a member of the organisation, or a person without a writing role called an operation that needs one), 403 `personal_token_required` (an operation only a personal token may call).\nProjects: 404 `project_not_found` (unknown or not readable: the same answer), 404 `original_unavailable` (the original file is no longer stored), 403 `project_write_required` (reader, or an ORDO dossier), 403 `product_not_entitled` (the account lacks the project's product), 403 `uploads_restricted` (organisation policy), 409 `project_not_ready` (no document store yet), 409 `document_conflict` (the document service refuses the change right now, e.g. the document is still being processed or its store is being removed; retry later), 409 `document_not_in_trash` (restore or purge of a document that is not in the trash), 409 `original_unavailable` (restore of a trashed document whose original is no longer stored; it stays in the trash and can be purged). Dubbel-dossier-melding: 404 `match_not_found` (the reference belongs to no match of yours for this name), 409 `already_has_access`.\nSources and chat: 422 `document_too_large` (the document is larger than the API serves; for a whole statute book `details.document_id_pattern` names the per-article id to use), 403 `user_token_required` (the operation needs a personal token), 503 `chat_token_unavailable` (the chat identity of this credential is temporarily unavailable). Anonymization: 415 `unsupported_format` (file type; 422 when the service rejects the content), 422 `unknown_finding_ids`, `nothing_selected`, `scanned_pdf_no_text_layer`, `untexted_pages_not_acknowledged`, `pdf_encrypted`, `unreadable`, `residual_check_failed`. Settlements: 422 `exact_release_mixed_divisions`, `exact_period_unknown`, `exact_gl_unknown`, `exact_gl_blocked`; 403 `exact_settings_manager_required` (only an owner or admin changes the settlement settings). Integration administrations: 404 `integration_not_available` (no MAIA or the koppeling is off), 404 `administration_not_found`, 409 `managed_elsewhere` (Exact divisions are managed on the Exact connection page), `already_linked`, `already_known_unlinked`, `managed_cannot_delete` (set up by Prudai: switch it off instead), `administration_unlinked`; 422 `token_invalid`, `token_refused`, `token_no_administration`, `administration_not_in_token`, `administration_choice_required` (`details.choices`).\n","enum":["invalid_json","invalid_request","origin_not_allowed","exact_not_available","twaka_not_available","twaka_not_connected","twaka_unavailable","twaka_query_timeout","twaka_invoice_not_found","twaka_relation_not_found","twaka_order_not_found","twaka_batch_not_found","exact_proposal_not_found","exact_demo_mode","exact_not_configured","exact_settlement_not_pdf","exact_settlement_unreadable","exact_busy","exact_files_not_deleted","integration_not_available","administration_not_found","managed_elsewhere","already_linked","already_known_unlinked","managed_cannot_delete","administration_unlinked","token_invalid","token_refused","token_no_administration","administration_not_in_token","administration_choice_required","document_too_large","user_token_required","chat_token_unavailable","unsupported_format","unknown_finding_ids","nothing_selected","nothing_to_anonymize","credentials_in_message","feed_not_available","feed_disabled","feed_item_not_found","push_device_not_found","user_not_provisioned","scanned_pdf_no_text_layer","untexted_pages_not_acknowledged","pdf_encrypted","unreadable","residual_check_failed","exact_release_mixed_divisions","exact_period_unknown","exact_gl_unknown","exact_gl_blocked","exact_settings_manager_required","exact_approver_required","exact_proposal_self_approval","exact_proposal_no_proposer","exact_approvers_not_designated","exact_proposer_not_designated","exact_platform_account","exact_proposal_decided","exact_proposal_not_approved","exact_nothing_to_decide","unsupported_charset","unsupported_encoding","unsupported_parameter","tools_not_supported","chat_requires_user_token","upstream_timeout","missing_api_key","invalid_api_key","api_key_revoked","api_key_expired","key_environment_mismatch","insufficient_credits","spend_cap_reached","fair_use_budget_exhausted","insufficient_scope","model_not_permitted","organization_suspended","api_access_not_enabled","ip_not_allowed","depth_not_permitted","redistribution_not_permitted","model_not_found","source_not_found","document_not_found","unknown_operation","request_too_large","idempotency_request_in_progress","validation_error","idempotency_key_reused","rate_limited","concurrency_limited","ultra_quota_exhausted","fair_use_limited","internal_error","upstream_error","service_unavailable","credit_check_unavailable","developer_api_disabled","timeout","personal_tokens_not_enabled","org_status_unavailable","developer_api_not_configured","approval_required","approval_invalid","approval_expired","approval_policy_missing","approval_decided_centrally","approvals_central_unavailable","forbidden_for_agents","membership_required","personal_token_required","project_not_found","match_not_found","already_has_access","project_write_required","project_not_ready","product_not_entitled","uploads_restricted","exports_restricted","original_unavailable","document_conflict","document_not_in_trash","knowledge_base_not_found","knowledge_base_limit_reached","version_conflict","precondition_required","workflow_not_found","workflow_run_not_found","workflows_upgrade_required","product_capability_required","workflow_cancel_unavailable","workflow_user_token_required","workflow_context_unavailable","artifact_source_unsupported"]},"ErrorDetails":{"type":"object","description":"Optional structured context. Only the fields relevant to the error code are present.","properties":{"retry_after_seconds":{"type":"integer","minimum":1},"required_scope":{"type":"string","description":"The concrete `<product>:<object>:<verb>` scope the credential lacks.","pattern":"^(?:[a-z][a-z0-9-]*:[a-z][a-z0-9_]*:(?:read|write|delete)|prudai:capabilities:request)$"},"available_credits":{"$ref":"#/components/schemas/Credits"},"required_credits":{"$ref":"#/components/schemas/Credits"},"spend_cap_scope":{"type":"string","enum":["organization","key"]},"resets_at":{"type":"string","format":"date-time"},"limit":{"type":"integer","minimum":0},"validation_errors":{"type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string","description":"JSON pointer into the request body."},"message":{"type":"string"}}}},"charged_credits":{"$ref":"#/components/schemas/Credits"}}},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"Model":{"type":"object","required":["id","object","created","owned_by","prudai"],"properties":{"id":{"$ref":"#/components/schemas/ModelId"},"object":{"type":"string","const":"model"},"created":{"type":"integer","description":"Unix seconds at which this model id became available."},"owned_by":{"type":"string","const":"prudai"},"prudai":{"$ref":"#/components/schemas/ModelPrudai"}}},"ModelPrudai":{"type":"object","required":["product","specialization","display_name","reasoning_efforts","default_reasoning_effort","ultra_available"],"properties":{"product":{"$ref":"#/components/schemas/ProductSlug"},"specialization":{"type":["string","null"],"description":"Specialisation slug, or null for the product itself."},"display_name":{"type":"string","examples":["LEO — Arbeidsrecht"]},"reasoning_efforts":{"type":"array","description":"The `reasoning_effort` values that map to a distinct depth for this model; higher values are clamped to the highest listed one.","items":{"type":"string","enum":["low","medium","high"]}},"default_reasoning_effort":{"type":"string","enum":["low","medium","high"]},"ultra_available":{"type":"boolean","description":"Whether `prudai.depth: \"ultra\"` is allowed for your organisation on this model."}}},"ChatCompletionRequest":{"type":"object","additionalProperties":false,"required":["model","messages"],"properties":{"model":{"$ref":"#/components/schemas/ModelId"},"messages":{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/ChatMessage"}},"stream":{"type":"boolean","default":false},"stream_options":{"$ref":"#/components/schemas/StreamOptions"},"reasoning_effort":{"type":"string","description":"`low` → fast, `medium` → standard, `high` → thorough. Values above the model's\nceiling are clamped; the applied depth is reported in `prudai.depth`.\nDefault: the model's `default_reasoning_effort`.\n","enum":["low","medium","high"]},"store":{"type":"boolean","description":"Only `true` (the default) is supported. API conversations are stored as part of your organisation's data; `false` returns `400 unsupported_parameter`.","const":true},"user":{"type":"string","maxLength":256,"description":"Opaque id of your end user, for abuse detection and per-end-user usage filtering. Do not send names or e-mail addresses."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Accepted and ignored."},"top_p":{"type":"number","minimum":0,"maximum":1,"description":"Accepted and ignored."},"presence_penalty":{"type":"number","minimum":-2,"maximum":2,"description":"Accepted and ignored."},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2,"description":"Accepted and ignored."},"seed":{"type":"integer","description":"Accepted and ignored."},"stop":{"description":"Accepted and ignored.","oneOf":[{"type":"string","maxLength":100},{"type":"array","maxItems":4,"items":{"type":"string","maxLength":100}}]},"metadata":{"type":"object","description":"Accepted and ignored (max 16 string pairs).","maxProperties":16,"propertyNames":{"maxLength":64},"additionalProperties":{"type":"string","maxLength":512}},"n":{"type":"integer","const":1,"description":"Only 1 is supported."},"max_tokens":{"type":"integer","minimum":1,"description":"Accepted and ignored at launch (answer length is controlled by Prudai; a cut answer has `finish_reason` `length`)."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"Accepted and ignored at launch, like `max_tokens`."},"logprobs":{"type":"boolean","const":false,"description":"Only `false` is accepted; `true` returns `400 unsupported_parameter`."},"response_format":{"type":"object","description":"Only `{\"type\": \"text\"}` is accepted; JSON modes return `400 unsupported_parameter`.","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","const":"text"}}},"prudai":{"$ref":"#/components/schemas/ChatPrudaiOptions"}}},"StreamOptions":{"type":"object","additionalProperties":false,"properties":{"include_usage":{"type":"boolean","default":false,"description":"Send a final chunk with `usage` and empty `choices` before `[DONE]`."}}},"ChatPrudaiOptions":{"type":"object","additionalProperties":false,"description":"Prudai extensions. With the OpenAI SDKs pass them via `extra_body={\"prudai\": {...}}`.","properties":{"depth":{"type":"string","enum":["ultra"],"description":"Request Ultra depth. Overrides `reasoning_effort`. Requires the Ultra capability on\nyour organisation (`403 depth_not_permitted` otherwise). A known organisation budget\nreplaces daily quotas; exhaustion returns `402 fair_use_budget_exhausted` unless\npostpaid billing or remaining topups permit the request. Unknown budgets retain\nthe daily fallback (`429 ultra_quota_exhausted` when used up).\n"},"approvals":{"type":"array","description":"Pending actions. The exact approved arguments execute through the existing human approval flow.","items":{"$ref":"#/components/schemas/ChatApprovalRequest"}},"tool_events":{"type":"boolean","default":false,"description":"Stream `prudai.tool` progress chunks (only with `stream: true`). Those chunks have empty `choices`."},"knowledge_bases":{"description":"All accessible knowledge bases (default), none, or selected public ids. Requires the knowledge-bases read scope when selected explicitly. Without that scope the default becomes none with a notIncluded explanation. Environments without the knowledge-base adapter report the omission.","oneOf":[{"type":"string","enum":["all","none"]},{"type":"array","maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^kb_[A-Za-z0-9]+$","maxLength":100}}]},"conversation_id":{"$ref":"#/components/schemas/ConversationId"},"citations":{"type":"string","enum":["annotations_and_prudai","prudai_only"],"default":"annotations_and_prudai","description":"Whether citations are also returned as OpenAI `url_citation` annotations."},"project_id":{"type":"string","format":"uuid","description":"Start the conversation inside this dossier (a project id from GET /v1/projects): the conversation belongs to the dossier and the model\ncan search and read its documents with the dossier tools your scopes allow (the app's automatic dossier overview is not added to API turns). Only when a conversation starts\n(POST /v1/conversations, or chat/completions without `conversation_id`); a later message keeps the dossier. Requires a signed-in person\nwith the projects read scope, read access to the dossier (`404 project_not_found` otherwise) and a model of the dossier's product\n(otherwise `422 validation_error` on `prudai.project_id`, with the dossier's product in the details).\n"},"sources":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","maxLength":80},"description":"Source ids from GET /v1/sources that this conversation may use. Every message of the conversation is narrowed to them among the sources of\nGET /v1/sources, inside what is already switched on for you and your organisation: a source that is off stays off, and connections that are\nnot in that list (for example your own business systems) are not affected. Only when a conversation starts; an unknown id\nreturns `422 validation_error` on that `prudai.sources` entry. Without this field your own source settings apply unchanged.\n"}}},"ChatMessage":{"description":"A conversation message. Roles `tool` and `function` are not supported.","oneOf":[{"$ref":"#/components/schemas/SystemMessage"},{"$ref":"#/components/schemas/DeveloperMessage"},{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/AssistantMessageInput"}],"discriminator":{"propertyName":"role","mapping":{"system":"#/components/schemas/SystemMessage","developer":"#/components/schemas/DeveloperMessage","user":"#/components/schemas/UserMessage","assistant":"#/components/schemas/AssistantMessageInput"}}},"MessageContent":{"description":"Text, or an array of text parts. Image, audio and file parts are not supported. At most 60000 characters of the request are sent to the model per turn: a longer single message keeps its first 60000 characters, a longer history drops its oldest messages first. Any cut sets prudai.context_truncated and is explained in prudai.notIncluded.","oneOf":[{"type":"string","minLength":1,"maxLength":200000},{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/TextContentPart"}}]},"TextContentPart":{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":200000}}},"SystemMessage":{"type":"object","additionalProperties":false,"required":["role","content"],"description":"Your instructions. They are added to (never replace) Prudai's own instructions, so\nsource policy, citation rules and safety boundaries keep applying.\n","properties":{"role":{"type":"string","const":"system"},"content":{"$ref":"#/components/schemas/MessageContent"},"name":{"type":"string","maxLength":64}}},"DeveloperMessage":{"type":"object","additionalProperties":false,"required":["role","content"],"description":"Treated exactly like a `system` message.","properties":{"role":{"type":"string","const":"developer"},"content":{"$ref":"#/components/schemas/MessageContent"},"name":{"type":"string","maxLength":64}}},"UserMessage":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"type":"string","const":"user"},"content":{"$ref":"#/components/schemas/MessageContent"},"name":{"type":"string","maxLength":64}}},"AssistantMessageInput":{"type":"object","additionalProperties":false,"required":["role","content"],"description":"An earlier assistant turn, for multi-turn conversations. `tool_calls` are not supported.","properties":{"role":{"type":"string","const":"assistant"},"content":{"$ref":"#/components/schemas/MessageContent"},"name":{"type":"string","maxLength":64}}},"ChatCompletion":{"type":"object","required":["id","object","created","model","choices","usage","prudai"],"properties":{"id":{"type":"string","pattern":"^chatcmpl-[A-Za-z0-9]{24}$"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer"},"model":{"$ref":"#/components/schemas/ModelId"},"choices":{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/ChatChoice"}},"usage":{"$ref":"#/components/schemas/CompletionUsage"},"prudai":{"$ref":"#/components/schemas/ChatPrudaiResult"}}},"ChatChoice":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer","const":0},"message":{"$ref":"#/components/schemas/AssistantMessage"},"finish_reason":{"$ref":"#/components/schemas/FinishReason"}}},"FinishReason":{"type":"string","description":"`stop` normal end; `length` the answer was cut (output budget or the per-conversation\ncost breaker; see `prudai.stop_reason`); `content_filter` the answer was withheld by a\nsafety boundary; `approval_required` means an action awaits human approval.\n","enum":["stop","length","content_filter","approval_required"]},"AssistantMessage":{"type":"object","required":["role","content","refusal","annotations"],"properties":{"role":{"type":"string","const":"assistant"},"content":{"type":["string","null"],"description":"The answer in Markdown. Citation markers in the text correspond to `prudai.citations[].marker`."},"refusal":{"type":["string","null"],"description":"Set when the request was refused (then `content` is null and `finish_reason` is `content_filter`)."},"annotations":{"type":"array","description":"OpenAI-compatible citations. Empty when `prudai.citations` is `prudai_only`.","items":{"$ref":"#/components/schemas/UrlCitationAnnotation"}}}},"UrlCitationAnnotation":{"type":"object","required":["type","url_citation"],"properties":{"type":{"type":"string","const":"url_citation"},"url_citation":{"type":"object","required":["url","title","start_index","end_index"],"properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"start_index":{"type":"integer","minimum":0,"description":"Start of the cited span in `content` (UTF-16 code units, like OpenAI)."},"end_index":{"type":"integer","minimum":0}}}}},"CompletionUsage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"description":"Tokens summed over every model call Prudai made for this request, including tool\nrounds. Billing uses `prudai.cost_credits`, not a client-side token calculation.\n","properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"prompt_tokens_details":{"type":"object","required":["cached_tokens"],"properties":{"cached_tokens":{"type":"integer","minimum":0}}},"completion_tokens_details":{"type":"object","required":["reasoning_tokens"],"properties":{"reasoning_tokens":{"type":"integer","minimum":0}}}}},"ChatPrudaiResult":{"type":"object","required":["request_id","cost_credits","price_list_version","depth","citations","tool_calls","stop_reason"],"properties":{"ai_provenance":{"$ref":"#/components/schemas/AiOutputProvenance"},"conversation_id":{"$ref":"#/components/schemas/ConversationId"},"citation_check":{"type":"string","enum":["complete","pending","unverifiable"],"description":"`complete`: every citation has a settled `verified`. `pending`: the citation audit had not finished when this\nanswer was returned; read the stored result through listConversationMessages. `unverifiable`: the audit ran and\nat least one citation stays `verified: null`, for example a quote from a public source, which the audit cannot prove.\n"},"context_truncated":{"type":"boolean","description":"Part of the request was not sent to the model because of the 60000-character limit per turn (a single message keeps its beginning; a history drops its oldest messages). The reason is in notIncluded."},"notIncluded":{"type":"array","items":{"$ref":"#/components/schemas/NotIncluded"}},"tool_events":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/PrudaiToolEvent"}},"request_id":{"$ref":"#/components/schemas/RequestId"},"cost_credits":{"type":"null","description":"Credit charging is not activated for API chat."},"price_list_version":{"$ref":"#/components/schemas/PriceListVersion"},"depth":{"$ref":"#/components/schemas/DepthReport"},"citations":{"type":"array","items":{"$ref":"#/components/schemas/PrudaiCitation"}},"tool_calls":{"$ref":"#/components/schemas/ToolCallSummary"},"stop_reason":{"type":"string","description":"Why the answer ended. `cost_breaker` = the per-conversation cost breaker stopped further work.","enum":["completed","output_limit","cost_breaker","safety_boundary","deadline","approval_required"]},"approvals":{"type":"array","maxItems":100,"description":"Actions waiting for a human decision (`stop_reason: approval_required`). Each id is an approval request: read it with `GET /v1/approvals/{id}`.","items":{"$ref":"#/components/schemas/ChatApprovalRequest"}},"next":{"type":"array","description":"What to do next when actions are pending: read each approval request (`getApproval`), then continue with a new message on this conversation (`createConversationMessage`). The approved action runs as soon as it is approved, with the requester's rights checked again, and its outcome stands in the conversation as a tool result; this works when the approval comes within about 5 minutes of the question (the lifetime of the requester's turn credential); a later approval runs the call when that next message arrives instead.","items":{"$ref":"#/components/schemas/NextCall"}}}},"AiOutputProvenance":{"type":"object","description":"Unsigned machine-readable AI origin metadata (prudai-ai-provenance/1). It is not a signature or watermark and does not survive extracting only the answer text.","required":["ai_generated","digital_source_type","provider","spec"],"properties":{"ai_generated":{"type":"boolean","const":true},"digital_source_type":{"type":"string","enum":["http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia","http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia"]},"provider":{"type":"string","const":"Prudai B.V."},"spec":{"type":"string","const":"prudai-ai-provenance/1"},"system":{"type":"string"}}},"ChatApprovalRequest":{"type":"object","required":["id","level","summary","operation"],"properties":{"id":{"type":"string"},"level":{"type":"string","enum":["confirm","review"]},"summary":{"type":"string"},"operation":{"type":"string"}}},"DepthReport":{"type":"object","required":["requested","applied","clamped"],"properties":{"requested":{"$ref":"#/components/schemas/PublicDepth"},"applied":{"$ref":"#/components/schemas/PublicDepth"},"clamped":{"type":"boolean","description":"True when `applied` is lower than `requested` because of the model's or organisation's depth ceiling."}}},"ToolCallSummary":{"type":"object","required":["count","priced_count","priced_credits"],"description":"Server-side research calls made for this request. Tool names are not exposed.","properties":{"count":{"type":"integer","minimum":0},"priced_count":{"type":"integer","minimum":0,"description":"Calls to sources with a per-call price."},"priced_credits":{"$ref":"#/components/schemas/Credits"}}},"PrudaiCitation":{"type":"object","required":["marker","source_id","source_name","title","url","identifiers","article","quote","verified","identifier_exists","quote_verified","attribution","start_index","end_index"],"properties":{"marker":{"type":"string","description":"The marker used in the answer text (e.g. `[1]`)."},"type":{"type":"string","enum":["source","knowledge_base"]},"source_id":{"oneOf":[{"$ref":"#/components/schemas/SourceId"},{"type":"string","const":"knowledge_base"}]},"source_name":{"type":"string","examples":["Rechtspraak.nl"]},"title":{"type":"string"},"url":{"type":["string","null"],"format":"uri"},"identifiers":{"$ref":"#/components/schemas/DocumentIdentifiers"},"article":{"type":["string","null"],"description":"Article or paragraph reference, e.g. `art. 7:678 BW`."},"quote":{"type":["string","null"],"description":"Verbatim passage from the retrieved text. Null when the source supplied no text (metadata-only source) — Prudai never presents a quote that was not retrieved."},"verified":{"type":["boolean","null"],"description":"Summary of `identifier_exists` and `quote_verified`. false = either failed (the marker is\nkept but flagged). true = the identifier exists and no quote needs proving, or a quote from\na supplied knowledge-base passage was found in that passage. null = not settled: not yet\nchecked, or a quote from a public source, which the citation audit can disprove but not prove.\n"},"identifier_exists":{"type":["boolean","null"],"description":"Whether the cited reference resolved. null = not checked, or the source was unreachable."},"quote_verified":{"type":["boolean","null"],"description":"Whether a quoted passage was proven. true only for a knowledge-base passage; false when the quote\nwas not found in the source; null when there is no quote or it could not be proven.\n"},"attribution":{"type":["string","null"],"description":"Required source attribution from Prudai's licence register, when the licence requires one."},"start_index":{"type":["integer","null"],"minimum":0},"end_index":{"type":["integer","null"],"minimum":0}}},"DocumentIdentifiers":{"type":"object","required":["ecli","celex","other"],"properties":{"ecli":{"type":["string","null"],"pattern":"^ECLI:[A-Z]{2}:[A-Z0-9.]+:[0-9]{4}:[A-Z0-9.]+$"},"celex":{"type":["string","null"],"maxLength":40},"other":{"type":["string","null"],"maxLength":200,"description":"Another stable identifier (e.g. a BWB id or Kamerstuk number)."}}},"ChatCompletionStreamEvent":{"description":"The JSON payload of one SSE `data:` line (the terminal `[DONE]` line is not JSON).","oneOf":[{"$ref":"#/components/schemas/ChatCompletionChunk"},{"$ref":"#/components/schemas/StreamErrorEvent"}]},"ChatCompletionChunk":{"type":"object","required":["id","object","created","model","choices"],"description":"Chunk kinds:\n* content chunks: `choices[0].delta.content` (the first one also carries `delta.role`);\n* optional tool chunks (`prudai.tool_events: true`): `choices: []`, `prudai.tool` set;\n  they may arrive before the first content chunk and between content chunks;\n* the finish chunk, after all content and tool chunks: `choices[0].finish_reason` set,\n  `choices[0].delta.annotations` and `prudai.result` set;\n* the optional usage chunk (`stream_options.include_usage: true`), last before\n  `[DONE]`: `choices: []`, `usage` set.\n","properties":{"id":{"type":"string","pattern":"^chatcmpl-[A-Za-z0-9]{24}$"},"object":{"type":"string","const":"chat.completion.chunk"},"created":{"type":"integer"},"model":{"$ref":"#/components/schemas/ModelId"},"choices":{"type":"array","maxItems":1,"items":{"$ref":"#/components/schemas/ChunkChoice"}},"usage":{"oneOf":[{"$ref":"#/components/schemas/CompletionUsage"},{"type":"null"}]},"prudai":{"oneOf":[{"$ref":"#/components/schemas/ChunkPrudai"},{"type":"null"}]}}},"ChunkChoice":{"type":"object","required":["index","delta","finish_reason"],"properties":{"index":{"type":"integer","const":0},"delta":{"$ref":"#/components/schemas/ChunkDelta"},"finish_reason":{"oneOf":[{"$ref":"#/components/schemas/FinishReason"},{"type":"null"}]}}},"ChunkDelta":{"type":"object","properties":{"role":{"type":"string","const":"assistant","description":"Only on the first content chunk."},"content":{"type":["string","null"]},"refusal":{"type":["string","null"]},"annotations":{"type":"array","description":"Only on the finish chunk.","items":{"$ref":"#/components/schemas/UrlCitationAnnotation"}}}},"ChunkPrudai":{"type":"object","description":"Content chunks carry ai_provenance, including partial answers. Tool chunks carry tool; finish chunks carry result, which repeats the provenance. Usage-only chunks need not carry provenance.","properties":{"ai_provenance":{"$ref":"#/components/schemas/AiOutputProvenance"},"tool":{"$ref":"#/components/schemas/PrudaiToolEvent"},"result":{"$ref":"#/components/schemas/ChatPrudaiResult"}}},"PrudaiToolEvent":{"type":"object","required":["event_id","status","source_id","label","result_count"],"description":"Progress of one server-side research step. Carries the public source id and a\nhuman-readable label, never an internal tool name or arguments.\n","properties":{"event_id":{"type":"string","description":"Same id for the `started` and the matching `completed`/`failed` event."},"status":{"type":"string","enum":["started","completed","failed"]},"source_id":{"oneOf":[{"$ref":"#/components/schemas/SourceId"},{"type":"null"}]},"label":{"type":"string","examples":["Searching case law (Rechtspraak.nl)"]},"result_count":{"type":["integer","null"],"minimum":0}}},"StreamErrorEvent":{"type":"object","required":["error"],"description":"Sent when the request fails after the stream started; followed by `data: [DONE]`. Work completed before the error is reported in `details.charged_credits`.","properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}}},"UsageReportData":{"type":"object","required":["object","start_date","end_date","group_by","data","totals"],"properties":{"object":{"type":"string","const":"usage.report"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date"},"group_by":{"type":"array","items":{"type":"string","enum":["day","key","model","operation","source"]}},"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageBucket"}},"totals":{"$ref":"#/components/schemas/UsageCounters"},"workflow_runs":{"type":"array","maxItems":1000,"description":"One line per workflow run with model calls in the period (live credentials only; left out, with a notIncluded reason, when filtered on\nkey, model or another operation). Filter on just these with `operation=workflow.runs`. Runs are not part of `totals`.\n","items":{"$ref":"#/components/schemas/WorkflowRunUsage"}}}},"WorkflowRunUsage":{"type":"object","required":["workflow_run_id","product","first_at","last_at","model_calls","input_tokens","cached_input_tokens","output_tokens","credits"],"properties":{"workflow_run_id":{"type":"string","description":"The run id of GET /v1/workflow-runs/{id}."},"product":{"type":"string"},"first_at":{"type":"string","format":"date-time","description":"First model call of the run inside the period."},"last_at":{"type":"string","format":"date-time","description":"Last model call of the run inside the period."},"model_calls":{"type":"integer","minimum":0},"input_tokens":{"type":"integer","minimum":0},"cached_input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"credits":{"type":"null","description":"Credits are not settled per workflow run line here; a run's own spend shows on getWorkflowRun (budget) and counts toward the organisation's fair-use budget."}}},"UsageOperation":{"type":"string","description":"The metered manifest operation identifier. Legacy dotted operation names are accepted as filters.","pattern":"^[A-Za-z][A-Za-z0-9_.-]{0,99}$","examples":["listModels","getUsage","createChatCompletion","sources.search"]},"UsageCounters":{"type":"object","required":["requests","failed_requests","input_tokens","cached_input_tokens","output_tokens","reasoning_tokens","priced_tool_calls","source_requests","credits"],"properties":{"requests":{"type":"integer","minimum":0},"failed_requests":{"type":"integer","minimum":0,"description":"Requests that ended in an error (not charged unless partial work was charged)."},"input_tokens":{"type":"integer","minimum":0},"cached_input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"reasoning_tokens":{"type":"integer","minimum":0},"priced_tool_calls":{"type":"integer","minimum":0},"source_requests":{"type":"integer","minimum":0,"description":"`/sources/*` and `/citations/verify` requests (free at launch, counted here)."},"credits":{"description":"Null while credit accounting is disabled or the metered amount is unavailable.","oneOf":[{"$ref":"#/components/schemas/Credits"},{"type":"null"}]}}},"UsageBucket":{"type":"object","required":["date","key_id","key_name","model","operation","source_id","requests","failed_requests","input_tokens","cached_input_tokens","output_tokens","reasoning_tokens","priced_tool_calls","source_requests","credits"],"properties":{"date":{"type":["string","null"],"format":"date","description":"Set when grouped by `day`."},"key_id":{"description":"Set when grouped by `key`.","oneOf":[{"$ref":"#/components/schemas/KeyId"},{"type":"null"}]},"key_name":{"type":["string","null"]},"model":{"description":"Set when grouped by `model` (null for operations without a model, such as search).","oneOf":[{"$ref":"#/components/schemas/ModelId"},{"type":"null"}]},"operation":{"description":"Set when grouped by `operation`.","oneOf":[{"$ref":"#/components/schemas/UsageOperation"},{"type":"null"}]},"source_id":{"description":"Set when grouped by `source`.","oneOf":[{"$ref":"#/components/schemas/SourceId"},{"type":"null"}]},"requests":{"type":"integer","minimum":0},"failed_requests":{"type":"integer","minimum":0},"input_tokens":{"type":"integer","minimum":0},"cached_input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"reasoning_tokens":{"type":"integer","minimum":0},"priced_tool_calls":{"type":"integer","minimum":0},"source_requests":{"type":"integer","minimum":0},"credits":{"description":"Null while credit accounting is disabled or the metered amount is unavailable.","oneOf":[{"$ref":"#/components/schemas/Credits"},{"type":"null"}]}}},"CreditBalanceData":{"type":"object","required":["object","billing_mode","balance_credits","reserved_credits","available_credits","credit_limit_credits","low_balance_threshold_credits","spend_caps","expiring","eur_per_credit","as_of"],"properties":{"object":{"type":"string","const":"credit_balance"},"billing_mode":{"type":"string","description":"`prepaid` = credits bought or granted up front; `postpaid_contract` = usage invoiced afterwards under a contract, down to `credit_limit_credits`.","enum":["prepaid","postpaid_contract"]},"balance_credits":{"$ref":"#/components/schemas/Credits"},"reserved_credits":{"$ref":"#/components/schemas/Credits"},"available_credits":{"$ref":"#/components/schemas/Credits"},"credit_limit_credits":{"oneOf":[{"$ref":"#/components/schemas/Credits"},{"type":"null"}],"description":"How far the balance may go below zero (postpaid contracts only)."},"low_balance_threshold_credits":{"oneOf":[{"$ref":"#/components/schemas/Credits"},{"type":"null"}]},"spend_caps":{"type":"object","required":["organization","key"],"properties":{"organization":{"oneOf":[{"$ref":"#/components/schemas/SpendCapStatus"},{"type":"null"}]},"key":{"oneOf":[{"$ref":"#/components/schemas/SpendCapStatus"},{"type":"null"}],"description":"Cap of the calling key."}}},"expiring":{"type":"array","description":"Granted or bought credits with an expiry date, soonest first.","items":{"$ref":"#/components/schemas/ExpiringCredits"}},"eur_per_credit":{"type":"number","const":0.01},"as_of":{"type":"string","format":"date-time"}}},"SpendCapStatus":{"type":"object","required":["period","limit_credits","used_credits","resets_at"],"properties":{"period":{"type":"string","const":"month"},"limit_credits":{"$ref":"#/components/schemas/Credits"},"used_credits":{"$ref":"#/components/schemas/Credits"},"resets_at":{"type":"string","format":"date-time"}}},"ExpiringCredits":{"type":"object","required":["credits","expires_at"],"properties":{"credits":{"$ref":"#/components/schemas/Credits"},"expires_at":{"type":"string","format":"date-time"}}},"CreditLedgerEntryType":{"type":"string","description":"`topup` credits bought; `grant` credits given by Prudai (e.g. the starting grant or pilot credits);\n`usage` credits used by a request; `adjustment` manual correction (either sign);\n`expiry` unused granted/bought credits that expired; `refund` credits returned for a\ncharged request.\n","enum":["topup","grant","usage","adjustment","expiry","refund"]},"CreditLedgerPageData":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditLedgerEntry"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"CreditLedgerEntry":{"type":"object","required":["id","object","created_at","type","amount_credits","balance_after_credits","description","key_id","model","request_id","expires_at","reference"],"properties":{"id":{"type":"string","pattern":"^cle_[A-Za-z0-9]{24}$"},"object":{"type":"string","const":"credit_ledger_entry"},"created_at":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/CreditLedgerEntryType"},"amount_credits":{"$ref":"#/components/schemas/Credits"},"balance_after_credits":{"$ref":"#/components/schemas/Credits"},"description":{"type":"string","description":"Short, content-free description (e.g. `Pilot grant`, `chat.completion leo standard`)."},"key_id":{"oneOf":[{"$ref":"#/components/schemas/KeyId"},{"type":"null"}]},"model":{"oneOf":[{"$ref":"#/components/schemas/ModelId"},{"type":"null"}]},"request_id":{"oneOf":[{"$ref":"#/components/schemas/RequestId"},{"type":"null"}]},"expires_at":{"type":["string","null"],"format":"date-time","description":"For `topup` and `grant` entries with an expiry."},"reference":{"type":["string","null"],"description":"External reference (invoice number, original entry id for refunds)."}}},"SourceKind":{"type":"string","enum":["legislation","case_law","decisions","parliamentary","official_publications","register","guidance","literature","other"]},"SourceAccess":{"type":"string","description":"`full_text` — the licence permits redistribution (`doorleveren: ja` in Prudai's\nlicence register): search snippets and `fetch` are available. `reference_only` —\nmetadata and a link to the publisher only.\n","enum":["full_text","reference_only"]},"SourceListData":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Source"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"Source":{"type":"object","required":["id","object","name","jurisdiction","kind","publisher","url","access","licence"],"properties":{"id":{"$ref":"#/components/schemas/SourceId"},"object":{"type":"string","const":"source"},"name":{"type":"string"},"jurisdiction":{"$ref":"#/components/schemas/JurisdictionCode"},"kind":{"$ref":"#/components/schemas/SourceKind"},"publisher":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"access":{"$ref":"#/components/schemas/SourceAccess"},"licence":{"$ref":"#/components/schemas/SourceLicence"}}},"SourceLicence":{"type":"object","required":["name","attribution","terms_url","verified_on"],"properties":{"name":{"type":"string","examples":["CC0 1.0","CC BY 4.0","Licence Ouverte 2.0"]},"attribution":{"type":["string","null"],"description":"Attribution you must show when you display results from this source."},"terms_url":{"type":["string","null"],"format":"uri"},"verified_on":{"type":"string","format":"date","description":"Date Prudai last verified the licence at the primary source."}}},"SourceSearchRequest":{"type":"object","additionalProperties":false,"required":["query"],"properties":{"query":{"type":"string","minLength":1,"maxLength":2000},"mode":{"type":"string","enum":["auto","explicit"],"default":"auto"},"source_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"description":"Required with `mode: explicit`; explicit selections take precedence over identifier routing.","items":{"$ref":"#/components/schemas/SourceId"}},"kind":{"type":"string","enum":["legislation","case_law","decisions","parliamentary","official_publications","register","guidance","literature","other"]},"jurisdictions":{"type":"array","maxItems":30,"uniqueItems":true,"items":{"$ref":"#/components/schemas/JurisdictionCode"}},"date_from":{"type":"string","format":"date"},"date_to":{"type":"string","format":"date"},"search_mode":{"type":"string","enum":["keyword","semantic","hybrid"],"default":"hybrid","description":"This release performs keyword and identifier search; semantic retrieval is not included and is reported in notIncluded. hybrid (default) ranks the keyword hits of all selected sources together; keyword traverses sources in catalog order, one source per page."},"sort":{"type":"string","enum":["relevance","date_desc","date_asc"],"default":"relevance","description":"Ordering within the returned source page. relevance with search_mode hybrid ranks across sources; date orderings apply within the page only."},"date_field":{"type":"string","enum":["publication_date","decision_date","valid_from"],"default":"publication_date","description":"This release supports publication_date only. Other values return unsupported_parameter."},"as_of":{"type":"string","format":"date","description":"Search legislation as it was in force on this date, where the source provides versions. Default today.\nA date in the future is refused (422).\n"},"document_ids":{"type":"array","minItems":1,"maxItems":100,"description":"Search only within these documents.","items":{"type":"object","additionalProperties":false,"required":["source_id","document_id"],"properties":{"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string","minLength":1,"maxLength":300}}}},"facets":{"type":"array","uniqueItems":true,"maxItems":4,"description":"Facet counts for the returned page, not the entire upstream result set.","items":{"type":"string","enum":["source_id","jurisdiction","kind","year"]}},"cursor":{"type":"string","maxLength":500,"description":"`next_cursor` of the previous page; the other fields must be unchanged."},"max_results":{"type":"integer","minimum":1,"maximum":50,"default":10,"description":"Page size. Pages traverse sources deterministically; use `cursor` for further pages."},"max_passages_per_hit":{"type":"integer","minimum":0,"maximum":5,"default":3,"description":"Verified passages to return per hit (`0` = none). Same price."}}},"SourceSearchResponseData":{"type":"object","required":["object","request_id","mode","results","has_more","next_cursor","facets","prudai"],"properties":{"object":{"type":"string","const":"source_search"},"request_id":{"$ref":"#/components/schemas/RequestId"},"mode":{"type":"string","enum":["auto","explicit"]},"results":{"type":"array","items":{"$ref":"#/components/schemas/SourceSearchHit"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]},"facets":{"type":["object","null"],"description":"Present when `facets` was requested; one array of value counts per facet.","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/SearchFacetValue"}}},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"SourceSearchHit":{"type":"object","if":{"properties":{"access":{"const":"reference_only"}}},"then":{"properties":{"snippet":{"type":"null"},"passages":{"items":{"properties":{"quote":{"type":"null"}}}}}},"required":["source_id","document_id","title","url","identifiers","date","snippet","passages","access","attribution"],"properties":{"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string","maxLength":300},"title":{"type":"string"},"url":{"type":["string","null"],"format":"uri"},"identifiers":{"$ref":"#/components/schemas/DocumentIdentifiers"},"date":{"type":["string","null"],"format":"date"},"snippet":{"type":["string","null"],"description":"Verbatim excerpt; only for `full_text` sources, otherwise null."},"passages":{"type":"array","maxItems":5,"description":"Verified passages in this document that bear on the query, in both `auto` and\n`explicit` mode: exact location (article, paragraph, legal consideration \"r.o.\",\nsection), verbatim `quote` and `verified` from the same citation check the chat API\nuses. For `reference_only` sources each passage has the location but `quote: null`.\n","items":{"$ref":"#/components/schemas/Passage"}},"validity":{"$ref":"#/components/schemas/Validity"},"access":{"$ref":"#/components/schemas/SourceAccess"},"attribution":{"type":["string","null"]}}},"RoutingBlock":{"type":"object","required":["strategy","selected"],"properties":{"strategy":{"type":"string","description":"`deterministic` = profile rules; `model` = a routing model chose; `fallback_llm` = the small-LLM fallback chose.","enum":["deterministic","model","fallback_llm"]},"selected":{"type":"array","items":{"type":"object","required":["source_id","confidence","reason"],"properties":{"source_id":{"$ref":"#/components/schemas/SourceId"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","maxLength":300}}}}}},"SourceDocumentData":{"type":"object","required":["object","source_id","document_id","title","url","identifiers","date","language","content_format","content","attribution","retrieved_at","prudai"],"properties":{"object":{"type":"string","const":"source_document"},"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string"},"title":{"type":"string"},"url":{"type":["string","null"],"format":"uri"},"identifiers":{"$ref":"#/components/schemas/DocumentIdentifiers"},"date":{"type":["string","null"],"format":"date"},"language":{"type":"string","description":"BCP 47 language tag of the text.","examples":["nl","en","fr"]},"content_format":{"type":"string","enum":["text","markdown"]},"content":{"type":"string","description":"The full text as published by the source (pseudonymised where the source pseudonymises)."},"attribution":{"type":["string","null"]},"retrieved_at":{"type":"string","format":"date-time"},"validity":{"$ref":"#/components/schemas/Validity"},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"SourcesPrudaiResult":{"type":"object","required":["request_id","request_kind","cost_credits","price_list_version"],"properties":{"request_id":{"$ref":"#/components/schemas/RequestId"},"request_kind":{"type":"string","enum":["search","routed_search","fetch","references","elements","verify_citations","source_answer"]},"cost_credits":{"$ref":"#/components/schemas/Credits"},"price_list_version":{"$ref":"#/components/schemas/PriceListVersion"}}},"PassageLocation":{"type":"object","required":["kind","label"],"description":"Where in the document the passage sits.","properties":{"kind":{"type":"string","description":"`legal_consideration` = a numbered consideration of a judgment (\"r.o.\").","enum":["article","paragraph","legal_consideration","section","annex","page","other"]},"label":{"type":"string","maxLength":200,"description":"Human-readable location as the source numbers it.","examples":["art. 7:677 lid 1 BW","r.o. 3.4","§ 2.1"]},"url":{"type":["string","null"],"format":"uri","description":"Deep link to the location at the publisher, when the publisher offers one."}}},"Passage":{"type":"object","required":["passage_id","location","quote","verified"],"description":"A passage extracted from a source document and checked with the same citation check the\nchat API uses. `quote` is only filled for `full_text` sources; `reference_only` sources\nreturn the location and identifier without text.\n","properties":{"passage_id":{"type":"string","maxLength":100,"description":"Id of the passage within this response (referenced by `claims[].passage_ids`)."},"location":{"$ref":"#/components/schemas/PassageLocation"},"element_id":{"type":["string","null"],"description":"Element id from `GET …/elements`, when known."},"start_offset":{"type":["integer","null"],"minimum":0,"description":"Start of the passage in the fetched text (UTF-16 code units, like `url_citation`); null for `reference_only` sources."},"end_offset":{"type":["integer","null"],"minimum":0},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"type":["string","null"],"maxLength":4000,"description":"Verbatim text of the passage. Null for `reference_only` sources."},"verified":{"type":"boolean","description":"True = the identifier and location were found in the source and, for a `full_text`\nsource, the quote matches the retrieved text verbatim. False = the check failed;\nsuch passages are never used by `POST /sources/answer`.\n"}}},"SourcePassage":{"type":"object","if":{"properties":{"access":{"const":"reference_only"}}},"then":{"properties":{"quote":{"type":"null"}}},"required":["passage_id","marker","source_id","document_id","title","url","identifiers","date","access","attribution","location","quote","verified"],"description":"A `Passage` together with the document it comes from (used by `POST /sources/answer`).","properties":{"passage_id":{"type":"string","maxLength":100},"marker":{"type":"string","description":"Marker used in `answer` (e.g. `[1]`)."},"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string","maxLength":300},"title":{"type":"string"},"url":{"type":["string","null"],"format":"uri"},"identifiers":{"$ref":"#/components/schemas/DocumentIdentifiers"},"date":{"type":["string","null"],"format":"date"},"access":{"$ref":"#/components/schemas/SourceAccess"},"attribution":{"type":["string","null"]},"location":{"$ref":"#/components/schemas/PassageLocation"},"element_id":{"type":["string","null"]},"start_offset":{"type":["integer","null"],"minimum":0},"end_offset":{"type":["integer","null"],"minimum":0},"validity":{"$ref":"#/components/schemas/Validity"},"quote":{"type":["string","null"],"maxLength":4000},"verified":{"type":"boolean"}}},"SourceAnswerRequest":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"language":{"type":"string","enum":["auto","nl","en"],"default":"auto","description":"Language of the answer; `auto` = the language of the question."},"source_ids":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"description":"Limits the candidate sources. Without it Prudai routes over all sources this key may search.","items":{"$ref":"#/components/schemas/SourceId"}},"jurisdictions":{"type":"array","maxItems":30,"uniqueItems":true,"items":{"$ref":"#/components/schemas/JurisdictionCode"}},"date_from":{"type":"string","format":"date"},"date_to":{"type":"string","format":"date"},"max_passages":{"type":"integer","minimum":1,"maximum":20,"default":8}}},"SourceAnswerClaim":{"type":"object","required":["text","passage_ids"],"properties":{"text":{"type":"string","description":"One claim as it appears in `answer`."},"passage_ids":{"type":"array","minItems":1,"description":"The verified passages that support this claim. Every claim has at least one.","items":{"type":"string"}}}},"SourceAnswerResponseData":{"type":"object","if":{"properties":{"outcome":{"const":"insufficient_evidence"}}},"then":{"properties":{"answer":{"type":"null"},"claims":{"maxItems":0}}},"else":{"properties":{"answer":{"type":"string"},"insufficient_evidence_reason":{"type":"null"}}},"required":["object","request_id","outcome","answer","claims","omitted_unsupported_claims","insufficient_evidence_reason","passages","prudai"],"properties":{"object":{"type":"string","const":"source_answer"},"request_id":{"$ref":"#/components/schemas/RequestId"},"outcome":{"type":"string","description":"`answered` = an answer with every claim cited. `insufficient_evidence` = Prudai found\ntoo few verified passages to answer (for example no matching source, only failed\nchecks, or a question outside the sources); `answer` is then null and `passages`\nholds what was found.\n","enum":["answered","insufficient_evidence"]},"answer":{"type":["string","null"],"maxLength":4000,"description":"Short Markdown answer with markers (`[1]`) that refer to `passages[].marker`. Null when `outcome` is `insufficient_evidence`."},"claims":{"type":"array","items":{"$ref":"#/components/schemas/SourceAnswerClaim"}},"omitted_unsupported_claims":{"type":"integer","minimum":0,"description":"Claims the model proposed but that no verified passage supported, and that were therefore left out."},"insufficient_evidence_reason":{"type":["string","null"],"maxLength":300},"passages":{"type":"array","items":{"$ref":"#/components/schemas/SourcePassage"}},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"CitationToVerify":{"type":"object","additionalProperties":false,"required":["reference"],"properties":{"reference":{"type":"string","minLength":1,"maxLength":300,"description":"An ECLI, article reference, CELEX number or Kamerstuk reference as written.","examples":["ECLI:NL:HR:…","art. 6:162 BW","32016R0679","Kamerstukken II, <dossier>, nr. <n>"]},"kind":{"type":"string","enum":["auto","ecli","article","celex","kamerstuk"],"default":"auto","description":"Type of reference; `auto` lets Prudai detect it."},"quote":{"type":"string","minLength":1,"maxLength":5000,"description":"Optional text that is claimed to appear at that reference."},"client_ref":{"type":"string","maxLength":100,"description":"Your own id, echoed back."},"as_of":{"type":"string","format":"date","description":"Overrides the request-level `as_of` for this citation."}}},"CitationVerifyRequest":{"type":"object","additionalProperties":false,"required":["citations"],"properties":{"citations":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"#/components/schemas/CitationToVerify"}},"jurisdictions":{"type":"array","maxItems":30,"uniqueItems":true,"description":"Optional hint for ambiguous article references.","items":{"$ref":"#/components/schemas/JurisdictionCode"}},"as_of":{"type":"string","format":"date","description":"Check each citation against the version in force on this date (\"was this article in\nforce, with this wording, on this date?\"), where the source provides versions.\nDefault today.\n"}}},"ResolvedReference":{"type":"object","required":["source_id","document_id","url","title","date","access","location"],"properties":{"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string","maxLength":300},"url":{"type":["string","null"],"format":"uri"},"title":{"type":"string"},"date":{"type":["string","null"],"format":"date"},"access":{"$ref":"#/components/schemas/SourceAccess"},"location":{"oneOf":[{"$ref":"#/components/schemas/PassageLocation"},{"type":"null"}]},"element_id":{"type":["string","null"]},"validity":{"$ref":"#/components/schemas/Validity"}}},"CitationVerifyResult":{"type":"object","required":["index","client_ref","reference","as_of","exists","in_force","resolved","quote_match","matched_passage","reason_code","reason"],"properties":{"index":{"type":"integer","minimum":0,"description":"Position of the citation in the request."},"client_ref":{"type":["string","null"]},"reference":{"type":"string","description":"The reference as submitted."},"as_of":{"type":"string","format":"date","description":"The date the citation was checked against."},"in_force":{"type":["boolean","null"],"description":"Whether the resolved article was in force on `as_of`; null when the source provides no validity (case law, sources without versions). `quote_match` compares against the wording valid on `as_of`."},"exists":{"type":["boolean","null"],"description":"True = found in a served source. False = not found where it should be (for example an ECLI that does not exist). Null = could not be checked (`reason_code` says why)."},"resolved":{"oneOf":[{"$ref":"#/components/schemas/ResolvedReference"},{"type":"null"}]},"quote_match":{"type":"string","description":"`exact` = the quote appears verbatim; `normalized` = it appears after normalising\nwhitespace, punctuation, case and diacritics; `not_found` = it does not appear at the\nresolved location; `not_checked` = no quote was sent, or Prudai holds no text for that\nsource (metadata-only licence).\n","enum":["exact","normalized","not_found","not_checked"]},"matched_passage":{"oneOf":[{"$ref":"#/components/schemas/Passage"},{"type":"null"}],"description":"The matching passage, only for `full_text` sources; null otherwise."},"reason_code":{"type":"string","enum":["found","not_found","ambiguous_reference","unsupported_reference","source_not_served","source_unavailable","quote_not_found","no_quote_sent","text_not_held","not_in_force_on_date","validity_unknown"]},"reason":{"type":"string","maxLength":300,"description":"Short human-readable explanation. Branch on `reason_code`, not on this text."}}},"CitationVerifyResponseData":{"type":"object","required":["object","request_id","results","prudai"],"properties":{"object":{"type":"string","const":"citation_verification"},"request_id":{"$ref":"#/components/schemas/RequestId"},"results":{"type":"array","items":{"$ref":"#/components/schemas/CitationVerifyResult"}},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"Validity":{"type":"object","description":"Validity of legislation, where the source provides it. All three fields are null when\nthe source does not publish validity (for example case law, or a source without\nversions).\n","properties":{"in_force":{"type":["boolean","null"],"description":"In force on the request's `as_of` date (default today)."},"valid_from":{"type":["string","null"],"format":"date"},"valid_to":{"type":["string","null"],"format":"date","description":"Null while still in force, or when unknown."}}},"DocumentReference":{"type":"object","required":["direction","source_id","document_id","title","url","identifiers","date","from_element_id","to_location"],"properties":{"direction":{"type":"string","enum":["cites","cited_by"]},"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string","maxLength":300},"title":{"type":["string","null"]},"url":{"type":["string","null"],"format":"uri"},"identifiers":{"$ref":"#/components/schemas/DocumentIdentifiers"},"date":{"type":["string","null"],"format":"date"},"from_element_id":{"type":["string","null"],"description":"Element of the requested document the reference starts from (for `cites`) or points to (for `cited_by`), when known."},"to_location":{"description":"Location in the other document (for example `art. 7:677 BW`), when the reference names one.","oneOf":[{"$ref":"#/components/schemas/PassageLocation"},{"type":"null"}]}}},"DocumentReferenceListData":{"type":"object","required":["object","document_id","direction","data","has_more","next_cursor","prudai"],"properties":{"object":{"type":"string","const":"list"},"document_id":{"type":"string"},"direction":{"type":"string","enum":["cites","cited_by"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReference"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"DocumentElement":{"type":"object","required":["element_id","parent_id","kind","label","start_offset","end_offset"],"properties":{"element_id":{"type":"string","maxLength":200},"parent_id":{"type":["string","null"]},"kind":{"type":"string","enum":["book","part","chapter","section","article","paragraph","legal_consideration","annex","other"]},"label":{"type":"string","maxLength":200,"examples":["Boek 7","art. 7:677","lid 1","r.o. 3.4"]},"start_offset":{"type":["integer","null"],"minimum":0,"description":"Start in the fetched text (UTF-16 code units); null for `reference_only` sources."},"end_offset":{"type":["integer","null"],"minimum":0},"validity":{"$ref":"#/components/schemas/Validity"}}},"DocumentElementListData":{"type":"object","required":["object","source_id","document_id","as_of","data","prudai"],"properties":{"object":{"type":"string","const":"list"},"source_id":{"$ref":"#/components/schemas/SourceId"},"document_id":{"type":"string"},"as_of":{"type":"string","format":"date"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentElement"}},"prudai":{"$ref":"#/components/schemas/SourcesPrudaiResult"}}},"SearchFacetValue":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"type":"integer","minimum":0}}},"AccountData":{"type":"object","required":["object","auth_kind","key","personal_token","user","organization","fair_use","rate_limit"],"allOf":[{"if":{"properties":{"auth_kind":{"const":"api_key"}}},"then":{"properties":{"key":{"type":"object"},"personal_token":{"type":"null"},"user":{"type":"null"}}},"else":{"properties":{"key":{"type":"null"},"user":{"type":"object"}},"if":{"properties":{"auth_kind":{"const":"personal_token"}}},"then":{"properties":{"personal_token":{"type":"object"}}},"else":{"properties":{"personal_token":{"type":"null"}}}}}],"properties":{"object":{"type":"string","const":"account"},"auth_kind":{"type":"string","enum":["api_key","personal_token","keycloak_token"],"description":"Exchanged Keycloak tokens have null key metadata. The bearer credential kind; personal tokens use current user permissions, service keys use scopes."},"key":{"oneOf":[{"type":"object","required":["id","kind","name","prefix","environment","scopes","products","expires_at","created_at"],"properties":{"id":{"$ref":"#/components/schemas/KeyId"},"kind":{"type":"string","const":"service"},"name":{"type":"string"},"prefix":{"type":"string","description":"Non-secret display handle (first characters of the key)."},"environment":{"type":"string","enum":["live","test"]},"scopes":{"type":"array","description":"Granted scopes as stored, including object wildcards such as `prudai:*:read`.","items":{"type":"string","pattern":"^(?:[a-z][a-z0-9-]*:([a-z][a-z0-9_]*|\\*):(?:read|write|delete)|prudai:capabilities:request)$"}},"products":{"type":"array","items":{"type":"string","enum":["leo","leo-fiscaal","zia","vera","bever"]}},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},{"type":"null"}],"description":"Service-key metadata, null for a personal token. Never the secret."},"personal_token":{"oneOf":[{"type":"object","required":["id","kind","name","prefix","environment","expires_at","created_at"],"properties":{"id":{"$ref":"#/components/schemas/KeyId"},"kind":{"type":"string","const":"personal"},"name":{"type":"string"},"prefix":{"type":"string","description":"Non-secret display prefix only."},"environment":{"type":"string","enum":["live","test"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"products":{"type":"array","description":"Products this token may be used for (`prudai` = this API).","items":{"type":"string"}},"scopes":{"type":"array","description":"The rights this request had, derived from the user's CURRENT role in the\norganisation (never stored on the token): Owner/Admin add\n`account:usage:read` and `account:credits:read`.\n","items":{"type":"string"}},"last_used_at":{"type":["string","null"],"format":"date-time"}}},{"type":"null"}],"description":"Personal-token metadata, null for a service key. Default token lifetime 90 days."},"user":{"oneOf":[{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Public id of the approving user."},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"role":{"type":["string","null"],"description":"The user's current role in the organisation in lower case."}}},{"type":"null"}],"description":"The approving user for PATs; null for service keys. No client-supplied identity."},"organization":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"Public organisation id."},"name":{"type":"string"}}},"fair_use":{"type":"array","description":"Fair-use limits that apply to this key: the free operations, and for a service key with the chat scope\nthe questions it may ask per day (chat_requests_per_day, per key and per organisation). A key's own limit,\nset in the Console, can only be lower than the platform default.\n","items":{"type":"object","required":["limit_name","scope","limit","used","resets_at"],"properties":{"limit_name":{"type":"string","examples":["sources_requests_per_day","documents_fetched_per_day","citations_checked_per_day","chat_requests_per_day"]},"scope":{"type":"string","enum":["key","organization"]},"limit":{"type":["integer","null"],"minimum":0,"description":"Null while the value is not set (TBD)."},"used":{"type":"integer","minimum":0},"resets_at":{"type":"string","format":"date-time"}}}},"rate_limit":{"type":"object","required":["requests_per_minute","concurrent_requests"],"properties":{"requests_per_minute":{"type":["integer","null"],"minimum":0},"organization_requests_per_minute":{"type":"integer","minimum":1,"description":"Shared minute allowance across all keys in this organisation."},"used":{"type":"integer","minimum":0,"description":"Admitted calls in this key's current minute window, including this account request."},"resets_at":{"type":"string","format":"date-time","description":"When this key's current minute window resets."},"organization_used":{"type":"integer","minimum":0,"description":"Admitted calls in the organisation's shared minute window."},"organization_resets_at":{"type":"string","format":"date-time","description":"When the shared organisation minute window resets."},"concurrent_requests":{"type":["integer","null"],"minimum":0}}},"credits_available":{"$ref":"#/components/schemas/Credits","description":"Phase 2, for keys with `account:credits:read` or users allowed to read credits in the app; absent before that."}}},"DeviceAuthorizationRequest":{"type":"object","additionalProperties":false,"properties":{"client_name":{"type":"string","minLength":1,"maxLength":60,"description":"Defaults to `prudai-cli`."},"client_version":{"type":"string","maxLength":32},"device_name":{"type":"string","minLength":1,"maxLength":120,"description":"Shown on the approval page; becomes the token's `device_label` and name. Defaults to `client_name`, else `prudai-cli`."},"products":{"description":"Products the token may be used for. Default `[\"prudai\"]`. Form-encoded clients may send one\nspace- or comma-separated string.\n","oneOf":[{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string","enum":["prudai","irma","ordo","account"]}},{"type":"string","minLength":1,"pattern":"^(prudai|irma|ordo|account)([ ,]+(prudai|irma|ordo|account))*$"}]},"client_id":{"type":"string","maxLength":200,"description":"Accepted for standard OAuth clients and ignored; grants nothing."},"scope":{"type":"string","maxLength":500,"description":"Accepted for standard OAuth clients and ignored; use `products`."}}},"DeviceAuthorization":{"type":"object","required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"],"properties":{"device_code":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"The CLI's poll secret. Never put it in a URL or log."},"user_code":{"type":"string","pattern":"^[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$"},"verification_uri":{"type":"string","format":"uri"},"verification_uri_complete":{"type":"string","format":"uri"},"expires_in":{"type":"integer","const":600},"interval":{"type":"integer","minimum":1}}},"DeviceTokenRequest":{"type":"object","additionalProperties":false,"required":["device_code"],"properties":{"device_code":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"grant_type":{"type":"string","const":"urn:ietf:params:oauth:grant-type:device_code"},"client_id":{"type":"string","maxLength":200,"description":"Accepted for standard OAuth clients and ignored."}}},"DeviceToken":{"type":"object","required":["access_token","token_type","expires_in","expires_at","token","user","organization","products"],"properties":{"access_token":{"type":"string","pattern":"^prudai_pat_[A-Za-z0-9_-]{43}$","description":"Shown once. Stored by Prudai only as a hash."},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer","minimum":0},"expires_at":{"type":"string","format":"date-time"},"token":{"type":"object","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/KeyId"},"name":{"type":"string"}}},"user":{"type":"object","required":["id","name","email"],"description":"The approving user; the token is bound to them.","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}}},"organization":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"products":{"type":"array","items":{"type":"string"}}}},"DeviceTokenError":{"type":"object","required":["error","error_description"],"properties":{"error":{"type":"string","enum":["authorization_pending","slow_down","access_denied","expired_token","invalid_grant","invalid_request","temporarily_unavailable","developer_api_disabled","developer_api_not_configured","server_error"]},"error_description":{"type":"string"},"interval":{"type":"integer","minimum":1,"description":"Present with `authorization_pending`, `slow_down` and `temporarily_unavailable`."}}},"DeviceAuthError":{"type":"object","required":["error","error_description"],"properties":{"error":{"type":"string","enum":["invalid_request","developer_api_disabled","developer_api_not_configured","server_error"]},"error_description":{"type":"string"}}},"DeviceRateLimited":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","const":"rate_limited"},"message":{"type":"string"},"error_description":{"type":"string"}}},"ApprovalRequest":{"type":"object","required":["id","level","operation","method","path","args_hash","status","created_at","expires_at","approval_url"],"properties":{"id":{"type":"string","pattern":"^apr_[A-Za-z0-9]{24}$"},"level":{"type":"string","enum":["confirm","review"]},"operation":{"type":"string"},"summary":{"type":"string","description":"Human-readable summary of a proposed chat action, when available."},"method":{"type":"string"},"path":{"type":"string","description":"Resolved path relative to /v1."},"args_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"status":{"type":"string","enum":["pending","approved","rejected","expired","used"]},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"approval_url":{"type":"string","format":"uri"}}},"ApprovalResponse":{"type":"object","required":["data","context","completeness","notIncluded","provenance","next"],"properties":{"data":{"type":"object","required":["approvalRequest"],"properties":{"approvalRequest":{"$ref":"#/components/schemas/ApprovalRequest"}}},"context":{"$ref":"#/components/schemas/TaskContext"},"completeness":{"$ref":"#/components/schemas/Completeness"},"notIncluded":{"type":"array","items":{"$ref":"#/components/schemas/NotIncluded"}},"provenance":{"type":"object","additionalProperties":true},"next":{"type":"array","items":{"$ref":"#/components/schemas/NextCall"}}}},"ApprovalListResponse":{"type":"object","required":["data","context","completeness","notIncluded","provenance","next"],"properties":{"data":{"type":"object","required":["approvals","next_cursor"],"properties":{"approvals":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequest"}},"next_cursor":{"type":["string","null"]}}},"context":{"$ref":"#/components/schemas/TaskContext"},"completeness":{"$ref":"#/components/schemas/Completeness"},"notIncluded":{"type":"array","items":{"$ref":"#/components/schemas/NotIncluded"}},"provenance":{"type":"object","additionalProperties":true},"next":{"type":"array","items":{"$ref":"#/components/schemas/NextCall"}}}},"WorkflowGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["input","persona","output","condition","hitl"]},"label":{"type":"string","minLength":1,"maxLength":300},"prompt":{"type":"string","maxLength":20000},"artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"condition":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":256},"operator":{"type":"string","enum":["equals","not-equals","gte","lte","contains"]},"value":{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"}]}},"required":["field","operator","value"],"additionalProperties":false},"hitl":{"type":"object","properties":{"gate":{"type":"string","enum":["plan-akkoord","eindreview","custom"]},"timeoutBehavior":{"type":"string","enum":["wait","continue"]},"timeoutMinutes":{"type":"integer","exclusiveMinimum":0,"maximum":43200},"reviewInstruction":{"type":"string","minLength":1,"maxLength":4000}},"required":["gate","timeoutBehavior"],"additionalProperties":false},"v1Execution":{"type":"string","enum":["noop-passthrough"]},"description":{"type":"string","maxLength":4000},"presetId":{"type":"string","maxLength":100},"style":{"type":"string","enum":["onderzoekend","strategisch","adversarieel"]},"modelTier":{"type":"string","enum":["mini","standard","pro"]},"runWhenIntake":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":64},"anyOf":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":20}},"required":["fieldId","anyOf"]},"machineTranslation":{"type":"object","properties":{"targetLanguage":{"type":"string","enum":["en-GB","en-US","de","fr","nl"]},"sourceLanguage":{"type":"string","enum":["zh","ko","ja","de","fr","en","nl"]},"sourceLanguageFromIntake":{"type":"string","minLength":1,"maxLength":64},"glossaryFromIntake":{"type":"string","minLength":1,"maxLength":64},"glossaryEntries":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":200},"target":{"type":"string","minLength":1,"maxLength":200}},"required":["source","target"],"additionalProperties":false},"maxItems":500}},"required":["targetLanguage"],"additionalProperties":false},"documentPipeline":{"oneOf":[{"type":"object","properties":{"role":{"type":"string","enum":["map"]},"chapters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":300},"description":{"type":"string","maxLength":1000}},"required":["key","label"],"additionalProperties":false},"minItems":1,"maxItems":20},"minReadRatio":{"type":"number","minimum":0,"maximum":1}},"required":["role","chapters"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["plan"]}},"required":["role"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["chapter"]},"chapter":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}},"required":["role","chapter"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["synthesis"]}},"required":["role"],"additionalProperties":false}]},"slots":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["extract"]},"kind":{"type":"string","enum":["financing"]}},"required":["mode","kind"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["compute"]},"kind":{"type":"string","enum":["financing"]},"charts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-zA-Z0-9-]{0,40}$"},"title":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["bar","line"]},"axis":{"type":"string","enum":["periods","historisch","prognose","scenarios"]},"unit":{"type":"string","enum":["EUR","pct","ratio","number"]},"series":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.{}\\-]{0,80}$"}},"required":["name","key"],"additionalProperties":false},"minItems":1,"maxItems":6},"threshold":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_.{}\\-]{0,80}$"}},"required":["label","key"],"additionalProperties":false}},"required":["id","title","kind","axis","unit","series"],"additionalProperties":false},"maxItems":12},"marketRates":{"type":"boolean"},"externalData":{"type":"boolean"}},"required":["mode","kind"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["write"]},"include":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":30},"allowDurations":{"type":"boolean"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["fixed"]},"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["mode","text"],"additionalProperties":false}]},"statuteCheck":{"type":"boolean"},"inputSections":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":128},"headings":{"type":"array","items":{"type":"string","minLength":2,"maxLength":120},"minItems":1,"maxItems":12}},"required":["nodeId","headings"],"additionalProperties":false},"maxItems":50},"dossierTools":{"type":"boolean"},"promptAxes":{"type":"object","properties":{"roleSlug":{"type":"string","minLength":1,"maxLength":100},"specializationNodeIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":10}},"additionalProperties":false},"sourceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":25},"delivery":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["memo-docx","tabel-matrix","chronologie","conceptbrief"]},"title":{"type":"string","minLength":1,"maxLength":300},"bodyNodeIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"maxItems":50},"annotationNodeIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"maxItems":50},"materializeToTableModule":{"type":"boolean"},"reweighNodeIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"maxItems":50},"annotationSections":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":128},"headings":{"type":"array","items":{"type":"string","minLength":2,"maxLength":120},"minItems":1,"maxItems":12}},"required":["nodeId","headings"],"additionalProperties":false},"maxItems":50},"optional":{"type":"boolean"},"key":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"},"layout":{"type":"string","enum":["memo","document"]},"subtitle":{"type":"string","minLength":1,"maxLength":300}},"required":["type"],"additionalProperties":false},"minItems":1,"maxItems":4},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},"required":["id","type","label","position"],"additionalProperties":false},"minItems":1,"maxItems":50},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":256},"source":{"type":"string","minLength":1,"maxLength":128},"target":{"type":"string","minLength":1,"maxLength":128},"branch":{"type":"string","enum":["ja","nee"]}},"required":["id","source","target"],"additionalProperties":false},"maxItems":200}},"required":["nodes","edges"],"additionalProperties":false},"WorkflowCreateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000},"graph":{"$ref":"#/components/schemas/WorkflowGraph"}},"required":["name","graph"],"additionalProperties":false},"WorkflowUpdateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":2000},"graph":{"$ref":"#/components/schemas/WorkflowGraph"}},"additionalProperties":false,"minProperties":1},"WorkflowDefinition":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"graph":{"$ref":"#/components/schemas/WorkflowGraph"},"organizationId":{"type":["string","null"]},"createdBy":{"type":"string"},"productScope":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","graph","organizationId","createdBy","productScope","createdAt","updatedAt"]},"WorkflowCatalog":{"type":"object","properties":{"recommended":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"engine":{"type":"string","enum":["workflow","research"]},"nameKey":{"type":"string"},"promiseKey":{"type":"string"},"practiceAreas":{"type":"array","items":{"type":"string"}},"personaMiniGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["input","persona","output","condition","hitl"]},"roleKey":{"type":"string"},"style":{"type":"string","enum":["onderzoekend","strategisch","adversarieel"]},"promptPreview":{"type":"string"},"label":{"type":"string"},"role":{"type":"string"}},"required":["id","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"branch":{"type":"string","enum":["ja","nee"]}},"required":["source","target"]}}},"required":["nodes","edges"]},"outputBadges":{"type":"array","items":{"type":"string","enum":["memo-docx","tabel-matrix","chronologie","conceptbrief"]}},"sourceStripIds":{"type":"array","items":{"type":"string"}},"optionalSourceIds":{"type":"array","items":{"type":"string"}},"durationCostClass":{"type":"string","enum":["kort","middel","lang"]},"intake":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["text","textarea","period","number","select","multiselect","factor","dossier-selection"]},"labelKey":{"type":"string"},"required":{"type":"boolean"},"helpKey":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"labelKey":{"type":"string"}},"required":["value","labelKey"]}},"defaultValues":{"type":"array","items":{"type":"string"}}},"required":["id","type","labelKey","required"]}}},"required":["fields"]}},"required":["id","engine","nameKey","promiseKey","practiceAreas","personaMiniGraph","outputBadges","sourceStripIds","optionalSourceIds","durationCostClass","intake"]}},"all":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"engine":{"type":"string","enum":["workflow","research"]},"nameKey":{"type":"string"},"promiseKey":{"type":"string"},"practiceAreas":{"type":"array","items":{"type":"string"}},"personaMiniGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["input","persona","output","condition","hitl"]},"roleKey":{"type":"string"},"style":{"type":"string","enum":["onderzoekend","strategisch","adversarieel"]},"promptPreview":{"type":"string"},"label":{"type":"string"},"role":{"type":"string"}},"required":["id","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"branch":{"type":"string","enum":["ja","nee"]}},"required":["source","target"]}}},"required":["nodes","edges"]},"outputBadges":{"type":"array","items":{"type":"string","enum":["memo-docx","tabel-matrix","chronologie","conceptbrief"]}},"sourceStripIds":{"type":"array","items":{"type":"string"}},"optionalSourceIds":{"type":"array","items":{"type":"string"}},"durationCostClass":{"type":"string","enum":["kort","middel","lang"]},"intake":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["text","textarea","period","number","select","multiselect","factor","dossier-selection"]},"labelKey":{"type":"string"},"required":{"type":"boolean"},"helpKey":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"labelKey":{"type":"string"}},"required":["value","labelKey"]}},"defaultValues":{"type":"array","items":{"type":"string"}}},"required":["id","type","labelKey","required"]}}},"required":["fields"]}},"required":["id","engine","nameKey","promiseKey","practiceAreas","personaMiniGraph","outputBadges","sourceStripIds","optionalSourceIds","durationCostClass","intake"]}},"kantoor":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"personaMiniGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["input","persona","output","condition","hitl"]},"roleKey":{"type":"string"},"style":{"type":"string","enum":["onderzoekend","strategisch","adversarieel"]},"promptPreview":{"type":"string"},"label":{"type":"string"},"role":{"type":"string"}},"required":["id","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"branch":{"type":"string","enum":["ja","nee"]}},"required":["source","target"]}}},"required":["nodes","edges"]},"organizationId":{"type":["string","null"]},"updatedAt":{"type":"string"}},"required":["id","name","description","personaMiniGraph","organizationId","updatedAt"]}}},"required":["recommended","all","kantoor"]},"WorkflowCopyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"includeKernprompts":{"type":"boolean"}},"additionalProperties":false},"WorkflowIntakePrefillRequest":{"type":"object","properties":{"draft":{"type":"string","maxLength":100000},"conversationId":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"templateName":{"type":"string","maxLength":200}},"additionalProperties":false},"WorkflowIntakePrefill":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]},"source":{"type":"string","enum":["context"]}},"required":["value","source"]}},"openRequired":{"type":"array","items":{"type":"string"}}},"required":["fields","openRequired"]},"WorkflowStartRunRequest":{"type":"object","properties":{"input":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":100000},"projectId":{"type":"string","format":"uuid"},"documentIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":1000},"artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"output_artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"}},"required":["query"],"additionalProperties":false}},"required":["input"],"additionalProperties":false},"WorkflowStartTemplateRunRequest":{"type":"object","properties":{"artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"output_artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"intake":{"type":"object","additionalProperties":{}},"projectId":{"type":"string","format":"uuid"},"enabledSourceIds":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":120}}},"additionalProperties":false},"WorkflowArtifactRef":{"type":"object","description":"Exact immutable source version or expected current output version. Version zero denotes the historical empty baseline where supported.","properties":{"artifact_id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":0}},"required":["artifact_id","version"],"additionalProperties":false},"WorkflowArtifactRun":{"type":"object","properties":{"run_id":{"type":"string","format":"uuid"},"artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"created_at":{"type":"string","format":"date-time"}},"required":["run_id","artifact_ref","created_at"],"additionalProperties":false},"WorkflowRun":{"type":"object","properties":{"artifact_ref":{"x-prudai-requires-flag":"ARTIFACT_ENGINE_ENABLED","$ref":"#/components/schemas/WorkflowArtifactRef"},"previousAttempt":{"type":"object","properties":{"status":{"type":"string"},"finishedAt":{"type":["string","null"]},"archivedAt":{"type":"string"},"result":{"type":"string"},"error":{"type":["string","null"]},"deliverableCount":{"type":"number"}},"required":["status","finishedAt","archivedAt","result","error","deliverableCount"]},"jobId":{"type":"string"},"status":{"type":"string"},"topic":{"type":"string"},"createdAt":{"type":"string"},"projectId":{"type":"string"},"projectDocumentIds":{"type":"array","items":{"type":"string"}},"documentMode":{"type":"string","enum":["auto","selection","none"]},"effectiveProjectDocumentIds":{"type":"array","items":{"type":"string"}},"projectName":{"type":"string"},"logs":{"type":"array","items":{"type":"object","properties":{"agent":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"string"}}}},"result":{},"error":{"type":["string","null"]},"warnings":{"type":["string","null"]},"uiUrl":{"type":"string"},"meta":{"type":"object","additionalProperties":{}},"documentScope":{"type":"object","additionalProperties":{}},"queue":{"type":"object","properties":{"state":{"type":"string"},"position":{"type":["number","null"]},"etaSeconds":{"type":["number","null"]},"reason":{"type":["string","null"]},"checkedAt":{"type":["string","null"]}},"required":["state","position","etaSeconds","reason","checkedAt"]},"budgetUsage":{"type":"object","additionalProperties":{}},"progress":{"type":"object","additionalProperties":{}},"budget":{"type":"object","properties":{"limits":{"type":"object","properties":{"maxEstimatedTokens":{"type":"number"},"maxEstimatedUsd":{"type":"number"},"maxWallClockMs":{"type":"number"},"billableSteps":{"type":["number","null"]}},"required":["maxEstimatedTokens","maxEstimatedUsd","maxWallClockMs","billableSteps"]},"used":{"type":"object","properties":{"estimatedTokens":{"type":"number"},"estimatedCostUsd":{"type":"number"},"elapsedMs":{"type":"number"},"llmCalls":{"type":"number"}},"required":["estimatedTokens","estimatedCostUsd","elapsedMs","llmCalls"]},"remaining":{"type":"object","properties":{"estimatedTokens":{"type":"number"},"estimatedCostUsd":{"type":"number"},"wallClockMs":{"type":"number"}},"required":["estimatedTokens","estimatedCostUsd","wallClockMs"]},"fractionUsed":{"type":"number"},"tightestDimension":{"type":"string","enum":["tokens","cost","wall_clock"]},"exceededDimension":{"type":["string","null"],"enum":["tokens","cost","wall_clock","fair_use"]}},"required":["limits","used","remaining","fractionUsed","tightestDimension","exceededDimension"]},"continuable":{"type":"boolean"},"gate":{"type":["object","null"],"properties":{"nodeId":{"type":"string"},"nodeLabel":{"type":"string"},"round":{"type":"number"},"gate":{"type":"string"},"timeoutBehavior":{"type":"string"},"requestedAt":{"type":"string"},"deadlineAt":{"type":"string"},"reviewInstruction":{"type":"string"},"payloadPreview":{"type":"string"}},"required":["nodeId","nodeLabel","round","gate","timeoutBehavior","requestedAt","payloadPreview"]}},"required":["jobId","status"]},"WorkflowGateDecisionRequest":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":128},"decision":{"type":"string","enum":["approve","revise","abort"]},"note":{"type":"string","maxLength":4000}},"required":["nodeId","decision"],"additionalProperties":false},"WorkflowContinueRequest":{"type":"object","additionalProperties":false,"properties":{}},"WorkflowCancelRequest":{"type":"object","additionalProperties":false,"properties":{}}}},"x-prudai-planned-operations":[{"operationId":"getCreditBalance","method":"GET","path":"/v1/credits/balance","x-prudai-status":"planned"},{"operationId":"listCreditLedger","method":"GET","path":"/v1/credits/ledger","x-prudai-status":"planned"},{"operationId":"listApiKeys","method":"GET","path":"/v1/api-keys","x-prudai-status":"planned"},{"operationId":"createApiKey","method":"POST","path":"/v1/api-keys","x-prudai-status":"planned"},{"operationId":"rotateApiKey","method":"POST","path":"/v1/api-keys/{key_id}/rotate","x-prudai-status":"planned"},{"operationId":"revokeApiKey","method":"POST","path":"/v1/api-keys/{key_id}/revoke","x-prudai-status":"planned"},{"operationId":"listDocumentReferences","method":"GET","path":"/v1/sources/{source_id}/documents/{document_id}/references","x-prudai-status":"planned"},{"operationId":"listDocumentElements","method":"GET","path":"/v1/sources/{source_id}/documents/{document_id}/elements","x-prudai-status":"planned"},{"operationId":"answerFromSources","method":"POST","path":"/v1/sources/answer","x-prudai-status":"planned"},{"operationId":"answerFromKnowledgeBase","method":"POST","path":"/v1/knowledge-bases/{kb_id}/answer","x-prudai-status":"planned"}]}