{"openapi":"3.1.0","info":{"title":"MatterRef API","description":"Production API for the MatterRef filing system. Backed by apps/api/db/schema.sql plus the additive platform layer in apps/api/db/schema_platform.sql. Filing entities + read path are real; remaining routes are ported slice by slice.","version":"0.4.0"},"paths":{"/login":{"get":{"tags":["auth"],"summary":"Login","description":"Start the OIDC login flow (redirect to Keycloak).","operationId":"login_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/logout":{"get":{"tags":["auth"],"summary":"Logout","description":"Clear the session and sign out of Keycloak.","operationId":"logout_logout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/signed-out":{"get":{"tags":["auth"],"summary":"Signed Out","description":"Keycloak post-logout redirect target; clears cookies then shows signed-out UI.","operationId":"signed_out_signed_out_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["auth"],"summary":"Signed Out","description":"Keycloak post-logout redirect target; clears cookies then shows signed-out UI.","operationId":"signed_out_signed_out_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oidc/callback":{"get":{"tags":["auth"],"summary":"Oidc Callback","description":"Complete the OIDC login flow and set the session cookie.","operationId":"oidc_callback_oidc_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/me":{"get":{"tags":["auth"],"summary":"Me","description":"Who am I? (authRequired flag + the current user, or null).","operationId":"me_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/d/{doc_id}":{"get":{"tags":["documents"],"summary":"Open Document By Matterref Number","description":"Resolve a user-quoted MatterRef number to the internal uuid under RLS.","operationId":"open_document_by_matterref_number_d__doc_id__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/resolve/document":{"get":{"tags":["documents"],"summary":"Resolve Document","description":"JSON lookup: MatterRef ``doc_id`` or uuid ``id`` → ``{ id, docId }``.","operationId":"resolve_document_api_resolve_document_get","parameters":[{"name":"doc_id","in":"query","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email/webhook":{"post":{"tags":["email"],"summary":"Email Webhook","description":"Postmark Inbound webhook: verify Basic auth, then file the email as inbound.","operationId":"email_webhook_api_email_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/functional-inboxes":{"post":{"tags":["functional-inbox"],"summary":"Post Functional Inbox","description":"Create a functional mailbox on an existing matter/set (admin session).","operationId":"post_functional_inbox_api_functional_inboxes_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Functional Inbox Api Functional Inboxes Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/functional-inboxes/{mailbox_id}/reply":{"post":{"tags":["functional-inbox"],"summary":"Post Reply","description":"Reply on a thread as the mailbox address (member with can_send).","operationId":"post_reply_api_functional_inboxes__mailbox_id__reply_post","parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"integer","title":"Mailbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Reply Api Functional Inboxes  Mailbox Id  Reply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/thread-status":{"get":{"tags":["email-thread-status"],"summary":"Get Thread Status","description":"Public: thread timeline + page comments for a functional document.","operationId":"get_thread_status_api_thread_status_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"recipientEmail","in":"query","required":true,"schema":{"type":"string","title":"Recipientemail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Thread Status Api Thread Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/thread-status/comments":{"post":{"tags":["email-thread-status"],"summary":"Post Thread Status Comment","description":"Public: post one comment on the thread (view/comment token).","operationId":"post_thread_status_comment_api_thread_status_comments_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Thread Status Comment Api Thread Status Comments Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/comments":{"get":{"tags":["document-comments"],"summary":"List Comments Route","description":"Internal session: all comments on a document (internal + external).","operationId":"list_comments_route_api_documents__doc_id__comments_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response List Comments Route Api Documents  Doc Id  Comments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["document-comments"],"summary":"Add Comment Route","description":"Internal session: add a comment; visibility defaults to internal.","operationId":"add_comment_route_api_documents__doc_id__comments_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Add Comment Route Api Documents  Doc Id  Comments Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/comments/{comment_id}":{"patch":{"tags":["document-comments"],"summary":"Patch Comment Route","description":"Change visibility (author or admin); audited per ADR 0004.","operationId":"patch_comment_route_api_documents__doc_id__comments__comment_id__patch","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"integer","title":"Comment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentVisibilityPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Patch Comment Route Api Documents  Doc Id  Comments  Comment Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/comments/public":{"get":{"tags":["document-comments"],"summary":"List Public Comments Route","description":"External action token: filtered comment list (never includes internal rows).","operationId":"list_public_comments_route_api_documents__doc_id__comments_public_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"recipientEmail","in":"query","required":true,"schema":{"type":"string","title":"Recipientemail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Public Comments Route Api Documents  Doc Id  Comments Public Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["document-comments"],"summary":"Post Public Comment Route","description":"External action token: post one external comment.","operationId":"post_public_comment_route_api_documents__doc_id__comments_public_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Public Comment Route Api Documents  Doc Id  Comments Public Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/f/{slug}/submit":{"post":{"tags":["public-intake"],"summary":"Submit Form","description":"Deposit a public form submission into the slug's organisation.\n\nUnauthenticated: the tenant is resolved from the path slug, not a session.\nAn unknown/inactive slug -> 404. The record is filed into the org's shared\nForms set with provenance ``source='public_form'`` + ``entry_point=<slug>``.","operationId":"submit_form_f__slug__submit_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSubmit"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/f/submit":{"post":{"tags":["public-intake"],"summary":"Submit Form By Domain","description":"Deposit a public form submission resolved from the request's Host header.\n\nFor custom-domain deployments (ADR 0015 §12 open question): the Host header\nis the public identifier, mapped to an org via ``organisations.public_domain``.","operationId":"submit_form_by_domain_f_submit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSubmit"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/records":{"get":{"tags":["platform"],"summary":"List Records","description":"List record type definitions. Table: records.","operationId":"list_records_api_records_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["platform"],"summary":"Create Record","operationId":"create_record_api_records_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/forms/{slug}/submit":{"post":{"tags":["platform"],"summary":"Submit Form","description":"Turn a form post into a document + workflow.","operationId":"submit_form_api_forms__slug__submit_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmit"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/links":{"get":{"tags":["platform"],"summary":"List Links","operationId":"list_links_api_documents__doc_id__links_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["platform"],"summary":"Add Link","operationId":"add_link_api_documents__doc_id__links_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/attachments":{"get":{"tags":["platform"],"summary":"List Attachments","operationId":"list_attachments_api_documents__doc_id__attachments_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events":{"get":{"tags":["platform"],"summary":"List Events","operationId":"list_events_api_events_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages":{"get":{"tags":["platform"],"summary":"List Pages","operationId":"list_pages_api_pages_get","parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["platform"],"summary":"Create Page","operationId":"create_page_api_pages_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams":{"get":{"tags":["platform"],"summary":"List Teams","operationId":"list_teams_api_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/teams/{team_id}/views":{"get":{"tags":["platform"],"summary":"List Team Views","operationId":"list_team_views_api_teams__team_id__views_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"integer","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents.csv":{"get":{"tags":["platform"],"summary":"Export Documents Csv","operationId":"export_documents_csv_api_documents_csv_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/api/documents/import":{"post":{"tags":["platform"],"summary":"Import Documents Csv","operationId":"import_documents_csv_api_documents_import_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/addon/matters":{"get":{"tags":["addon"],"summary":"Addon Matters","description":"Return the org's inbound alias parts and its clients/matters/sets/types.\n\nThe token is ``organisations.inbound_token`` (the alias prefix), so the\nadd-in can compose ``<token>-<matter>@<domain>`` CC aliases. Sets are\nincluded so the add-in can file an email directly into a matter (a document\nneeds a set); types come from the shared catalogue so the add-in never\nhardcodes the frozen 3-letter codes.","operationId":"addon_matters_api_addon_matters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon Matters Api Addon Matters Get"}}}}}}},"/api/addon/suggest":{"post":{"tags":["addon"],"summary":"Addon Suggest","description":"Suggest a filing target + document type for an email from its text.\n\nReuses the same heuristic engine as the web inbox (``inbound.inspect``) so\nthe add-on never reimplements MatterRef-number parsing or type guessing.\nReturns the ``inspect`` shape: ``{ suggestedType, suggestedClientId,\nsuggestedMatterId, suggestedSetId, parsed }``. A wrong guess is safe — the\nadd-on only pre-selects the picker and the user confirms before filing.\n\nBody: ``{ title, notes?, filename?, source? }``.","operationId":"addon_suggest_api_addon_suggest_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon Suggest Api Addon Suggest Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbound":{"post":{"tags":["inbound"],"summary":"Add Inbound","description":"Create an un-filed inbound item (email / add-on / \"Start workflow\").\n\nBody: { title, source?, reviewers?, status?, notes?, fileBase64?, mime? }.\nReturns { result, state }.","operationId":"add_inbound_api_inbound_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/addon/documents":{"get":{"tags":["addon"],"summary":"Addon Documents","description":"List the documents already filed into a set (org-scoped, read-only).\n\nThe Word add-in shows this before filing so a user can see whether they are\nabout to file a duplicate. Read-only, so open to all seats (like\n``/api/addon/matters`` and ``/api/addon/suggest``).\n\nQuery: ``setId`` — the full set id (e.g. ``C0001001-00012-000301``).\nReturns ``{ setId, items: [{ id, doc, type, title, status }] }`` ordered by\ndocument number.","operationId":"addon_documents_api_addon_documents_get","parameters":[{"name":"setId","in":"query","required":true,"schema":{"type":"string","title":"Setid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon Documents Api Addon Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/addon/file":{"post":{"tags":["addon"],"summary":"Addon File","description":"File an email/document directly into a matter, issuing a numbered document.\n\nThis is the narrow, add-on-facing version of ``POST /api/documents``. It is\ndeliberately more restrictive than the session path, because an add-on runs\non a bearer token that is cheaper to compromise than a full login:\n\n  * **Seat gate** — the caller's seat must be ``admin``/``power`` (a viewer\n    seat never receives ``number.issue``, per ADR 0008). This and\n    ``/api/addon/send`` are the only writes here that consume a number.\n  * **No top-level structure creation** — ``newClient``/``newMatter`` are\n    rejected; the matter must already exist. A ``newSet`` *under that\n    matter* is allowed (creating a bundle of documents is a normal filing\n    step), but the set number is allocated server-side, org-scoped.\n  * **Client/matter/set consistency** — the client is *derived from the\n    matter*, never trusted from the request, and an existing set is verified\n    to nest under the named matter. The number is hierarchical, so a\n    mismatched client/set would otherwise corrupt the number.\n\nTenant isolation comes from the mail-grant org (RLS + org-scoped lookups);\nthe caller's id is recorded as ``created_by`` by ``issue_document``.\n\nBody: ``{ matterId, setId?, newSet?{title}, type, title, notes?, source?,\nfilename?, fileBase64?, mime?, email? }``. When ``type`` is omitted (e.g. an\nattachment), the document type is guessed from the filename via the shared\ninbound heuristic. Returns ``{ result }`` — the issued document row (its\n``id`` is the MatterRef number the user quotes).","operationId":"addon_file_api_addon_file_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon File Api Addon File Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/addon/send":{"post":{"tags":["addon"],"summary":"Addon Send","description":"Record an outbound reply the add-on already sent through the user's Gmail.\n\nSend & File (ROADMAP Idea 5): the add-on sends the reply via the Gmail API\nusing the user's own mailbox (``gmail.send`` scope), so the message appears\nin their Sent folder and carries their signature. After Gmail confirms the\nsend, the add-on posts the composed message + filing target here so MatterRef\ncan (1) file the outbound packet as a numbered document and (2) record an\n``emails`` correspondence row with ``direction='outbound'`` and\n``posted_via='gmail_api'``, linked to the matter and document.\n\nSame seat gate and structure rules as ``POST /api/addon/file``. The email was\n*already sent* before this call, so a failure here never blocks the send —\nthe add-on surfaces \"sent, but filing failed\" instead (the honest limit in\nROADMAP Idea 5).\n\nBody: ``{ matterId, setId?, newSet?{title}, type?, title, notes?, source?,\nfilename?, fileBase64?, mime?, email:{ messageId, inReplyTo?, references?,\nthreadKey?, from?, to?, cc?, bcc?, subject?, bodyText?, date? } }``. When\n``type`` is omitted it defaults to ``LTR`` (an outbound letter). Returns\n``{ result }`` — the issued document row.","operationId":"addon_send_api_addon_send_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon Send Api Addon Send Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/addon/dedup":{"get":{"tags":["addon"],"summary":"Addon Dedup","description":"Report whether an email (by RFC822 Message-ID) has already been captured.\n\nReturns ``{ filed, where, id }`` — ``where`` is ``\"inbound\"`` (an un-filed\nitem) or ``\"document\"`` (an issued record). The add-on uses this to warn\nagainst double-filing the same email via two routes (e.g. the inbound\nwebhook and the add-on). Best-effort: the Message-ID is matched against the\n``notes`` text both ingest paths already write, so it works on existing data\nwith no schema change.","operationId":"addon_dedup_api_addon_dedup_get","parameters":[{"name":"message_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Addon Dedup Api Addon Dedup Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matter-shares":{"post":{"tags":["matter-share"],"summary":"Create Share","description":"Mint a revocable, expiring token for one matter (admin session).","operationId":"create_share_api_matter_shares_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Share Api Matter Shares Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matter-shares/{share_id}/revoke":{"post":{"tags":["matter-share"],"summary":"Revoke Share","description":"Revoke a share token immediately.","operationId":"revoke_share_api_matter_shares__share_id__revoke_post","parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"integer","title":"Share Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Revoke Share Api Matter Shares  Share Id  Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/m/{token}":{"get":{"tags":["portal-brand"],"summary":"Get Shared Matter Branded","description":"Public read-only matter view with org branding (integrator may delegate).","operationId":"get_shared_matter_branded_m__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Shared Matter Branded M  Token  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matter-shares/public/{token}":{"get":{"tags":["matter-share"],"summary":"Get Shared Matter Api","description":"JSON alias for static pages that prefer an /api path.","operationId":"get_shared_matter_api_api_matter_shares_public__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Shared Matter Api Api Matter Shares Public  Token  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/portal-brand":{"get":{"tags":["portal-brand"],"summary":"Get Portal Branding","description":"Return this org's portal branding (admin session only).","operationId":"get_portal_branding_api_portal_brand_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Portal Branding Api Portal Brand Get"}}}}}},"put":{"tags":["portal-brand"],"summary":"Put Portal Branding","description":"Set portal name, logo URL, and accent colours (admin session only).","operationId":"put_portal_branding_api_portal_brand_put","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Put Portal Branding Api Portal Brand Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/portal-tasks":{"post":{"tags":["portal-tasks"],"summary":"Create Portal Task","description":"Attach a short to-do to one share token (admin session).","operationId":"create_portal_task_api_portal_tasks_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Portal Task Api Portal Tasks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/m/{token}/tasks":{"get":{"tags":["portal-tasks"],"summary":"Get Open Tasks","description":"Public open-item list for this share token; 404 if the token cannot be opened.","operationId":"get_open_tasks_m__token__tasks_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Open Tasks M  Token  Tasks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/m/{token}/tasks/{task_id}/complete":{"post":{"tags":["portal-tasks"],"summary":"Complete Open Task","description":"Public complete: share token is the credential, not a session.","operationId":"complete_open_task_m__token__tasks__task_id__complete_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Complete Open Task M  Token  Tasks  Task Id  Complete Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/m/{token}/messages":{"get":{"tags":["matter-messages"],"summary":"Get Token Messages","description":"Public message list for this share token; 404 if the token cannot be opened.","operationId":"get_token_messages_m__token__messages_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Token Messages M  Token  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["matter-messages"],"summary":"Create Token Message","description":"Public post: share token is the credential, not a session.","operationId":"create_token_message_m__token__messages_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Token Message M  Token  Messages Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matters/{matter_id}/messages":{"get":{"tags":["matter-messages"],"summary":"Get Matter Messages","description":"Firm user: read the matter message thread (session + org RLS).","operationId":"get_matter_messages_api_matters__matter_id__messages_get","parameters":[{"name":"matter_id","in":"path","required":true,"schema":{"type":"string","title":"Matter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Matter Messages Api Matters  Matter Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/folder-import":{"post":{"tags":["folder-import"],"summary":"Post Scan","description":"Propose client, matter, and set for each file under one directory.","operationId":"post_scan_api_folder_import_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Scan Api Folder Import Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/folder-import/rows/{row_id}":{"patch":{"tags":["folder-import"],"summary":"Patch Row","description":"Save an assign-to override. The row stays unnumbered.","operationId":"patch_row_api_folder_import_rows__row_id__patch","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Patch Row Api Folder Import Rows  Row Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/folder-import/rows/{row_id}/confirm":{"post":{"tags":["folder-import"],"summary":"Post Confirm","description":"Confirm one row: issue a document and record the source path.","operationId":"post_confirm_api_folder_import_rows__row_id__confirm_post","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Confirm Api Folder Import Rows  Row Id  Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/smart-file/remember":{"post":{"tags":["smart-file"],"summary":"Remember Association","description":"Remember a sender for a matter in the current org.","operationId":"remember_association_api_smart_file_remember_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RememberBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["smart-file"],"summary":"Forget Association","description":"Stop proposing a matter for this sender (current org only).","operationId":"forget_association_api_smart_file_remember_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgetBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/smart-file/suggest":{"get":{"tags":["smart-file"],"summary":"Suggest Matter","description":"Propose a matter for an inbound sender; never creates a document.","operationId":"suggest_matter_api_smart_file_suggest_get","parameters":[{"name":"senderEmail","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Senderemail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/send/file":{"post":{"tags":["send-file"],"summary":"Send File","description":"File an outbound email the client already sent (Send & File).","operationId":"send_file_api_send_file_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Send File Api Send File Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/send/filed":{"get":{"tags":["send-file"],"summary":"Send Filing Indicator","description":"Filing indicator — whether this Message-ID is already captured in the org.","operationId":"send_filing_indicator_api_send_filed_get","parameters":[{"name":"message_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Send Filing Indicator Api Send Filed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/review-table":{"post":{"tags":["review-table"],"summary":"Post Review Table","description":"Build a review table for one matter (admin or power).","operationId":"post_review_table_api_review_table_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/review-table/csv":{"get":{"tags":["review-table"],"summary":"Export Review Table Csv","description":"CSV export of the review table (admin or power).","operationId":"export_review_table_csv_api_review_table_csv_get","parameters":[{"name":"matterId","in":"query","required":true,"schema":{"type":"string","title":"Matterid"}},{"name":"fields","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated field keys","title":"Fields"},"description":"Comma-separated field keys"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/obligations":{"post":{"tags":["obligations"],"summary":"Post Obligation","operationId":"post_obligation_api_obligations_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Obligation Api Obligations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/obligations":{"get":{"tags":["obligations"],"summary":"Get Document Obligations","operationId":"get_document_obligations_api_documents__document_id__obligations_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Document Obligations Api Documents  Document Id  Obligations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/obligations/recompute":{"post":{"tags":["obligations"],"summary":"Post Recompute Obligations","operationId":"post_recompute_obligations_api_documents__document_id__obligations_recompute_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Recompute Obligations Api Documents  Document Id  Obligations Recompute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matters/{matter_id}/compliance-pack":{"get":{"tags":["compliance"],"summary":"Get Compliance Pack","description":"One matter's compliance evidence pack (admin only).","operationId":"get_compliance_pack_api_matters__matter_id__compliance_pack_get","parameters":[{"name":"matter_id","in":"path","required":true,"schema":{"type":"string","title":"Matter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matter-board":{"get":{"tags":["matter-board"],"summary":"Board","description":"List the current org's matters in open and closed columns.","operationId":"board_api_matter_board_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Board Api Matter Board Get"}}}}}}},"/api/matter-board/{matter_id}/move":{"post":{"tags":["matter-board"],"summary":"Move Route","description":"Move a matter to the other column (admin/power).","operationId":"move_route_api_matter_board__matter_id__move_post","parameters":[{"name":"matter_id","in":"path","required":true,"schema":{"type":"integer","title":"Matter Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Move Route Api Matter Board  Matter Id  Move Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/status/public":{"get":{"tags":["status"],"summary":"Public Status","description":"Unauthenticated. Only visibility=public checks, never disk/DB/service/git.","operationId":"public_status_api_status_public_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Public Status Api Status Public Get"}}}}}}},"/api/ops-status":{"get":{"tags":["status"],"summary":"Ops Status","description":"Admin seat only. Full probe snapshot plus live Postgres ping.","operationId":"ops_status_api_ops_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Ops Status Api Ops Status Get"}}}}}}},"/api/org/trust":{"get":{"tags":["org-trust"],"summary":"Org Trust","description":"Customer-visible assurance for the current organisation (any seat).","operationId":"org_trust_api_org_trust_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Org Trust Api Org Trust Get"}}}}}}},"/api/personal/templates":{"get":{"tags":["personal-flows"],"summary":"List Templates","operationId":"list_templates_api_personal_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["personal-flows"],"summary":"Create Template","operationId":"create_template_api_personal_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/personal/templates/{ref_id}":{"get":{"tags":["personal-flows"],"summary":"Get Template","operationId":"get_template_api_personal_templates__ref_id__get","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["personal-flows"],"summary":"Delete Template","operationId":"delete_template_api_personal_templates__ref_id__delete","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/personal/captures":{"get":{"tags":["personal-flows"],"summary":"List Captures","operationId":"list_captures_api_personal_captures_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["personal-flows"],"summary":"Create Capture","operationId":"create_capture_api_personal_captures_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/personal/captures/{ref_id}":{"get":{"tags":["personal-flows"],"summary":"Get Capture","operationId":"get_capture_api_personal_captures__ref_id__get","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["personal-flows"],"summary":"Delete Capture","operationId":"delete_capture_api_personal_captures__ref_id__delete","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/personal/captures/{ref_id}/file":{"post":{"tags":["personal-flows"],"summary":"File Capture","operationId":"file_capture_api_personal_captures__ref_id__file_post","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCaptureBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-catalog":{"get":{"tags":["workflows"],"summary":"Workflow Catalog","description":"The org's published workflow definitions (the \"Start workflow\" picker).","operationId":"workflow_catalog_api_workflow_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Workflow Catalog Api Workflow Catalog Get"}}}}}}},"/api/workflow-instances":{"get":{"tags":["workflows"],"summary":"List Instances","operationId":"list_instances_api_workflow_instances_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Instances Api Workflow Instances Get"}}}}}},"post":{"tags":["workflows"],"summary":"Start Instance","operationId":"start_instance_api_workflow_instances_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Start Instance Api Workflow Instances Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-instances/{instance_id}":{"get":{"tags":["workflows"],"summary":"Get Instance","operationId":"get_instance_api_workflow_instances__instance_id__get","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Instance Api Workflow Instances  Instance Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/run":{"post":{"tags":["workflows"],"summary":"Start Run","description":"Alias for POST /api/workflow-instances (used by the UI's Start button).","operationId":"start_run_api_workflows_run_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Start Run Api Workflows Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-instances/{instance_id}/act":{"post":{"tags":["workflows"],"summary":"Act","operationId":"act_api_workflow_instances__instance_id__act_post","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Act Api Workflow Instances  Instance Id  Act Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/action-tokens":{"post":{"tags":["action-tokens"],"summary":"Create Token","description":"Issue a signed action token (session-authenticated notify path).","operationId":"create_token_api_action_tokens_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Token Api Action Tokens Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/actions/execute":{"post":{"tags":["action-tokens"],"summary":"Execute Action","description":"One-click / deep-link execution entrypoint (public once auth.py allows it).","operationId":"execute_action_api_actions_execute_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Execute Action Api Actions Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["action-tokens"],"summary":"Execute Action Get","description":"GET variant for mail-client links (same semantics as POST).","operationId":"execute_action_get_api_actions_execute_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"recipientEmail","in":"query","required":true,"schema":{"type":"string","title":"Recipientemail"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Execute Action Get Api Actions Execute Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/state":{"get":{"tags":["public-api"],"summary":"Get State","description":"Full filing state for the key's organisation (same shape as /api/state).","operationId":"get_state_v1_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/clients":{"get":{"tags":["public-api"],"summary":"List Clients","description":"List clients. Scope: records:read.","operationId":"list_clients_v1_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["public-api"],"summary":"Create Client","description":"Create a client (allocating the next client number). Scope: records:write.\n\nBody: { kind, name, client? }.","operationId":"create_client_v1_clients_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/matters":{"get":{"tags":["public-api"],"summary":"List Matters","description":"List matters. Scope: records:read.","operationId":"list_matters_v1_matters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["public-api"],"summary":"Create Matter","description":"Create a matter under a client. Scope: records:write.\n\nBody: { clientId, title, matter? }.","operationId":"create_matter_v1_matters_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sets":{"get":{"tags":["public-api"],"summary":"List Sets","description":"List sets. Scope: records:read.","operationId":"list_sets_v1_sets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["public-api"],"summary":"Create Set","description":"Create a set under a matter. Scope: records:write.\n\nBody: { matterId, title, set? }.","operationId":"create_set_v1_sets_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents":{"get":{"tags":["public-api"],"summary":"List Documents","description":"List documents, with the same filters as the UI. Scope: records:read.","operationId":"list_documents_v1_documents_get","parameters":[{"name":"set_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text search across title/ref","title":"Q"},"description":"Free-text search across title/ref"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api"],"summary":"Create Document","description":"Issue a document (file into the repository). Scope: records:write.\n\nBody: clientId/matterId/setId or newClient/newMatter/newSet, type, title,\nnotes, source, optional fileBase64. `status: \"draft\"` saves a draft instead.","operationId":"create_document_v1_documents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/{doc_id}":{"get":{"tags":["public-api"],"summary":"Get Document","description":"Fetch one document by its MatterRef number. Scope: records:read.","operationId":"get_document_v1_documents__doc_id__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["public-api"],"summary":"Patch Document","description":"Update mutable fields (title, notes, source, status). Scope: records:write.","operationId":"patch_document_v1_documents__doc_id__patch","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inbound":{"post":{"tags":["public-api"],"summary":"Add Inbound","description":"Create an un-filed inbound item. Scope: records:write.\n\nBody: { title, source?, reviewers?, status?, notes?, fileBase64?, mime? }.","operationId":"add_inbound_v1_inbound_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inbound/file":{"post":{"tags":["public-api"],"summary":"File Inbound","description":"File an inbound item into the repository as a document. Scope: records:write.\n\nBody: { id, clientId?/newClient?, matterId?/newMatter?, setId?/newSet?,\ntype?, title?, notes?, fileBase64?, mime? }.","operationId":"file_inbound_v1_inbound_file_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workflows/{definition_id}/run":{"post":{"tags":["public-api"],"summary":"Run Workflow","description":"Start a workflow run. Scope: workflows:trigger.\n\nThe ``workflows:trigger`` scope is the authorisation for this endpoint (an\nAPI key has no seat); the runner trusts the org/user the middleware resolved\nfrom the key.","operationId":"run_workflow_v1_workflows__definition_id__run_post","parameters":[{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","title":"Definition Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"get":{"tags":["public-api"],"summary":"List Webhooks","description":"List this org's webhook endpoints (no secrets). Scope: webhooks:manage.","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["public-api"],"summary":"Create Webhook","description":"Register an outbound webhook endpoint. Scope: webhooks:manage.\n\nThe secret is returned once; we HMAC-sign payloads with it so the consumer\ncan verify. The URL must be HTTPS and must not resolve to a private address.","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}":{"delete":{"tags":["public-api"],"summary":"Disable Webhook","description":"Disable an endpoint (soft-delete; deliveries stop). Scope: webhooks:manage.","operationId":"disable_webhook_v1_webhooks__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["public-api"],"summary":"List Deliveries","description":"The delivery log for one endpoint (self-serve debugging). Scope: webhooks:manage.\n\nReturns the newest retained rows only (ADR 0054): terminal deliveries are kept\nfor ``WEBHOOK_DELIVERY_RETENTION_DAYS`` (default 30) and capped at\n``WEBHOOK_DELIVERY_MAX_PER_ENDPOINT`` (default 10_000) per endpoint; ``pending``\nrows are not purged until they reach a terminal status.","operationId":"list_deliveries_v1_webhooks__endpoint_id__deliveries_get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/test":{"post":{"tags":["public-api"],"summary":"Test Webhook","description":"Send a live test event to one endpoint and record the result.\n\nDelivered synchronously (not via the outbox) so the customer gets immediate\nfeedback before going live. Scope: webhooks:manage.","operationId":"test_webhook_v1_webhooks__endpoint_id__test_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys":{"get":{"tags":["api-keys"],"summary":"List Keys","description":"List this org's keys as metadata only (no secret material).","operationId":"list_keys_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["api-keys"],"summary":"Create Key","description":"Create an API key (returns the full key ONCE — it is never stored in\nplaintext). Requires a signed-in admin (F3 seat enforcement).","operationId":"create_key_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys/{key_id}/rotate":{"post":{"tags":["api-keys"],"summary":"Rotate Key","description":"Replace a key's secret (and optionally scopes); the old hash is retired.","operationId":"rotate_key_api_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/KeyRotateIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys/{key_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Key","description":"Revoke a key (soft-delete; it immediately stops authenticating).","operationId":"revoke_key_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push-tokens":{"post":{"tags":["push"],"summary":"Register","description":"Register (or refresh) a device push token for the current user/org.\n\nBody: { token, platform?, deviceLabel? }. Upserts on (org_id, token) so a\nrotated token on the same device overwrites its previous row. Returns\n{ id, registered }.","operationId":"register_api_push_tokens_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push-tokens/{token}":{"delete":{"tags":["push"],"summary":"Unregister","description":"Remove a device push token (sign-out). Idempotent: unknown token -> not found.","operationId":"unregister_api_push_tokens__token__delete","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alert-subscriptions/categories":{"get":{"tags":["alert-subscriptions"],"summary":"List Categories","description":"Categories known to the API; ``wired`` means the digest worker batches them.","operationId":"list_categories_api_alert_subscriptions_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/alert-subscriptions":{"get":{"tags":["alert-subscriptions"],"summary":"List Subscriptions","description":"Subscriptions visible to the current user (own user rows + org-scoped rows).","operationId":"list_subscriptions_api_alert_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["alert-subscriptions"],"summary":"Create Subscription","operationId":"create_subscription_api_alert_subscriptions_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alert-subscriptions/{subscription_id}":{"patch":{"tags":["alert-subscriptions"],"summary":"Update Subscription","operationId":"update_subscription_api_alert_subscriptions__subscription_id__patch","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"integer","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["alert-subscriptions"],"summary":"Delete Subscription","operationId":"delete_subscription_api_alert_subscriptions__subscription_id__delete","parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"integer","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/query":{"post":{"tags":["ai"],"summary":"Ai Query","description":"Ask the AI a question about one matter, with citations + honesty gate.\n\nBody: ``{ matterId, question, sessionId? }``. ``matterId`` is the\nuser-visible MatterRef number (e.g. ``C0001001-00012``). The answer is\nreturned with resolved citations (always real objects the user can see) and\nan ``insufficientContext`` flag when it could not cite. The conversation is\nrecorded into ``ai_sessions`` / ``ai_messages``.","operationId":"ai_query_api_ai_query_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Ai Query Api Ai Query Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/retrieve":{"post":{"tags":["ai"],"summary":"Ai Retrieve","description":"Retrieve the most-relevant chunks for a question, with citations (no LLM).\n\nThis is ADR 0038's retrieval \"proof\" surface: the permission-filtered vector\nquery the chapel uses, exposed directly so retrieval quality can be measured\nand evals run without spending chat tokens. Body: ``{ matterId, question }``.\n\nReturns the top chunks (document/email) with their similarity and citations;\nempty when no active model is configured or the corpus is not embedded yet.","operationId":"ai_retrieve_api_ai_retrieve_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Ai Retrieve Api Ai Retrieve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/sessions":{"get":{"tags":["ai"],"summary":"List Sessions","description":"List the current org's AI sessions, optionally scoped to one matter.","operationId":"list_sessions_api_ai_sessions_get","parameters":[{"name":"matter_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Sessions Api Ai Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/sessions/{session_id}":{"get":{"tags":["ai"],"summary":"Get Session","description":"One session plus its ordered messages.","operationId":"get_session_api_ai_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Session Api Ai Sessions  Session Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/saved-queries":{"get":{"tags":["ai"],"summary":"List Saved Queries","description":"List saved answers (the Queries tab), with a ``stale`` flag.\n\nA saved answer is stale when the matter's ``ai_version`` has moved since it\nwas generated — it is kept (never deleted) but marked. The Phase 2 cache\nserves only non-stale answers; this list is how a reviewer sees what was\nconcluded before the latest update (ADR 0005).","operationId":"list_saved_queries_api_ai_saved_queries_get","parameters":[{"name":"matter_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response List Saved Queries Api Ai Saved Queries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/sessions/{session_id}/save":{"post":{"tags":["ai"],"summary":"Save Session","description":"Promote the session's latest answer into ``saved_queries`` (version-stamped).\n\nThe answer is stamped with the matter's current ``ai_version`` so the Phase 2\ncache can detect staleness. Saving is explicit — a fresh answer only enters\nthe cache when the user promotes it here.","operationId":"save_session_api_ai_sessions__session_id__save_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Save Session Api Ai Sessions  Session Id  Save Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/setup-chat/config":{"get":{"tags":["setup-chat"],"summary":"Setup Chat Config","operationId":"setup_chat_config_api_setup_chat_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Setup Chat Config Api Setup Chat Config Get"}}}}}}},"/api/setup-chat/chat":{"post":{"tags":["setup-chat"],"summary":"Setup Chat Message","description":"Natural-language turn: assistant reply plus optional signed proposal.","operationId":"setup_chat_message_api_setup_chat_chat_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Setup Chat Message Api Setup Chat Chat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/setup-chat/propose":{"post":{"tags":["setup-chat"],"summary":"Setup Chat Propose","description":"Structured dry-run (tests and UI) without calling the model.","operationId":"setup_chat_propose_api_setup_chat_propose_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Setup Chat Propose Api Setup Chat Propose Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/setup-chat/confirm":{"post":{"tags":["setup-chat"],"summary":"Setup Chat Confirm","description":"Execute a signed proposal (the only write path for setup chat).","operationId":"setup_chat_confirm_api_setup_chat_confirm_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Setup Chat Confirm Api Setup Chat Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/setup-chat/policy":{"put":{"tags":["setup-chat"],"summary":"Setup Chat Policy","description":"Toggle AI setup chat for the org (stored in organisations.branding.setupAi).","operationId":"setup_chat_policy_api_setup_chat_policy_put","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Setup Chat Policy Api Setup Chat Policy Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-instances/{instance_id}/matter-summary":{"get":{"tags":["ai","workflows"],"summary":"Get Matter Summary","description":"Regenerated matter summary + pre-shown action chips for a workflow run.","operationId":"get_matter_summary_api_workflow_instances__instance_id__matter_summary_get","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Matter Summary Api Workflow Instances  Instance Id  Matter Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-instances/{instance_id}/action-chips/{chip_id}/execute":{"post":{"tags":["ai","workflows"],"summary":"Post Execute Action Chip","description":"Execute one action chip (admin/power only; viewer -> 403).","operationId":"post_execute_action_chip_api_workflow_instances__instance_id__action_chips__chip_id__execute_post","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"chip_id","in":"path","required":true,"schema":{"type":"string","title":"Chip Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Post Execute Action Chip Api Workflow Instances  Instance Id  Action Chips  Chip Id  Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search":{"get":{"tags":["search"],"summary":"Search Documents","description":"Ranked full-text search across the current org's documents.\n\n``q`` supports bare keywords (stemmed + ranked), a quoted phrase (exact\nadjacency), and ``field:value`` operators (``title:``, ``notes:``, ``type:``,\n``status:``, ``source:``, ``doc:``/``id:``). Results are ordered by\nrelevance (``ts_rank``) and scoped to the request org via RLS + an explicit\n``org_id`` bind. Returns ``{ items, total, q }``.","operationId":"search_documents_api_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Query: keywords, \"phrase\", or field:value operators","title":"Q"},"description":"Query: keywords, \"phrase\", or field:value operators"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Search Documents Api Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/categories":{"get":{"tags":["search"],"summary":"Search Category Hits","description":"Search the three ADR 0052 categories for the current organisation.\n\nA request hit includes REQ, status, assignee, and the attached draft's\n``doc_id``. A record hit includes REF and the current file, and only\ndocuments that already have a REF. A report hit opens a named dashboard.\nClients and matters are not returned.","operationId":"search_category_hits_api_search_categories_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Match REQ, REF, title, status, or a report name","title":"Q"},"description":"Match REQ, REF, title, status, or a report name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional scope: requests, records, or reports","title":"Category"},"description":"Optional scope: requests, records, or reports"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Search Category Hits Api Search Categories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mail-search-rows":{"get":{"tags":["attachment-preview"],"summary":"Get Mail Search Rows","description":"Attachment rows to merge into the Records list (peer to email documents).","operationId":"get_mail_search_rows_api_mail_search_rows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/documents/{doc_id}/mail-preview":{"get":{"tags":["attachment-preview"],"summary":"Get Mail Preview","description":"Email body, attachment tabs, and version hints for the preview pane.","operationId":"get_mail_preview_api_documents__doc_id__mail_preview_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/attachments/{ref_id}/file":{"get":{"tags":["attachment-preview"],"summary":"Get Attachment File","operationId":"get_attachment_file_api_attachments__ref_id__file_get","parameters":[{"name":"ref_id","in":"path","required":true,"schema":{"type":"string","title":"Ref Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/version-compare":{"get":{"tags":["attachment-preview"],"summary":"Get Version Compare","description":"Text diff when bytes are text-extractable; otherwise side-by-side file URLs.","operationId":"get_version_compare_api_documents__doc_id__version_compare_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"other","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Other"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export":{"get":{"tags":["export"],"summary":"Export Tenant","description":"One-click export of the current organisation (admin only).\n\nReturns a ``.zip`` containing ``export.json`` (structured records + history),\n``manifest.json`` (fixity: file checksums + document hashes), and the\noriginal file bytes under their stored rel paths. Synchronous on purpose —\na full snapshot fits one request/response at current scale; a streaming/job\nvariant is a later enterprise ask (ADR 0034 open question).","operationId":"export_tenant_api_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/matters/{matter_id}/file-handover":{"get":{"tags":["file-handover"],"summary":"Produce File Handover","description":"Export one matter as a portable zip (admin only). Audits successful runs.","operationId":"produce_file_handover_api_matters__matter_id__file_handover_get","parameters":[{"name":"matter_id","in":"path","required":true,"schema":{"type":"string","title":"Matter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matters/{matter_id}/custody-report":{"get":{"tags":["custody"],"summary":"Get Custody Report","description":"One matter's chain of custody (admin only). ``?format=html`` for print.\n\nReturns JSON by default (machine-readable). ``?format=html`` returns a\nself-contained, printable HTML page (inline CSS, no external assets).","operationId":"get_custody_report_api_matters__matter_id__custody_report_get","parameters":[{"name":"matter_id","in":"path","required":true,"schema":{"type":"string","title":"Matter Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards":{"get":{"tags":["dashboards"],"summary":"List Dashboards","description":"The preset catalogue + custom layouts + widget palette + filter options.","operationId":"list_dashboards_api_dashboards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dashboards/{layout_id}":{"get":{"tags":["dashboards"],"summary":"Get Dashboard","description":"Aggregate the current org's records + workflow instances into a preset\nlayout's fixed widgets, filtered by the same chips as search.\n\nRead-only: admin/power/viewer all may call it; nothing is written.","operationId":"get_dashboard_api_dashboards__layout_id__get","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"client","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client"}},{"name":"matter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter"}},{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignee"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/{layout_id}/csv":{"get":{"tags":["dashboards"],"summary":"Export Dashboard Csv","description":"CSV of the *filtered set* (not the widgets) — the same rows the widgets\naggregate over, for the spreadsheet-export habit the dashboards replace.","operationId":"export_dashboard_csv_api_dashboards__layout_id__csv_get","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"client","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client"}},{"name":"matter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter"}},{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignee"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard-views":{"get":{"tags":["dashboards"],"summary":"List Dashboard Views","description":"The current user's saved filter states (plus org-level defaults).","operationId":"list_dashboard_views_api_dashboard_views_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dashboard-views/{layout_id}":{"put":{"tags":["dashboards"],"summary":"Save Dashboard View","description":"Upsert the current user's saved filter state for a preset layout.","operationId":"save_dashboard_view_api_dashboard_views__layout_id__put","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dashboards"],"summary":"Delete Dashboard View","description":"Delete the current user's saved filter state for a preset layout.","operationId":"delete_dashboard_view_api_dashboard_views__layout_id__delete","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard-layouts":{"get":{"tags":["dashboards"],"summary":"List Dashboard Layouts","description":"The current user's custom layouts (their own + org-level), read-only.","operationId":"list_dashboard_layouts_api_dashboard_layouts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["dashboards"],"summary":"Create Dashboard Layout","description":"Create a custom layout (admin/power) from a name + fixed widget list.","operationId":"create_dashboard_layout_api_dashboard_layouts_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/custom/{layout_id}":{"get":{"tags":["dashboards"],"summary":"Get Custom Dashboard","description":"Aggregate a stored custom layout (ADR 0044) — the same read path as\npresets, but with the user-defined widget list and saved filter defaults.","operationId":"get_custom_dashboard_api_dashboards_custom__layout_id__get","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"client","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client"}},{"name":"matter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter"}},{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignee"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/custom/{layout_id}/csv":{"get":{"tags":["dashboards"],"summary":"Export Custom Dashboard Csv","description":"CSV of the filtered set for a custom layout — the same rows it aggregates.","operationId":"export_custom_dashboard_csv_api_dashboards_custom__layout_id__csv_get","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"client","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client"}},{"name":"matter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matter"}},{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignee"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard-layouts/{layout_id}":{"put":{"tags":["dashboards"],"summary":"Update Dashboard Layout","description":"Update a custom layout's name / widgets / filters (admin/power).","operationId":"update_dashboard_layout_api_dashboard_layouts__layout_id__put","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dashboards"],"summary":"Delete Dashboard Layout","description":"Delete a custom layout (admin/power).","operationId":"delete_dashboard_layout_api_dashboard_layouts__layout_id__delete","parameters":[{"name":"layout_id","in":"path","required":true,"schema":{"type":"string","title":"Layout Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ui-config":{"get":{"tags":["ui-config"],"summary":"Get Resolved Ui Config","description":"Resolved UI profile for the signed-in user (org → user → built-in).","operationId":"get_resolved_ui_config_api_ui_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["ui-config"],"summary":"Put User Ui Config","description":"Save per-user UI overrides. Rejects writes to org-enforced keys.","operationId":"put_user_ui_config_api_ui_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUiConfigIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ui-config":{"get":{"tags":["ui-config"],"summary":"Get Org Ui Config Admin","description":"Raw org UI profile (admin only).","operationId":"get_org_ui_config_admin_api_admin_ui_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["ui-config"],"summary":"Put Org Ui Config Admin","description":"Replace org UI profile (admin only). Invalid profiles are rejected.","operationId":"put_org_ui_config_admin_api_admin_ui_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUiConfigIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/people":{"post":{"tags":["identity"],"summary":"Invite Person","description":"Admin-only: invite a person by email + role (the \"Add person\" flow).\n\nCreates (or links) the Keycloak user, stores ``status='invited'``, and sends\nthe invite/verify email. Idempotent: a duplicate invite links the existing\nuser and does not create a second Keycloak user.","operationId":"invite_person_api_people_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/crm/board":{"get":{"tags":["crm"],"summary":"Board","description":"List the pipeline board grouped by stage (read-only; any seat).","operationId":"board_api_crm_board_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Board Api Crm Board Get"}}}}}}},"/api/crm/contacts":{"post":{"tags":["crm"],"summary":"Create Contact Route","description":"Create a contact (admin/power). Returns {result: contact}.","operationId":"create_contact_route_api_crm_contacts_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Contact Route Api Crm Contacts Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/crm/contacts/{contact_id}/advance":{"post":{"tags":["crm"],"summary":"Advance Contact Route","description":"Advance a contact's stage (admin/power). Returns {result: contact}.","operationId":"advance_contact_route_api_crm_contacts__contact_id__advance_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Advance Contact Route Api Crm Contacts  Contact Id  Advance Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/crm/templates":{"get":{"tags":["crm"],"summary":"Templates Route","description":"List the seeded CRM templates (read-only).","operationId":"templates_route_api_crm_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Templates Route Api Crm Templates Get"}}}}}}},"/api/crm/templates/seed":{"post":{"tags":["crm"],"summary":"Seed Templates Route","description":"Seed the 3 templates, depositing their sample contacts (admin only).","operationId":"seed_templates_route_api_crm_templates_seed_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Seed Templates Route Api Crm Templates Seed Post"}}}}}}},"/api/users":{"get":{"tags":["identity"],"summary":"List Users","description":"List org members (legacy ``users`` or MR2 ``core.memberships``).","operationId":"list_users_api_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/roles":{"get":{"tags":["identity"],"summary":"List Roles","description":"List roles (owner, admin, editor, viewer, approver). Table: roles.","operationId":"list_roles_api_roles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/clients":{"post":{"tags":["structure"],"summary":"Create Client","description":"Create a client (allocating the next client number for its kind).\n\nBody: { kind, name, client? }. Returns { result, state } like the Node API.","operationId":"create_client_api_clients_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/matters":{"post":{"tags":["structure"],"summary":"Create Matter","description":"Create a matter under a client. Body: { clientId, title, matter? }.","operationId":"create_matter_api_matters_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sets":{"post":{"tags":["structure"],"summary":"Create Set","description":"Create a set under a matter. Body: { matterId, title, set? }.","operationId":"create_set_api_sets_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/registry":{"get":{"tags":["documents"],"summary":"Get State","description":"Return the full app state the UI reads on load.\n\nBacked by a JOIN across clients -> matters -> sets -> documents, plus the\nkind/type catalogues. Shape matches the Node /api/state.","operationId":"get_state_api_registry_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/state":{"get":{"tags":["documents"],"summary":"Get State","description":"Return the full app state the UI reads on load.\n\nBacked by a JOIN across clients -> matters -> sets -> documents, plus the\nkind/type catalogues. Shape matches the Node /api/state.","operationId":"get_state_api_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/documents":{"post":{"tags":["documents"],"summary":"Create Document","description":"Issue a document (the act of filing into the repository).\n\nBody may carry clientId/matterId/setId or newClient/newMatter/newSet, a\ntype, title, notes, source, and optional base64 file bytes. A body with\n`status: \"draft\"` saves a draft instead of issuing (mirrors server/api.js).\nReturns { result, state }.","operationId":"create_document_api_documents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["documents"],"summary":"List Documents","description":"List documents (server-side slice of the full state).","operationId":"list_documents_api_documents_get","parameters":[{"name":"set_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text search across title/ref","title":"Q"},"description":"Free-text search across title/ref"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/preview":{"post":{"tags":["documents"],"summary":"Preview Number","description":"Preview the MatterRef number an issue would produce, without persisting.","operationId":"preview_number_api_preview_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/preview/structure":{"post":{"tags":["structure"],"summary":"Preview Structure","description":"Preview client/matter/set numbers the setup wizard would allocate (no write).","operationId":"preview_structure_api_preview_structure_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/finalize":{"post":{"tags":["documents"],"summary":"Finalize Document","description":"Assign the repository REF once. A second call leaves that REF unchanged.\n\nCreating a draft or issuing a doc_id does not assign a REF (ADR 0052).\nThe organisation must already have a four-letter ``ref_prefix``.","operationId":"finalize_document_api_documents__doc_id__finalize_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}":{"patch":{"tags":["documents"],"summary":"Patch Document","description":"Update mutable fields of a document (title, notes, source, status).\n\nThe MatterRef string is immutable — it is not in DocumentPatch. Returns\n{ result, state }.","operationId":"patch_document_api_documents__doc_id__patch","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["documents"],"summary":"Get Document","description":"Fetch one document by its MatterRef id.","operationId":"get_document_api_documents__doc_id__get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/version":{"post":{"tags":["documents"],"summary":"Create Version","description":"Create a new version of an existing document (same base, bumped -vNN).","operationId":"create_version_api_documents__doc_id__version_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/fields":{"get":{"tags":["documents"],"summary":"List Fields","description":"List EAV fields for a document. Table: document_fields.","operationId":"list_fields_api_documents__doc_id__fields_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["documents"],"summary":"Upsert Field","description":"Add or replace one EAV field on a document.","operationId":"upsert_field_api_documents__doc_id__fields_post","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{doc_id}/file":{"get":{"tags":["documents"],"summary":"Get File","description":"Serve the stored file bytes for a document (preview/download).","operationId":"get_file_api_documents__doc_id__file_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Download"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/drafts/{doc_id}/file":{"get":{"tags":["documents"],"summary":"Get Draft File","description":"Serve the stored file bytes for a draft.","operationId":"get_draft_file_api_drafts__doc_id__file_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Download"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbound/{doc_id}/file":{"get":{"tags":["documents"],"summary":"Get Inbound File","description":"Serve the stored file bytes for an inbound item.","operationId":"get_inbound_file_api_inbound__doc_id__file_get","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Download"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbound/file":{"post":{"tags":["inbound"],"summary":"File Inbound","description":"File an inbound item into the repository as a document, then remove it.\n\nBody: { id, clientId?/newClient?, matterId?/newMatter?, setId?/newSet?,\ntype?, title?, notes?, fileBase64?, mime? }. Returns { result, state }.","operationId":"file_inbound_api_inbound_file_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbound/{item_id}":{"patch":{"tags":["inbound"],"summary":"Patch Inbound","description":"Edit an inbound item's title/reviewers/status. Returns { result, state }.","operationId":"patch_inbound_api_inbound__item_id__patch","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inbound"],"summary":"Delete Inbound","description":"Dismiss (delete) an inbound item. Returns { result, state }.","operationId":"delete_inbound_api_inbound__item_id__delete","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows":{"post":{"tags":["inbound"],"summary":"Add Inbound Alias","operationId":"add_inbound_alias_api_workflows_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/file":{"post":{"tags":["inbound"],"summary":"File Inbound Alias","operationId":"file_inbound_alias_api_workflows_file_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications":{"get":{"tags":["cross-cutting"],"summary":"List Notifications","description":"In-app notification feed for the current user.","operationId":"list_notifications_api_notifications_get","parameters":[{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/saved-searches":{"get":{"tags":["cross-cutting"],"summary":"List Saved Searches","description":"Server-side saved searches.","operationId":"list_saved_searches_api_saved_searches_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/collections":{"get":{"tags":["cross-cutting"],"summary":"List Collections","description":"Personal + shared virtual folders / starred / pinned.","operationId":"list_collections_api_collections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"tags":["system"],"summary":"Health","description":"Liveness probe. Returns ok if the process is up.","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CaptureBody":{"properties":{"templateId":{"type":"string","title":"Templateid"},"title":{"type":"string","title":"Title"},"payload":{"type":"object","title":"Payload"}},"type":"object","required":["templateId","title"],"title":"CaptureBody"},"CommentIn":{"properties":{"body":{"type":"string","title":"Body"},"parent_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Id"},"mentions":{"items":{},"type":"array","title":"Mentions"},"kind":{"type":"string","title":"Kind","default":"comment"},"visibility":{"type":"string","title":"Visibility","default":"internal"}},"type":"object","required":["body"],"title":"CommentIn"},"CommentVisibilityPatch":{"properties":{"visibility":{"type":"string","title":"Visibility"}},"type":"object","required":["visibility"],"title":"CommentVisibilityPatch"},"DocumentPatch":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"DocumentPatch","description":"Partial update of a document row (title, notes, status, ...)."},"FileCaptureBody":{"properties":{"clientId":{"type":"string","title":"Clientid"},"matterId":{"type":"string","title":"Matterid"},"setId":{"type":"string","title":"Setid"},"type":{"type":"string","title":"Type","default":"LTR"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["clientId","matterId","setId"],"title":"FileCaptureBody"},"ForgetBody":{"properties":{"senderEmail":{"type":"string","minLength":1,"title":"Senderemail"}},"type":"object","required":["senderEmail"],"title":"ForgetBody"},"FormSubmit":{"properties":{},"additionalProperties":true,"type":"object","title":"FormSubmit"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteIn":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"viewer"}},"type":"object","required":["email"],"title":"InviteIn","description":"The invite body: an email + the seat role (admin / editor / viewer)."},"KeyIn":{"properties":{"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":["records:read"]}},"type":"object","required":["name"],"title":"KeyIn"},"KeyRotateIn":{"properties":{"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","title":"KeyRotateIn"},"LinkIn":{"properties":{"from_document_id":{"type":"integer","title":"From Document Id"},"to_document_id":{"type":"integer","title":"To Document Id"},"link_type":{"type":"string","title":"Link Type","default":"related"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["from_document_id","to_document_id"],"title":"LinkIn"},"OrgUiConfigIn":{"properties":{"settings":{"type":"object","title":"Settings"},"enforced":{"items":{"type":"string"},"type":"array","title":"Enforced"}},"type":"object","title":"OrgUiConfigIn"},"PageIn":{"properties":{"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"kind":{"type":"string","title":"Kind"},"record_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Record Id"},"workflow_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Workflow Id"},"config":{"type":"object","title":"Config","default":{}},"published":{"type":"boolean","title":"Published","default":false}},"type":"object","required":["slug","title","kind"],"title":"PageIn"},"PublicSubmit":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"type":{"type":"string","title":"Type","default":"LTR"},"visitor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visitor Id"},"consent":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Consent"}},"additionalProperties":true,"type":"object","title":"PublicSubmit","description":"A public form submission. ``title``/``notes`` are the record content;\n``visitor_id``/``consent`` are the tracking layer and never mix into it.\n\nUnknown form fields are allowed (``extra = \"allow\"``) so a real public form\ndoes not 400 on vendor-specific fields; ``_deposit`` reads only the keys\nabove and ignores the rest."},"RecordIn":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"filing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filing Type"},"owner_team":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Team"},"statuses":{"items":{"type":"string"},"type":"array","title":"Statuses","default":[]},"required_fields":{"items":{"type":"string"},"type":"array","title":"Required Fields","default":[]},"field_defs":{"items":{"type":"object"},"type":"array","title":"Field Defs","default":[]}},"type":"object","required":["code","name"],"title":"RecordIn"},"RememberBody":{"properties":{"senderEmail":{"type":"string","minLength":1,"title":"Senderemail"},"matterId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Matterid"},"matterRef":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matterref"}},"type":"object","required":["senderEmail"],"title":"RememberBody"},"TemplateBody":{"properties":{"name":{"type":"string","title":"Name"},"fields":{"items":{"type":"object"},"type":"array","title":"Fields"}},"type":"object","required":["name"],"title":"TemplateBody"},"UserUiConfigIn":{"properties":{"settings":{"type":"object","title":"Settings"}},"type":"object","title":"UserUiConfigIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookIn":{"properties":{"url":{"type":"string","title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types","default":["*"]}},"type":"object","required":["url"],"title":"WebhookIn"}}}}