{"openapi":"3.1.0","info":{"title":"GMC PRISM API","description":"HTTP API for the IFRS 18 / Ind AS 118 assessment SaaS.","version":"0.4.0"},"paths":{"/api/cors-check":{"get":{"summary":"Cors Check","operationId":"cors_check_api_cors_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"tags":["health"],"summary":"Health","description":"Liveness probe.  Cheap, no DB round-trip.  Use /api/health/ready\nfor the readiness probe that exercises Supabase + storage.","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/ready":{"get":{"tags":["health"],"summary":"Health Ready","description":"X-8.5 - Readiness probe.\n\nExercises every external dependency the app needs to serve a\nreal request:\n  * Database (Supabase Postgres in production, SQLite in dev) -\n    runs SELECT 1.\n  * KB load - confirms the in-process knowledge base loaded.\n  * Migration head - confirms alembic heads are at the expected\n    revision.\n\nEach check has its own status; the overall status is \"ready\"\niff every check passed.  Returns HTTP 200 either way so monitors\ncan scrape the JSON body; container orchestrators that want a\nbinary signal should use /api/health (the cheap liveness probe)\ninstead.\n\nSentry / Fly autohealing should NOT consume this endpoint as a\nliveness probe because a transient DB blip would trigger a\nmachine restart that doesn't fix anything.","operationId":"health_ready_api_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/info":{"get":{"tags":["health"],"summary":"Info","operationId":"info_api_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/disclosures/forms/catalog":{"get":{"tags":["disclosure-forms"],"summary":"Get Disclosure Forms Catalog","description":"Public catalogue of in-tool disclosure forms — the UI\nuses this to drive the Disclosures Hub nav and to know\nwhich forms have superseded Excel sheets.","operationId":"get_disclosure_forms_catalog_api_disclosures_forms_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/engagements/{engagement_id}/disclosures/forms/{sheet_code}":{"get":{"tags":["disclosure-forms"],"summary":"Get Disclosure Form","description":"Read the structured form payload for the latest non-\ndeleted EngagementNonTbInput row matching the engagement\n+ sheet_code + period. Returns an empty-skeleton form when\nno row exists yet (so the UI can render the empty state\nwithout a 404).","operationId":"get_disclosure_form_api_engagements__engagement_id__disclosures_forms__sheet_code__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"sheet_code","in":"path","required":true,"schema":{"type":"string","title":"Sheet Code"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["disclosure-forms"],"summary":"Put Disclosure Form","description":"Save the form. Validates against the registered schema,\nsoft-deletes the prior row for the same\n(engagement, sheet_code, period), and inserts a fresh row\nwith the canonical blocks payload. Audit trail preserved\nvia the soft-deleted row.\n\nOn validation failure raises HTTP 422 with field-level\ndetail so the form UI can highlight the offending row.\n\n19 Jul 2026 — B6 · optimistic concurrency control.  Optional\n``If-Match`` request header carries the ``saved_at`` value the\nclient received from its last GET.  On mismatch → 409 with the\ncurrent version so the FE can rebase before losing the edit.","operationId":"put_disclosure_form_api_engagements__engagement_id__disclosures_forms__sheet_code__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"sheet_code","in":"path","required":true,"schema":{"type":"string","title":"Sheet Code"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DisclosureFormPutResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/disclosures/forms/{sheet_code}/prefill":{"post":{"tags":["disclosure-forms"],"summary":"Prefill Disclosure Form","description":"W3-10 — run the sheet's linked disclosure engine on the\ncurrent form data and return an enriched form.  Non-mutating\n— the response is a preview; the UI merges it into state and\nthe preparer decides to Save (which persists via PUT).\n\n404 when sheet_code isn't registered.\n501 when the sheet_code has no engine wire-up (e.g. T6.3\n    Contingent Liabilities, T2.1 PPE — pure preparer entry).","operationId":"prefill_disclosure_form_api_engagements__engagement_id__disclosures_forms__sheet_code__prefill_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"sheet_code","in":"path","required":true,"schema":{"type":"string","title":"Sheet Code"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DisclosureFormPrefillResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/workpaper":{"post":{"tags":["workpaper"],"summary":"Export Workpaper","description":"Queue a fresh auditor workpaper .xlsx for this note.\n\nThe .xlsx bundles six sheets — Header, Numbers (editable),\nNarrative (editable), Evidence (read-only), FaceLines\n(read-only), and hidden _meta with the version stamp and\nper-row UUIDs the S2 import path uses to reconstruct row\nidentity across auditor edits.\n\nBuilding it runs the narrative engine, so it runs on the job worker\n(ported from GMC-PRISM; this was a synchronous GET): this checks the\nnote and access, queues a ``workpaper_export`` job and answers 202.\nPoll ``GET /api/deliverable-jobs/{id}``, then fetch the .xlsx from\n``GET /api/deliverable-jobs/{id}/download``.","operationId":"export_workpaper_api_engagements__engagement_id__notes__note_key__workpaper_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/workpaper/import":{"post":{"tags":["workpaper"],"summary":"Import Workpaper Preview","description":"Parse the uploaded workpaper and compute a per-cell diff\nagainst the current NoteCanvas state.  Returns the diff for\nthe FE to render — does NOT mutate any state.\n\nThe FE uses this to render the DiffPreview modal.  The user\nconfirms via a separate POST /workpaper/apply.","operationId":"import_workpaper_preview_api_engagements__engagement_id__notes__note_key__workpaper_import_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_workpaper_preview_api_engagements__engagement_id__notes__note_key__workpaper_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/workpaper/apply":{"post":{"tags":["workpaper"],"summary":"Apply Workpaper","description":"Commit the workpaper's edits to the note.\n\nRejects with 409 when the note has been edited in the tool\nsince the workpaper was exported (stale-stamp conflict) so\nthe preparer can re-export and reconcile — see the S3\nDiffPreview conflict banner.\n\nSuccessful apply:\n  * Soft-deletes the prior ``EngagementNonTbInput`` row\n  * Inserts a fresh row with the new payload_json\n  * Returns the new version_stamp so the FE can update its\n    local state without a full refetch","operationId":"apply_workpaper_api_engagements__engagement_id__notes__note_key__workpaper_apply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_apply_workpaper_api_engagements__engagement_id__notes__note_key__workpaper_apply_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/line-order/{statement}":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"Get Line Order","description":"Return the preparer-authored row order for one face statement.\nEmpty list = default rules-derived order is in force.","operationId":"get_line_order_api_engagements__engagement_id__fs_line_order__statement__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement","in":"path","required":true,"schema":{"type":"string","title":"Statement"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LineOrderItem"},"title":"Response Get Line Order Api Engagements  Engagement Id  Fs Line Order  Statement  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs-line-order-and-footnotes"],"summary":"Put Line Order","description":"Persist a new row order for a face statement.  Body must be a\nlist of line_keys in the desired order — the router assigns\npositions 0..N-1 for you.  Any prior order for this\n(engagement, statement) pair is deleted first so the persisted\nset exactly matches the payload.","operationId":"put_line_order_api_engagements__engagement_id__fs_line_order__statement__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement","in":"path","required":true,"schema":{"type":"string","title":"Statement"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineOrderPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Line Order Api Engagements  Engagement Id  Fs Line Order  Statement  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/captions/{statement}":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"Get Fs Captions","operationId":"get_fs_captions_api_engagements__engagement_id__fs_captions__statement__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement","in":"path","required":true,"schema":{"type":"string","title":"Statement"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FsCaptionOut"},"title":"Response Get Fs Captions Api Engagements  Engagement Id  Fs Captions  Statement  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs-line-order-and-footnotes"],"summary":"Put Fs Caption","description":"Upsert one caption.  A blank caption deletes the row, which\nputs the library wording back.","operationId":"put_fs_caption_api_engagements__engagement_id__fs_captions__statement__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement","in":"path","required":true,"schema":{"type":"string","title":"Statement"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsCaptionPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Fs Caption Api Engagements  Engagement Id  Fs Captions  Statement  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/footnote":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"List Note Footnotes","description":"Return all non-deleted footnotes for an engagement so the\nNotesIndexPage can hydrate them in one round-trip on load.","operationId":"list_note_footnotes_api_engagements__engagement_id__notes_footnote_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NoteFootnoteOut"},"title":"Response List Note Footnotes Api Engagements  Engagement Id  Notes Footnote Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/footnote/{note_key}":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"Get Note Footnote","operationId":"get_note_footnote_api_engagements__engagement_id__notes_footnote__note_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteFootnoteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs-line-order-and-footnotes"],"summary":"Put Note Footnote","description":"Create or update the footnote for one note.  Body HTML is\nsanitised against the whitelist tag set — see\n_sanitise_footnote_html — so a rogue <script>...</script>\nfrom a compromised editor is dropped server-side.","operationId":"put_note_footnote_api_engagements__engagement_id__notes_footnote__note_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteFootnotePutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteFootnoteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fs-line-order-and-footnotes"],"summary":"Delete Note Footnote","description":"Soft-delete a footnote so the auto-generated note falls back\nto no-footnote presentation.  Restorable by re-saving.","operationId":"delete_note_footnote_api_engagements__engagement_id__notes_footnote__note_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Note Footnote Api Engagements  Engagement Id  Notes Footnote  Note Key  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/nli-orders":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"Get All Nli Orders","description":"Every saved NLI row order for the engagement, in one call:\n``{note_key: [nli_head, ...]}`` in position order.  The FS Preview\nneeds all of them at once; fetching per note was ~25 requests per\nrender and tripped the rate limiter for the rest of the page.","operationId":"get_all_nli_orders_api_engagements__engagement_id__nli_orders_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"title":"Response Get All Nli Orders Api Engagements  Engagement Id  Nli Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/nli-order":{"get":{"tags":["fs-line-order-and-footnotes"],"summary":"Get Nli Order","description":"Preparer-authored NLI row order for one auto-note.  Empty list\nmeans the default (backend-derived) order is in force.\n\nStorage is the same `engagement_fs_line_order` table with\n`statement=\"NLI\"` and a compound `line_key = <note_key>||<nli_head>`.\nAvoids a new migration (the alembic-version column is capped at\n32 chars — a prior migration ran into that limit).","operationId":"get_nli_order_api_engagements__engagement_id__notes__note_key__nli_order_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NliOrderItem"},"title":"Response Get Nli Order Api Engagements  Engagement Id  Notes  Note Key  Nli Order Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs-line-order-and-footnotes"],"summary":"Put Nli Order","description":"Persist a new NLI order for one auto-note.  Body is a list of\nNLI heads in the desired order — the router assigns\npositions 0..N-1 for you.  Any prior NLI order for this\n(engagement, note) pair is wiped first so the persisted set\nexactly matches the payload.","operationId":"put_nli_order_api_engagements__engagement_id__notes__note_key__nli_order_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NliOrderPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Nli Order Api Engagements  Engagement Id  Notes  Note Key  Nli Order Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/coa/template.xlsx":{"get":{"tags":["entity-coa"],"summary":"Coa Template","operationId":"coa_template_api_tenants__tenant_id__coa_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/coa/options":{"get":{"tags":["entity-coa"],"summary":"Coa Options","operationId":"coa_options_api_tenants__tenant_id__coa_options_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/coa/parse":{"post":{"tags":["entity-coa"],"summary":"Coa Parse","description":"Read an uploaded COA workbook.  Returns the good rows and a\nproblem per bad row; saves nothing.","operationId":"coa_parse_api_tenants__tenant_id__coa_parse_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_coa_parse_api_tenants__tenant_id__coa_parse_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/coa/check":{"post":{"tags":["entity-coa"],"summary":"Coa Check","description":"Check rows typed or edited on screen; saves nothing.","operationId":"coa_check_api_tenants__tenant_id__coa_check_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoaRowsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/clients/{client_id}/coa":{"get":{"tags":["entity-coa"],"summary":"Get Entity Coa","operationId":"get_entity_coa_api_clients__client_id__coa_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["entity-coa"],"summary":"Put Entity Coa","description":"Replace the entity's COA with ``rows``.  Refused, saving nothing,\nwhen any row has a problem.  An empty list removes the COA: the\nentity goes back to the Global COA.","operationId":"put_entity_coa_api_clients__client_id__coa_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoaRowsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/clients/{client_id}/coa.xlsx":{"get":{"tags":["entity-coa"],"summary":"Export Entity Coa","description":"The entity's saved COA in the template layout, to edit and\nupload again.","operationId":"export_entity_coa_api_clients__client_id__coa_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/auditors-report":{"get":{"tags":["auditors-report"],"summary":"Get Auditors Report","operationId":"get_auditors_report_api_engagements__engagement_id__auditors_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditorsReportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["auditors-report"],"summary":"Put Auditors Report","description":"Store the report body.  An empty body is the same as DELETE.","operationId":"put_auditors_report_api_engagements__engagement_id__auditors_report_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditorsReportPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditorsReportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["auditors-report"],"summary":"Delete Auditors Report","operationId":"delete_auditors_report_api_engagements__engagement_id__auditors_report_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Auditors Report Api Engagements  Engagement Id  Auditors Report Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/uploads/{upload_id}/reindex":{"post":{"tags":["ar-reindex"],"summary":"Reindex Annual Report","operationId":"reindex_annual_report_api_engagements__engagement_id__uploads__upload_id__reindex_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reindex Annual Report Api Engagements  Engagement Id  Uploads  Upload Id  Reindex Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-deletions":{"post":{"tags":["note-deletions"],"summary":"Ask Note Deletion","operationId":"ask_note_deletion_api_engagements__engagement_id__note_deletions_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_AskReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["note-deletions"],"summary":"List Note Deletions","operationId":"list_note_deletions_api_engagements__engagement_id__note_deletions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-deletions/{request_id}":{"delete":{"tags":["note-deletions"],"summary":"Withdraw Note Deletion","operationId":"withdraw_note_deletion_api_engagements__engagement_id__note_deletions__request_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-deletions/{request_id}/accept":{"post":{"tags":["note-deletions"],"summary":"Accept Note Deletion","operationId":"accept_note_deletion_api_engagements__engagement_id__note_deletions__request_id__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_deletions___ReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-deletions/{request_id}/reject":{"post":{"tags":["note-deletions"],"summary":"Reject Note Deletion","operationId":"reject_note_deletion_api_engagements__engagement_id__note_deletions__request_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_deletions___ReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-ar-content":{"get":{"tags":["note-ar-content"],"summary":"Get Note Ar Content","description":"The report's own version (pages, file) with the saved copy's\nblocks over it when the note has one.","operationId":"get_note_ar_content_api_engagements__engagement_id__note_ar_content_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"title":"Entry Key"}},{"name":"title","in":"query","required":false,"schema":{"type":"string","maxLength":400,"default":"","title":"Title"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["note-ar-content"],"summary":"Save Note Ar Content","operationId":"save_note_ar_content_api_engagements__engagement_id__note_ar_content_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SaveReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["note-ar-content"],"summary":"Reset Note Ar Content","operationId":"reset_note_ar_content_api_engagements__engagement_id__note_ar_content_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"title":"Entry Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-ar-content/batch":{"post":{"tags":["note-ar-content"],"summary":"Batch Note Ar Content","description":"Every asked note's report tables and text in one call (FS\nPreview; one call a note would pass the rate limit): the saved copy\nwhen the note has one, else the report's version.  A note with\nneither is left out.  The report is read once.","operationId":"batch_note_ar_content_api_engagements__engagement_id__note_ar_content_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_ar_content___BatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/nli-catalogue/template":{"get":{"tags":["tenant-catalogue"],"summary":"Download Catalogue Template","operationId":"download_catalogue_template_api_tenants__tenant_id__nli_catalogue_template_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/nli-catalogue/import":{"post":{"tags":["tenant-catalogue"],"summary":"Import Catalogue","operationId":"import_catalogue_api_tenants__tenant_id__nli_catalogue_import_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"partial","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Partial"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_catalogue_api_tenants__tenant_id__nli_catalogue_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Import Catalogue Api Tenants  Tenant Id  Nli Catalogue Import Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/signup-status":{"get":{"tags":["auth"],"summary":"Signup Status","description":"Public: whether anyone may register, or only invited people.","operationId":"signup_status_api_auth_signup_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Signup Status Api Auth Signup Status Get"}}}}}}},"/api/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","description":"CTO audit C8 (7 Aug 2026) · rotate the verification token +\nre-send the email for a signed-in user who never clicked the\noriginal link.\n\nIdempotent-safe: already-verified users get a friendly 200 with\n``already_verified=True`` instead of blowing up.  Rate-limited\non the auth bucket so a compromised token can't be brute-forced\ninto an inbox by re-triggering sends.","operationId":"resend_verification_api_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/verify-email":{"post":{"tags":["auth"],"summary":"Verify Email","description":"17 Jun 2026 (Wave 2 follow-up): email verification gate (A).\n\nConsumes the one-shot token sent at signup, stamps\n``email_verified_at`` on the user, and clears the token hash so\nthe link is single-use.  Returns 404 on a missing / mismatched\ntoken (don't leak whether the email exists), 200 with\n``already_verified=True`` if the user has already verified.","operationId":"verify_email_api_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailVerifyReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh Token","description":"Rotate a currently-valid JWT for a fresh one — same identity,\nfresh 24h TTL, revocation-list marker on the old jti.\n\nPrior state: 8-hour TTL punted long-running workflows to /login\nmid-edit (\"the app deletes my work\" ticket pattern from audit\nfinding C7).  This endpoint lets the FE proactively refresh the\ntoken every ~20h so a preparer can spend a full working day in\nthe tool without a forced re-auth.\n\nSecurity shape:\n  * ``current_user`` already validated the incoming token is\n    signed + not expired + not on the revocation list.\n  * The incoming ``mfa`` claim carries over — a refreshed token\n    preserves step-up MFA state without re-prompting.\n  * Old jti goes on the revocation list so a stolen bearer\n    token stops working the moment the legitimate client\n    refreshes.\n  * Rate-limited on the auth bucket so a compromised token\n    can't hammer /refresh to keep itself alive forever.","operationId":"refresh_token_api_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResp"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","operationId":"change_password_api_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/password-reset/request":{"post":{"tags":["auth"],"summary":"Password Reset Request","description":"Issue a password-reset link to the email on file.\n\nAlways returns 200 {\"ok\": True} so a caller cannot diff the\nresponse shape to learn whether the email exists.  Side-effects\n(token issuance + email send) happen only when the email matches\na real, verified user that hasn't requested a reset in the last\n60 s.","operationId":"password_reset_request_api_auth_password_reset_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequestReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password-reset/confirm":{"post":{"tags":["auth"],"summary":"Password Reset Confirm","description":"Consume the reset token and set a new password.\n\nHashes the supplied token, finds the matching user, verifies the\ntoken is unexpired + single-use, validates the new password's\ncomplexity, bcrypts + persists it, clears the reset state, and\nrevokes every active JWT for the user so a stolen token can't\noutlive the reset.\n\nReturns 400 with a generic message on any failure path — the\ncaller cannot tell from the response whether the token was\ninvalid vs expired vs the email never registered.","operationId":"password_reset_confirm_api_auth_password_reset_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirmReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"X-16 / B8.1: server-side logout via the revocation list.\n\nThe bearer token in the Authorization header is decoded, its jti\nis added to ``revoked_jwts``, and any further request with that\nsame token will 401.  Idempotent: logging out twice is a no-op.","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Me","description":"Identity + active-tenant context for the signed-in user.\n\nDay 2 of the modular launch (docs/MODULAR_LAUNCH_PLAN.md): the\nresponse now carries an ``active_tenant`` block exposing the\ntenant's ``tenant_mode`` and ``entitlements`` so the UI can branch\nrendering (advisory vs corporate) and grey-out modules the\nworkspace is not entitled to.  Active tenant resolution mirrors\n``_resolve_library_tenant_id``:\n\n  1. X-Tenant-Id header if the user belongs to that tenant\n  2. otherwise the most-recently-joined membership\n\nUsers with zero memberships get ``active_tenant=None`` (e.g. a\nfresh signup that has not yet created a workspace) — the UI\nhandles this as a first-run state.","operationId":"me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/mfa/enroll/start":{"post":{"tags":["auth"],"summary":"Mfa Enroll Start","description":"Generate a fresh TOTP secret, store it in encrypted form on the\nuser, and return both the plaintext (for QR rendering) and the\notpauth:// URI.  Enrolment isn't COMPLETE until the user round-\ntrips a valid 6-digit code via ``/api/auth/mfa/enroll/confirm``.\n\nX-19 audit fix: requires the password as a re-prove (defends\nagainst a stolen bearer token re-keying MFA).  If the user is\nalready enrolled, ALSO requires the current TOTP code so a\npassword-only attacker cannot rotate the authenticator out from\nunder the legitimate user.","operationId":"mfa_enroll_start_api_auth_mfa_enroll_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnrolStartReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnrolStartResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/mfa/enroll/confirm":{"post":{"tags":["auth"],"summary":"Mfa Enroll Confirm","description":"Verify the user-entered code against the still-pending secret.\nOn success ``totp_enrolled_at`` flips and MFA is live.","operationId":"mfa_enroll_confirm_api_auth_mfa_enroll_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaConfirmReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/mfa/disable":{"post":{"tags":["auth"],"summary":"Mfa Disable","description":"Disable MFA on the calling user's account.  Requires the\npassword as a re-prove (a stolen JWT alone cannot strip MFA).","operationId":"mfa_disable_api_auth_mfa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaDisableReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/auth/events":{"get":{"tags":["auth"],"summary":"List Auth Events","description":"Admin-only audit feed of authentication events.","operationId":"list_auth_events_api_auth_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","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"}}}}}}},"/api/tenants":{"get":{"tags":["tenants"],"summary":"List Tenants","description":"List the workspaces this user is a member of.\n\nAudit-H6 fix: this endpoint used to issue 1 + N queries — one to\nlist tenants, then a per-tenant ``count()`` to fetch engagement\ncounts.  On a workspace with hundreds of tenants that's hundreds\nof round-trips to Postgres.  We now do it in a single GROUP BY\nthat returns ``(Tenant, role, engagement_count)`` per row.","operationId":"list_tenants_api_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TenantOut"},"type":"array","title":"Response List Tenants Api Tenants Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["tenants"],"summary":"Create Tenant","operationId":"create_tenant_api_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreateReq"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","operationId":"get_tenant_api_tenants__tenant_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Tenant","description":"7 Jun 2026 — review v2 #1 follow-up.  Update top-level\nworkspace metadata (name / industry / country).\n\nRestricted to Owner or OrgAdmin via ``tenant.update`` capability.\nThe reviewer specifically asked for an in-tool rename so admins\ndon't need to ping engineering to fix a typo in the workspace\nname.","operationId":"update_tenant_api_tenants__tenant_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/data-processing-consent":{"post":{"tags":["tenants"],"summary":"Grant Consent","description":"Record explicit consent for cross-border AI processing.\n\nSprint 5 / B7 / DPDP Section 16: AI-augmented features ship prompts\nto api.anthropic.com (US/EU).  This endpoint captures the workspace\nOwner's authorisation to that transfer.  Without consent on file,\nthe LLM gateway refuses every outbound prompt.","operationId":"grant_consent_api_tenants__tenant_id__data_processing_consent_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Revoke Consent","description":"Revoke the master cross-border AI processing consent.  AI-\naugmented features will fall back to deterministic mode for this\nworkspace until consent is re-granted.  Note: revoking the master\nflag does NOT clear the per-purpose flags - the per-purpose\noverlay remains a strict additional gate, so it stays inert as\nlong as the master is off.","operationId":"revoke_consent_api_tenants__tenant_id__data_processing_consent_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/data-processing-consent/{purpose}":{"put":{"tags":["tenants"],"summary":"Grant Consent For Purpose","description":"X-15 / CFO C4: grant per-purpose consent.\n\n``purpose`` is one of: memo_drafting | mba_testing |\nevidence_augmentation.  Sets the matching timestamp column on\nthe tenant.  An LLM call requires BOTH master consent AND the\nmatching per-purpose flag to be set.\n\nMaster consent must already be on file - the per-purpose flag\nis meaningless without it.  Returns 409 otherwise.","operationId":"grant_consent_for_purpose_api_tenants__tenant_id__data_processing_consent__purpose__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"purpose","in":"path","required":true,"schema":{"type":"string","title":"Purpose"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Revoke Consent For Purpose","description":"X-15 / CFO C4: revoke per-purpose consent.  Master consent is\nuntouched.","operationId":"revoke_consent_for_purpose_api_tenants__tenant_id__data_processing_consent__purpose__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"purpose","in":"path","required":true,"schema":{"type":"string","title":"Purpose"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/members":{"get":{"tags":["tenants"],"summary":"List Tenant Members","description":"List every member of a workspace with their role.\n\nAny member of the workspace can call this; the dropdown of roles\non the front-end uses this to render the EQCR matrix (drafter /\nreviewer / approver) so users can see who is qualified to do\nwhat before assigning a memo for review.","operationId":"list_tenant_members_api_tenants__tenant_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantMemberOut"},"title":"Response List Tenant Members Api Tenants  Tenant Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Invite Tenant Member","description":"X-33: invite an email address to join a tenant at a role.\nRequires the inviter to hold ``tenant.invite_member`` (Owner /\nApprover / EngagementLead by default in rbac.ALLOWED_BY_ROLE).\nThe invitee accepts via the URL returned in the response.","operationId":"invite_tenant_member_api_tenants__tenant_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/members/{target_user_id}/role":{"patch":{"tags":["tenants"],"summary":"Change Tenant Member Role","description":"Change a workspace member's role.  Owner-only capability.\n\nGuardrails:\n- Role must be one of the six rbac.Role values.\n- You cannot demote the last Owner of a workspace (would leave it\n  orphaned with no one able to manage members).\n- You cannot change your own role (use a different Owner).\n- Audit-logged via AuthEvent.role_changed for non-repudiation.","operationId":"change_tenant_member_role_api_tenants__tenant_id__members__target_user_id__role_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"target_user_id","in":"path","required":true,"schema":{"type":"string","title":"Target User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleChangeReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/invitations":{"get":{"tags":["tenants"],"summary":"List Tenant Invitations","description":"List pending / past invitations for this workspace.  Tokens are\nNEVER returned — the inviter sees them only on the create response.","operationId":"list_tenant_invitations_api_tenants__tenant_id__invitations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvitationOut"},"title":"Response List Tenant Invitations Api Tenants  Tenant Id  Invitations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/invitations/{invitation_id}/link":{"post":{"tags":["tenants"],"summary":"Get Tenant Invitation Link","description":"The accept link of a pending invitation, for the inviter to send\nanother way (no email, or it never arrived).  The list never carries\nthe token; this returns it to the same people who may invite\n(tenant.invite_member) -- they could issue a fresh invite and see a\nlink anyway -- and logs who asked.  POST so it is never cached or\nprefetched (and, like every API response, sent no-store).","operationId":"get_tenant_invitation_link_api_tenants__tenant_id__invitations__invitation_id__link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationLinkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/invitations/{invitation_id}":{"patch":{"tags":["tenants"],"summary":"Update Tenant Invitation Expiry","description":"14 Jun 2026 (bug-fix): owner-driven expiry edit on a PENDING\ninvitation.  Accepts either an absolute ``expires_at`` (ISO\ntimestamp) or a relative ``expires_in_days`` from now; same\nclamp rules as create.  Re-sends the invitation email so the\ninvitee sees the new expiry.  Refuses to touch invitations that\nhave already been accepted or revoked — promote / re-invite\ninstead.","operationId":"update_tenant_invitation_expiry_api_tenants__tenant_id__invitations__invitation_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationExpiryUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Revoke Tenant Invitation","description":"Revoke an outstanding invitation.  Idempotent — already-revoked\nor already-accepted invites return 204 without re-state-flipping.","operationId":"revoke_tenant_invitation_api_tenants__tenant_id__invitations__invitation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/{token}":{"get":{"tags":["tenants"],"summary":"Preview Invitation","description":"Public preview — no auth required.  Used by the /invitations/:token\nlanding page to show the invitee what they're being asked to accept\nBEFORE they sign in.  Returns 404 on unknown tokens so we don't\nleak the existence/state of arbitrary tokens.","operationId":"preview_invitation_api_invitations__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/invitations":{"get":{"tags":["tenants"],"summary":"List My Invitations","description":"List PENDING invitations addressed to the signed-in user.\n\n14 Jun 2026 (PV2 bug-report): the invitee had no way to discover\na pending invitation from inside the app — the owner had to\nmanually copy + share the accept URL out-of-band (no email\ndelivery exists today).  When the share failed, the invitee\nlanded on TenantsPage, saw \"No workspaces yet\", and got 403\n\"workflow errors\" on every tenant-scoped route.\n\nThis endpoint lets the invitee self-serve: returns every\ninvitation matching their email that is neither revoked nor\naccepted, with the accept token + URL embedded so the UI can\none-click accept.  Strictly scoped to the signed-in user's\nemail (case-insensitive); no other user's pending tokens are\nvisible.","operationId":"list_my_invitations_api_me_invitations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MyInvitationOut"},"type":"array","title":"Response List My Invitations Api Me Invitations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/invitations/{token}/accept":{"post":{"tags":["tenants"],"summary":"Accept Invitation","description":"Accept the invitation tied to ``token``.  Caller must be\nlogged in AND their email must match the invitation's email\n(case-insensitive).  On success a tenant_members row is created\nand the invitation is marked accepted.","operationId":"accept_invitation_api_invitations__token__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reference-data":{"get":{"tags":["catalogues"],"summary":"Get Reference Data","description":"Return the controlled vocabularies the engagement / client\ncreation forms consume.  Authenticated to keep the surface\nprivate - the values are not secret but the endpoint is part of\nthe firm-internal app shell.","operationId":"get_reference_data_api_reference_data_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/erp-templates":{"get":{"tags":["catalogues"],"summary":"List Erp Templates","description":"Return all packaged ERP mapping templates with summary counts.\n\nNo engagement scope - any logged-in user can list the templates.","operationId":"list_erp_templates_api_erp_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/erp-templates/{template_id}":{"get":{"tags":["catalogues"],"summary":"Get Erp Template","description":"Return one template's full rule list (for inspection in the UI\nbefore applying).  Unknown id -> the generic template.","operationId":"get_erp_template_api_erp_templates__template_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/materiality/guidance":{"get":{"tags":["catalogues"],"summary":"Get Materiality Guidance","description":"Sprint 87 (g): static guidance ranges per benchmark + the\ncanonical 60-90% range for performance materiality and the\n5%/10% choices for clearly-trivial.  Surfaced as helper text\nin the wizard.","operationId":"get_materiality_guidance_api_materiality_guidance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/kb/sources":{"get":{"tags":["catalogues"],"summary":"List Kb Sources","operationId":"list_kb_sources_api_kb_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/KBSourceOut"},"type":"array","title":"Response List Kb Sources Api Kb Sources Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/kb/chunks":{"get":{"tags":["catalogues"],"summary":"Search Kb Chunks","description":"Sprint 2.A retrieval (deterministic; embeddings come Sprint 3).\n\nAll filters are AND-combined.  `q` is a case-insensitive substring\nmatch against text (use sparingly; on 1000s of chunks it's cheap\nenough).  `paragraph_ref` accepts partial prefixes (e.g. 'B' or\n'C').","operationId":"search_kb_chunks_api_kb_chunks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"paragraph_ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Ref"}},{"name":"topic","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"}},{"name":"publisher","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publisher"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KBChunkOut"},"title":"Response Search Kb Chunks Api Kb Chunks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/chunks/{chunk_id}":{"get":{"tags":["catalogues"],"summary":"Get Kb Chunk","operationId":"get_kb_chunk_api_kb_chunks__chunk_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chunk_id","in":"path","required":true,"schema":{"type":"string","title":"Chunk Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBChunkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/standards-sources":{"get":{"tags":["catalogues"],"summary":"List Standards Sources","description":"X-58 Sprint 20: list every KB source the caller can search.\n\nBacks the Standards Library page's filter sidebar — publisher\nchips, jurisdiction chips, per-source row with chunk count.\nHonours the same admin-only gate as /api/ai/ask:\nnon-admins see only public-publisher + verbatim sources.","operationId":"list_standards_sources_api_ai_standards_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardsSourcesResp"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/ai/standards-suggested-questions":{"get":{"tags":["catalogues"],"summary":"Standards Suggested Questions","description":"X-58 Sprint 20: curated starter questions for the Standards\nLibrary page.  These are the questions Big-4 reviewers ask most\noften when getting up to speed on IFRS 18 / Ind AS 118.","operationId":"standards_suggested_questions_api_ai_standards_suggested_questions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Standards Suggested Questions Api Ai Standards Suggested Questions Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/technical-committee":{"get":{"tags":["catalogues"],"summary":"List Technical Committee","operationId":"list_technical_committee_api_technical_committee_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TCMemberOut"},"type":"array","title":"Response List Technical Committee Api Technical Committee Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/nli/big4-refs":{"get":{"tags":["catalogues"],"summary":"List Big4 Ifs Refs","description":"Return { nli_code: { publisher: ref } } for every NLI carrying\na curated Big-4 IFS reference.  Publisher keys are lowercase\n(\"ey\" | \"pwc\" | \"deloitte\" | \"kpmg\").  Sparse — only rows with at\nleast one ref appear.","operationId":"list_big4_ifs_refs_api_nli_big4_refs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object","title":"Response List Big4 Ifs Refs Api Nli Big4 Refs Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/llm-augmentation-report":{"get":{"tags":["admin"],"summary":"Llm Augmentation Report","description":"Admin-only daily report of LLM augmentation activity.\n\nWindow default: last 24 hours.  Cap to 90 days to keep the\naggregation cheap.\n\nReturns three layers:\n  * `totals`   - call count, token totals, estimated cost,\n                 engagements touched, engagements at budget cap\n  * `outcomes` - count by `outcome` field on llm_invocation_log\n                 (ok / refused_no_consent / error)\n  * `fields_filled` / `fields_skipped` - count by field name\n                 across all engagements with augmentation in\n                 the window\n  * `engagements_at_budget_cap` - per-engagement detail rows\n                 where spent >= 95% of allocated budget\n  * `by_engagement` - per-engagement summary for every\n                 engagement that recorded an augmentation in\n                 the window","operationId":"llm_augmentation_report_api_admin_llm_augmentation_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants":{"get":{"tags":["admin"],"summary":"Admin List Tenants","description":"Tool-owner view: every workspace in the system.\n\nSidebar's /api/tenants intentionally hides workspaces the user is\nnot a member of (tenant-isolation).  This admin endpoint returns\nEVERY tenant so the Tool Owner can see new signups, audit adoption,\nand support customers who didn't add them as a member.","operationId":"admin_list_tenants_api_admin_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AdminTenantRow"},"type":"array","title":"Response Admin List Tenants Api Admin Tenants Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/tenants/{tenant_id}/entitlements":{"put":{"tags":["admin"],"summary":"Update Tenant Entitlements","description":"3 Sep 2026 (IND-50) — the operator can change a plan.\n\nEntitlements were set at signup and then frozen: ``update_tenant``\ncovers name / industry / country only, and nothing else wrote the\ncolumn.  So the soft-paywall panel told a blocked workspace to\n\"contact your account owner or the GMC PRISM team\" while the GMC\nPRISM team had no endpoint to act with — every upgrade was a\ndatabase console session.  Found when the operator's own firm\nworkspace (FSNM & Co) turned out to lack the consolidation module\nand there was no in-product way to grant it.\n\nPlatform-admin only, same guard as every endpoint in this router.\nThe list replaces wholesale — a plan is a statement of what the\ntenant has, not a diff — and every change writes an AuthEvent with\nbefore and after.","operationId":"update_tenant_entitlements_api_admin_tenants__tenant_id__entitlements_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}":{"delete":{"tags":["admin"],"summary":"Admin Delete Tenant","operationId":"admin_delete_tenant_api_admin_tenants__tenant_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users":{"get":{"tags":["admin"],"summary":"Admin List Users","description":"Tool-owner view: every signed-up user.","operationId":"admin_list_users_api_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AdminUserRow"},"type":"array","title":"Response Admin List Users Api Admin Users Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/users/{user_id}/password-reset-link":{"post":{"tags":["admin"],"summary":"Admin Issue Password Reset Link","description":"Issue the same single-use, 15-minute reset token the reset email\ncarries (only its SHA-256 is stored) and return the link for the\nadmin to pass on.  It replaces any earlier unused token.  Whoever\nholds the link can set the password, so: platform admins only, an\nactive account only, and every issue is in the auth-event log (the\ntoken itself never is).","operationId":"admin_issue_password_reset_link_api_admin_users__user_id__password_reset_link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminResetLinkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/verify-email":{"post":{"tags":["admin"],"summary":"Admin Mark Email Verified","description":"Record the user's address as verified -- for when the verification\nemail cannot be delivered and the admin has confirmed the address\nanother way.  Idempotent; logged.","operationId":"admin_mark_email_verified_api_admin_users__user_id__verify_email_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}":{"put":{"tags":["admin"],"summary":"Admin Update User","operationId":"admin_update_user_api_admin_users__user_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Admin Delete User","operationId":"admin_delete_user_api_admin_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/entities":{"get":{"tags":["admin"],"summary":"Admin List Entities","description":"Tool-owner view: every entity (legal company) across every workspace.\n\nExcludes soft-deleted (deleted_at IS NOT NULL) rows since they're\nnot a useful adoption signal.","operationId":"admin_list_entities_api_admin_entities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AdminEntityRow"},"type":"array","title":"Response Admin List Entities Api Admin Entities Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/engagements":{"get":{"tags":["admin"],"summary":"Admin List Engagements","description":"Tool-owner view: every engagement across every workspace.\nSource-of-truth for the AdminCockpit \"Engagements\" tab where the\nClone-to-workspace action lives.  Soft-deleted rows excluded.","operationId":"admin_list_engagements_api_admin_engagements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AdminEngagementRow"},"type":"array","title":"Response Admin List Engagements Api Admin Engagements Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/engagements/{source_engagement_id}/clone-to-tenant":{"post":{"tags":["admin"],"summary":"Admin Clone Engagement To Tenant","description":"Clone an engagement into another tenant — TB uploads + mapping\noverrides only.  Admin-only.  Uploads are duplicated as new rows\npointing at the same R2 stored_path (zero file copy in object\nstorage).","operationId":"admin_clone_engagement_to_tenant_api_admin_engagements__source_engagement_id__clone_to_tenant_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"source_engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Source Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCloneEngagementReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCloneEngagementResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/engagements/{engagement_id}/enable-preview-tier":{"post":{"tags":["admin"],"summary":"Admin Enable Preview Tier For Engagement","description":"Flip the owning tenant of `engagement_id` to experience_tier\n='preview' so every Sprint 1-5 feature flag defaults ON for\nits users.  Admin-only.  Refused on protected demo workspaces.","operationId":"admin_enable_preview_tier_for_engagement_api_admin_engagements__engagement_id__enable_preview_tier_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnablePreviewResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ai-settings":{"get":{"tags":["admin"],"summary":"Get Ai Settings","operationId":"get_ai_settings_api_admin_ai_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AISettingsOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin"],"summary":"Put Ai Settings","operationId":"put_ai_settings_api_admin_ai_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AISettingsReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AISettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/ai-settings/test":{"post":{"tags":["admin"],"summary":"Test Ai Settings","operationId":"test_ai_settings_api_admin_ai_settings_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/tenants/{tenant_id}/anthropic-key":{"put":{"tags":["admin"],"summary":"Set Tenant Anthropic Key","description":"This firm's own Anthropic key (Owner / Org admin), used instead of\nthe global key while no provider override is set.","operationId":"set_tenant_anthropic_key_api_tenants__tenant_id__anthropic_key_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicKeyReq"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete Tenant Anthropic Key","operationId":"delete_tenant_anthropic_key_api_tenants__tenant_id__anthropic_key_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/llm-config":{"get":{"tags":["admin"],"summary":"Get Tenant Llm Config","description":"The firm's override, masked (no key, no role ARN).","operationId":"get_tenant_llm_config_api_tenants__tenant_id__llm_config_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Put Tenant Llm Config","description":"Set the firm's provider + model; provider=null reverts to the\nglobal AI Settings.","operationId":"put_tenant_llm_config_api_tenants__tenant_id__llm_config_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMConfigReq"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/llm-credentials":{"put":{"tags":["admin"],"summary":"Put Tenant Llm Credentials","description":"Encrypted credentials for the firm's provider: ``api_key`` for\nAnthropic / OpenAI, ``bedrock_config`` (region, role_arn,\nguardrail_id, guardrail_version) for Bedrock in the firm's own AWS\naccount.","operationId":"put_tenant_llm_credentials_api_tenants__tenant_id__llm_credentials_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMCredentialsReq"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete Tenant Llm Credentials","operationId":"delete_tenant_llm_credentials_api_tenants__tenant_id__llm_credentials_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/llm-config":{"get":{"tags":["admin"],"summary":"Get Global Llm Config","operationId":"get_global_llm_config_api_admin_llm_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalLLMConfigOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin"],"summary":"Put Global Llm Config","operationId":"put_global_llm_config_api_admin_llm_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalLLMConfigReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalLLMConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/kb/reingest":{"post":{"tags":["admin"],"summary":"Admin Kb Reingest","description":"Re-run KB ingestion against the bundled source-pdfs/ directory.\n\nThe verbatim path is free (no LLM cost) and runs against any IASB /\nICAI / EFRAG PDFs shipped inside the Docker image.\n\nThe summary path uses the LLM to produce GMC-authored paraphrases of\nBig-4 / mid-tier guidance.  Big-4 PDFs are NOT bundled in the image\n(copyright); the operator must place them under the persist volume's\n``data/source-pdfs/`` before calling with ``include_summaries=true``.\nToken cost is roughly $0.50-$2.00 per full run depending on page\ncounts.\n\nAdmin-only.  Idempotent: re-ingesting an already-loaded source is a\nno-op (de-dupe by file_sha256 + content_hash).","operationId":"admin_kb_reingest_api_admin_kb_reingest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"include_summaries","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Summaries"}},{"name":"summary_limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Summary Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBReingestResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/plan":{"post":{"tags":["admin"],"summary":"Admin Set Tenant Plan","operationId":"admin_set_tenant_plan_api_admin_tenants__tenant_id__plan_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTenantRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit-settings":{"get":{"tags":["admin"],"summary":"Get Audit Settings","operationId":"get_audit_settings_api_admin_audit_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSettingsOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin"],"summary":"Put Audit Settings","operationId":"put_audit_settings_api_admin_audit_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSettingsReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/audit-settings/countries/{country}":{"put":{"tags":["admin"],"summary":"Put Country Audit Settings","description":"Set (or clear, with null) the default retention window for\ntenants incorporated in ``country`` (ISO code, e.g. 'IN'/'US'/'DE')\n-- the middle tier between a tenant's own override and the\nplatform-wide fallback. See api/audit_retention.py.","operationId":"put_country_audit_settings_api_admin_audit_settings_countries__country__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryAuditSettingsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/audit-settings":{"get":{"tags":["admin"],"summary":"Get Tenant Audit Settings","operationId":"get_tenant_audit_settings_api_admin_tenants__tenant_id__audit_settings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAuditSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Put Tenant Audit Settings","description":"Set (or clear, with null) this tenant's retention OVERRIDE.\nPlatform-admin only -- deliberately not reachable via the ordinary\ntenant.update capability a workspace's own OrgAdmin holds.","operationId":"put_tenant_audit_settings_api_admin_tenants__tenant_id__audit_settings_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAuditSettingsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAuditSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit-export":{"post":{"tags":["admin"],"summary":"Admin Audit Export","description":"Platform-admin export of any/all tenants' audit trail --\ncompliance / security-incident / regulator handover. Self-service\nexport of a single tenant's own trail is\nPOST /api/tenants/{tenant_id}/audit-export instead.","operationId":"admin_audit_export_api_admin_audit_export_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditExportReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/export-settings":{"get":{"tags":["admin"],"summary":"Get Export Settings","operationId":"get_export_settings_api_admin_export_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettingsOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin"],"summary":"Put Export Settings","operationId":"put_export_settings_api_admin_export_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettingsReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/export-settings/countries/{country}":{"put":{"tags":["admin"],"summary":"Put Country Export Settings","operationId":"put_country_export_settings_api_admin_export_settings_countries__country__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountryExportSettingsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/export-settings":{"get":{"tags":["admin"],"summary":"Get Tenant Export Settings","operationId":"get_tenant_export_settings_api_admin_tenants__tenant_id__export_settings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantExportSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Put Tenant Export Settings","description":"Set (or clear, with null) this tenant's export-TTL OVERRIDE.\nPlatform-admin only, same rationale as audit-settings.","operationId":"put_tenant_export_settings_api_admin_tenants__tenant_id__export_settings_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantExportSettingsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantExportSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/organisations":{"post":{"tags":["admin"],"summary":"Onboard Organisation","description":"Create an organisation or advisory firm and invite its owner.\n\nThe owner follows the emailed link, creates an account on it (open\nsignup is closed) and becomes the workspace's Owner.  The link is\nalso returned, for the admin to pass on if email is not delivered.","operationId":"onboard_organisation_api_admin_organisations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationOnboardReq"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganisationOnboardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/erp-connections":{"get":{"tags":["erp"],"summary":"List Erp Connections","description":"Sprint 78: list live-pull ERP connections (separate namespace\nfrom the legacy /erp-connectors path which is owned by the older\nTally connector framework).","operationId":"list_erp_connections_api_engagements__engagement_id__erp_connections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connections/zoho-books":{"post":{"tags":["erp"],"summary":"Upsert Zoho Connector","description":"Upsert a Zoho Books connector for this engagement.  The\nauth-token paste is encrypted with the install's master key.\n\nRe-POSTing the same payload rotates the token (useful when the\ncustomer regenerates it in Zoho's API console).","operationId":"upsert_zoho_connector_api_engagements__engagement_id__erp_connections_zoho_books_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoConnectionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoConnectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["erp"],"summary":"Disconnect Zoho","description":"Soft-delete the engagement's Zoho Books connector.  Token is\noverwritten with an empty bytestring before the row is marked\ndeleted so even a DB dump no longer carries the secret.","operationId":"disconnect_zoho_api_engagements__engagement_id__erp_connections_zoho_books_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connections/zoho-books/test":{"post":{"tags":["erp"],"summary":"Test Zoho Connector","description":"Issue a /organizations ping with the stored credentials.\nReturns ``{\"ok\": true}`` when the token resolves to the\nconfigured organisation, ``{\"ok\": false, \"error\": \"...\"}`` otherwise.","operationId":"test_zoho_connector_api_engagements__engagement_id__erp_connections_zoho_books_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connections/zoho-books/pull":{"post":{"tags":["erp"],"summary":"Pull Zoho Trial Balance","description":"Live-pull a TB from Zoho Books and persist it as an Upload row\ntagged with the requested period_label.  After the upload lands,\nthe existing /fs/balance-sheet endpoint picks it up unchanged.","operationId":"pull_zoho_trial_balance_api_engagements__engagement_id__erp_connections_zoho_books_pull_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoPullReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/quality/mapping-review":{"get":{"tags":["quality"],"summary":"Get Quality Mapping Review","description":"Paginated list of mapping rows for the Quality & Review tab,\nwith aggregate counts in ONE response (no N+1 chip queries).\nDefault sort: accepted_by_ai DESC, ai_confidence ASC — surfaces\nthe riskiest AI calls first per partner concern E from Sprint 1.","operationId":"get_quality_mapping_review_api_engagements__engagement_id__quality_mapping_review_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Filter"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingReviewResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/dqs":{"get":{"tags":["quality"],"summary":"Get Engagement Dqs","description":"X-58 Sprint 23: Disclosure Quality Score.\n\nScores the engagement against the Schedule III 2021 + IFRS 18 /\nInd AS 118 disclosure checklists.  Returns a 0-100 overall +\nper-category breakdown.\n\nPulls live state from every Sprint-15-onwards table — MPM items,\ngroup structure, translation rates, accounting policy library,\nattestation method, materiality JSON.","operationId":"get_engagement_dqs_api_engagements__engagement_id__dqs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"standalone","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DqsReportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/anomalies":{"get":{"tags":["quality"],"summary":"List Engagement Anomalies","description":"X-58 Sprint 21: list every flagged TB anomaly.\n\nRules (all explainable in one sentence to an EQCR reviewer):\n  * YoY movement > materiality / > 50% on a non-trivial base\n  * Sign-flip between periods\n  * New / disappeared accounts > clearly trivial\n  * Negative asset closing / positive liability closing\n  * Single account > 90% of a face head (catch-all detector)\n\nMateriality is read from the engagement's persisted materiality\nJSON; falls back to revenue × 0.5% when absent.","operationId":"list_engagement_anomalies_api_engagements__engagement_id__anomalies_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomaliesResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/anomalies/{anomaly_key}":{"put":{"tags":["quality"],"summary":"Upsert Anomaly Resolution","description":"Phase 3 Item 25: upsert explanation + resolved flag for one\nanomaly.  Identifier is the stable ``anomaly_key`` returned by\nthe list endpoint (SHA-256 of statement|face_head_code|kind).\n\nIdempotent - calling with the same key updates the row; first\ncall creates it.  Returns the augmented anomaly so the UI can\nre-render without a full refresh.","operationId":"upsert_anomaly_resolution_api_engagements__engagement_id__anomalies__anomaly_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"anomaly_key","in":"path","required":true,"schema":{"type":"string","title":"Anomaly Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalyResolutionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/quality/mapping-flags":{"get":{"tags":["quality"],"summary":"Get Quality Mapping Flags","description":"Mapping findings for this engagement, with any annotations.\n\n``include_accepted`` defaults to False so the panel shows what\nstill needs attention.  An accepted finding is not deleted — the\nreason is the audit trail — it simply stops shouting.","operationId":"get_quality_mapping_flags_api_engagements__engagement_id__quality_mapping_flags_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"include_accepted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Accepted"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Quality Mapping Flags Api Engagements  Engagement Id  Quality Mapping Flags Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/quality/mapping-flags/{finding_key}":{"put":{"tags":["quality"],"summary":"Put Quality Mapping Flag","description":"Accept a mapping finding, with a reason.\n\nThe reason is required to accept.  A one-click dismiss with no\nexplanation would leave a signed pack carrying a mapping somebody\nwaved through and no record of why — which is the state this whole\nsurface exists to end.  Un-accepting needs no reason: putting a\nfinding back on the list is not a claim about anything.","operationId":"put_quality_mapping_flag_api_engagements__engagement_id__quality_mapping_flags__finding_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"finding_key","in":"path","required":true,"schema":{"type":"string","title":"Finding Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingFlagAcceptReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Quality Mapping Flag Api Engagements  Engagement Id  Quality Mapping Flags  Finding Key  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/quality/language":{"get":{"tags":["quality"],"summary":"Get Quality Language","description":"Mechanical and house-style findings across the pack narrative.\n\nReads the engagement-owned note narrative, which is the text a\npreparer actually authored or accepted from an AR extract.  The\ngenerated policy bodies are deliberately NOT included: they are\nproduced by this codebase, they are covered by their own tests,\nand a preparer cannot act on a finding against text they did not\nwrite.\n\nHouse-style checks run across the whole pack rather than per note,\nbecause consistency is the one property no single note can show —\na pack whose notes each use a different dash style has no note\nthat looks wrong on its own.\n\nThis reports.  It does not gate.  A pack does not become\nunsignable because a note mixes quotation marks.","operationId":"get_quality_language_api_engagements__engagement_id__quality_language_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Quality Language Api Engagements  Engagement Id  Quality Language Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/catalogue-gaps":{"get":{"tags":["catalogue-gaps"],"summary":"List Catalogue Gaps","description":"List catalogue gaps for the admin queue.  Default returns only\nopen gaps (the actionable subset) sorted hit-count desc so the\nmost painful misses surface first.","operationId":"list_catalogue_gaps_api_catalogue_gaps_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Status Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CatalogueGapOut"},"title":"Response List Catalogue Gaps Api Catalogue Gaps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/catalogue-gaps/{gap_id}/dismiss":{"patch":{"tags":["catalogue-gaps"],"summary":"Dismiss Catalogue Gap","description":"Mark a gap dismissed with a rationale — won't show on the\n'open' queue.  Re-opens automatically on subsequent misses only\nif the admin chooses to surface dismissed entries via\n?status_filter=dismissed.","operationId":"dismiss_catalogue_gap_api_catalogue_gaps__gap_id__dismiss_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"gap_id","in":"path","required":true,"schema":{"type":"string","title":"Gap Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueGapDismissReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueGapOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/catalogue-gaps/{gap_id}/resolve":{"post":{"tags":["catalogue-gaps"],"summary":"Resolve Catalogue Gap","description":"Phase 3 — append a new NLI row to the v7 catalogue JSON, clear\nthe in-process catalogue cache (eager activation), mark the gap\nresolved, and audit-log the change.\n\nThe catalogue file ``data/v7/nli_catalogue.json`` is mutated on\ndisk so the change persists across worker restarts.  We do NOT\nwrite a per-tenant overlay — this is the global catalogue path\n(option A).","operationId":"resolve_catalogue_gap_api_catalogue_gaps__gap_id__resolve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"gap_id","in":"path","required":true,"schema":{"type":"string","title":"Gap Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueAddNliReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueGapOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm":{"get":{"tags":["mpm"],"summary":"List Mpm","description":"List MPMs the entity uses externally on this engagement.","operationId":"list_mpm_api_engagements__engagement_id__mpm_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MpmOut"},"title":"Response List Mpm Api Engagements  Engagement Id  Mpm Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["mpm"],"summary":"Create Mpm","description":"Create a new MPM inventory entry on this engagement.","operationId":"create_mpm_api_engagements__engagement_id__mpm_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm/{mpm_id}":{"patch":{"tags":["mpm"],"summary":"Update Mpm","operationId":"update_mpm_api_engagements__engagement_id__mpm__mpm_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"mpm_id","in":"path","required":true,"schema":{"type":"string","title":"Mpm Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["mpm"],"summary":"Delete Mpm","description":"Soft-delete: marks deleted_at; row remains for audit trail.","operationId":"delete_mpm_api_engagements__engagement_id__mpm__mpm_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"mpm_id","in":"path","required":true,"schema":{"type":"string","title":"Mpm Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm/rescan":{"post":{"tags":["mpm"],"summary":"Rescan Mpm Inventory","description":"30 Jun 2026 — re-scan the engagement's AR + Investor Comms\nuploads and rebuild the MPM inventory using the wizard-gated seed\nloop.  Hard-deletes pre-existing MpmItem rows on this engagement\nso the rebuild produces a clean slate (this is the cleanup hook\nthe owner asked for after the ADPG hallucination incident — five\nfabricated MPMs that were seeded under the pre-0066 boilerplate\npath).\n\nDistinct from POST /api/engagements/{id}/mpm/detect-from-ar:\n  * detect-from-ar uses the LLM to PROPOSE rows for user review\n    (nothing persisted).\n  * rescan uses the deterministic substring scanner + wizard to\n    DIRECTLY persist MpmItem rows with status / verdict / reason.","operationId":"rescan_mpm_inventory_api_engagements__engagement_id__mpm_rescan_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmRescanResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm/detect-from-ar":{"post":{"tags":["mpm"],"summary":"Detect Mpms From Ar","description":"Scan the engagement's most-recent AR uploads for MPM\ndisclosures.  Uses the existing llm_client gateway with full ZDR /\nconsent / audit-log enforcement.  Returns proposals only - nothing\nis persisted to MpmItem until the user explicitly accepts.\n\nThe prompt asks for:\n  * NAME (e.g. \"Adjusted EBITDA\", \"Core operating profit\")\n  * COMPARABLE IFRS subtotal (must map to one of: Revenue, Gross\n    profit, Operating profit, Profit before tax, Profit for the\n    period)\n  * DEFINITION (one-sentence paraphrase, NOT verbatim)\n  * AR PAGE where the MPM is first disclosed\n  * QUOTE_EXCERPT (<=100 chars from the AR for citation)\n  * CONFIDENCE (0..1)\n\nJSON-only response; we parse and dedupe before returning.","operationId":"detect_mpms_from_ar_api_engagements__engagement_id__mpm_detect_from_ar_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmDetectResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm/{mpm_id}/reconciliation":{"get":{"tags":["mpm"],"summary":"Get Mpm Reconciliation","description":"Compute the IFRS-subtotal -> MPM reconciliation against the\ncurrent TB.  Walks the engagement's TrialBalance uploads, runs\nthe categoriser to find the comparable IFRS subtotal value, then\nwalks the saved adjustment rules to produce per-row gross + tax\n+ NCI effects.\n\nIdempotent + read-only: nothing is persisted.  Re-call any time\na TB or rule changes.","operationId":"get_mpm_reconciliation_api_engagements__engagement_id__mpm__mpm_id__reconciliation_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"mpm_id","in":"path","required":true,"schema":{"type":"string","title":"Mpm Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mpm/regenerate-memo":{"post":{"tags":["mpm"],"summary":"Regenerate Mpm Memo","description":"8 Jun 2026 — retro-apply MPM Knowledge Base v2.0 intelligence\nto an existing engagement's T2 (MPM Identification, Disclosure and\nReconciliation) memo without re-running the full pipeline.\n\nWhat this does:\n  1. Rebuilds the T2 memo via `m5_memo._memo_mpm()` using the\n     engagement's CURRENT MpmItem inventory as the identified-MPMs\n     seed (so the memo reflects everything the preparer has\n     accepted, not just the original AR scan).\n  2. The rebuild walks each MPM through `apply_decision_tree()`\n     + `classify_against_benchmark()` and surfaces sector-typical\n     MPMs the AR scan may have missed (KB v2.0 helpers added in\n     commit 104224a).\n  3. Updates the existing MemoRecord row (template =\n     MPM_IDENTIFICATION) with the new Memo body — preserving\n     workflow_status, assignments, and the audit chain on the\n     row itself.\n  4. The preparer can then click 'Regenerate Deliverables' (the\n     existing endpoint) to materialise the new memo into a fresh\n     Technical_Memos_revN.docx.\n\nIdempotent: re-call to pull in further KB updates.  Audit-logged\nvia AuthEvent so the rebuild is non-repudiable.","operationId":"regenerate_mpm_memo_api_engagements__engagement_id__mpm_regenerate_memo_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mpm/knowledge-base":{"get":{"tags":["mpm"],"summary":"Get Mpm Knowledge Base","description":"Return the structured IFRS 18 MPM knowledge base (definition,\n3-prong test, ¶118 exclusions, decision tree, disclosure\nrequirements, rebuttal evidence, industry typical-MPM table,\nbibliography).  Public — consumed by the MPM page + Decision\nWizard + memo template.","operationId":"get_mpm_knowledge_base_api_mpm_knowledge_base_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/mpm/benchmark-catalogue":{"get":{"tags":["mpm"],"summary":"Get Mpm Benchmark Catalogue","description":"Return the sector eligibility table (cross-industry MPM rules)\n+ curated real-issuer MPM observations.  Used internally by the\nMPM Declaration wizard for typical-pattern lookup.","operationId":"get_mpm_benchmark_catalogue_api_mpm_benchmark_catalogue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/mpm/industry-suggestions":{"get":{"tags":["mpm"],"summary":"Get Mpm Industry Suggestions","description":"Return typical MPMs + recommended comparable IFRS subtotal for\nthe given industry, merged from the KB industry table (11\nindustries: Pharma, Oil & Gas, Mining, Banking, FMCG, Auto, Tech,\nIT Services, Insurance, Real Estate, Telecom, Consumer/Retail)\nAND the benchmark sector eligibility rows.\n\nReturns ``{}`` when industry is unknown.","operationId":"get_mpm_industry_suggestions_api_mpm_industry_suggestions_get","parameters":[{"name":"industry","in":"query","required":true,"schema":{"type":"string","title":"Industry"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mpm/entity-observations/{entity_key}":{"get":{"tags":["mpm"],"summary":"Get Mpm Entity Observations","description":"Return curated MPM observations for a known listed issuer\n(TATAMOTORS, HDFCBANK, ADANIENT, AVIVA, RELX, GLENCORE, RIOTINTO,\nASTRAZENECA, PERSIMMON).  Empty list when entity isn't in the\nbenchmark catalogue.","operationId":"get_mpm_entity_observations_api_mpm_entity_observations__entity_key__get","parameters":[{"name":"entity_key","in":"path","required":true,"schema":{"type":"string","title":"Entity Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mpm/classify":{"post":{"tags":["mpm"],"summary":"Classify Mpm Candidate","description":"Walk IFRS 18's 5-step MPM decision tree on a candidate subtotal\nand return the verdict + step-by-step trace (Decision Wizard\nTab 1 output).  Also surfaces:\n  * benchmark-catalogue match (if any) — sector-typical\n    classification + source citation\n  * ¶118 exclusion check — true when the label looks like a\n    listed-excluded subtotal regardless of other prongs.\nPublic — no engagement scope required.","operationId":"classify_mpm_candidate_api_mpm_classify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MpmClassifyReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/note-skeletons":{"get":{"tags":["library"],"summary":"List Note Skeletons","description":"Phase 3 Item 17 + Phase 4 follow-up: surface the canonical\nnote-format library the FS-pack generator uses, optionally with\nan industry-specific overlay merged in.\n\nReviewer asked (Phase 3): \"Notes to follow the relevant Ind AS\nor IFRS presentation view.  You have so many annual reports in\nthe tool, pick the presentation and disclosures from relevant\nannual reports and update the knowledge base for formats of the\nnotes.\"\n\nPhase 4 extension: the canonical KB covers the standard Sch III\nDiv II + Div III note set.  ``?industry=`` overlays additional\nindustry-specific notes drawn from FY24 / FY25 annual reports of\nlisted players in five priority industries: Manufacturing, NBFC,\nIT Services, Pharma, Telecom.  The merge rule appends industry\nrow classes to canonical notes (e.g. Pharma adds APIs / DMF\ninventory rows) and adds entirely new notes (e.g. Telecom's NT\nSpectrum, NBFC's NT ECL_Allowance) that the base library\ndoesn't cover.\n\nIndustry codes are case-insensitive and tolerant of common\nspellings: Manufacturing / NBFC / IT Services / Pharma / Telecom.","operationId":"list_note_skeletons_api_library_note_skeletons_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/accounting-policies/topics":{"get":{"tags":["library"],"summary":"List Acc Policy Topics","operationId":"list_acc_policy_topics_api_library_accounting_policies_topics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AccPolicyTopicOut"},"type":"array","title":"Response List Acc Policy Topics Api Library Accounting Policies Topics Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["library"],"summary":"Create Acc Policy Topic","operationId":"create_acc_policy_topic_api_library_accounting_policies_topics_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyTopicCreateReq"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyTopicOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/library/accounting-policies/topics/{topic_id}/variants":{"get":{"tags":["library"],"summary":"List Acc Policy Variants","operationId":"list_acc_policy_variants_api_library_accounting_policies_topics__topic_id__variants_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccPolicyVariantOut"},"title":"Response List Acc Policy Variants Api Library Accounting Policies Topics  Topic Id  Variants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["library"],"summary":"Create Acc Policy Variant","operationId":"create_acc_policy_variant_api_library_accounting_policies_topics__topic_id__variants_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyVariantCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyVariantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/accounting-policies/variants/{variant_id}":{"patch":{"tags":["library"],"summary":"Patch Acc Policy Variant","operationId":"patch_acc_policy_variant_api_library_accounting_policies_variants__variant_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyVariantPatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyVariantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["library"],"summary":"Delete Acc Policy Variant","operationId":"delete_acc_policy_variant_api_library_accounting_policies_variants__variant_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/accounting-policies/variants/{variant_id}/canonicalize":{"post":{"tags":["library"],"summary":"Canonicalize Acc Policy Variant","operationId":"canonicalize_acc_policy_variant_api_library_accounting_policies_variants__variant_id__canonicalize_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyVariantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/accounting-policies/extract-from-ar":{"post":{"tags":["library"],"summary":"Extract Acc Policies From Ar","operationId":"extract_acc_policies_from_ar_api_library_accounting_policies_extract_from_ar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyExtractReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccPolicyExtractResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/library/accounting-policies/extract-all":{"post":{"tags":["library"],"summary":"Extract Acc Policies From All","description":"Run extract-from-ar across every AnnualReport upload in the\ntenant.  Useful for the user's 'scan all uploaded AR' action.","operationId":"extract_acc_policies_from_all_api_library_accounting_policies_extract_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/snapshots/freeze":{"post":{"tags":["snapshots"],"summary":"Freeze Period Snapshot","description":"Create an immutable snapshot of the engagement at this moment.\n\nRequires all three sign-offs (preparer + reviewer + partner) to be\npopulated — the Overview card's freeze CTA is disabled otherwise,\nbut the server enforces the gate too.  The snapshot payload + a\nSHA-256 hash + the role captures get written; nothing in this\ntable is ever mutated afterwards.","operationId":"freeze_period_snapshot_api_engagements__engagement_id__snapshots_freeze_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeriodSnapshotResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/snapshots":{"get":{"tags":["snapshots"],"summary":"List Period Snapshots","description":"Most-recent-first list of frozen snapshots for this engagement.","operationId":"list_period_snapshots_api_engagements__engagement_id__snapshots_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PeriodSnapshotResp"},"title":"Response List Period Snapshots Api Engagements  Engagement Id  Snapshots Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/snapshots/{snapshot_id}":{"get":{"tags":["snapshots"],"summary":"Get Period Snapshot","description":"Return the full frozen payload for a snapshot — used to render\nthe locked view + as the source for re-generating exports.","operationId":"get_period_snapshot_api_engagements__engagement_id__snapshots__snapshot_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string","title":"Snapshot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/signoff":{"get":{"tags":["signoff"],"summary":"Get Signoff State","description":"Return the three-role sign-off state for the Overview card.","operationId":"get_signoff_state_api_engagements__engagement_id__signoff_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignOffStateResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["signoff"],"summary":"Post Signoff","description":"Stamp the current user against one of preparer / reviewer /\npartner.  Idempotent — re-stamping the SAME role overwrites the\nprior timestamp (a rejection workflow re-signs after a fix).\n\n19 Jul 2026 — B1 · CTO audit finding closed.\nRBAC gate is now role-specific (was uniformly ``engagement.update``,\nwhich let any preparer stamp all three roles solo).  The three\nstamps require:\n  * preparer → signoff.preparer capability (Owner / OrgAdmin /\n    EngagementLead / Preparer)\n  * reviewer → signoff.reviewer capability (Owner / EngagementLead /\n    Reviewer) + enrolled TOTP + fresh step-up MFA claim on the JWT\n  * partner  → signoff.partner capability (Owner / Approver) +\n    enrolled TOTP + fresh step-up MFA claim on the JWT\nA single user cannot hold two different stamps on the same\nengagement (SoD assertion) — reviewer and partner must be\ndistinct humans from preparer, and from each other.\n\nW0-2 / W1-1 / W1-2 (26 Jun 2026), IND-43 (30 Aug 2026), IND-59\n(12 Sep 2026): each sign-off passes through the gate set in\n``SIGNOFF_GATE_NAMES`` — reporting period, BS balance, every TB\nline on a face head, CFS ties (zero tolerance, prior TB\nrequired), SOCIE ties (zero tolerance, no back-solved opening),\nOCI routed, P&L → retained earnings, group openings agreed,\nSchedule III ageing complete.  A blocker raises HTTP 409 whose\ndetail is the first blocker's structured payload plus\n``blockers`` (all of them).  ``GET …/signoff/readiness`` returns\nthe same list without attempting a stamp.\nAll gates apply to all three roles so reviewer/partner cannot\nrubber-stamp a structurally broken pack even if preparer\nslipped one through.\n\nEvery successful stamp writes an ``AuthEvent`` row (event =\n``engagement_signoff``) with the actor + engagement + role + IP —\ntamper-evident audit trail for downstream inspection.\n\n26 Jun 2026 follow-up (live-verify latency fix): we build a\nsingle _SignoffGateContext up-front and reuse it across all\n3 gates so prepare_bs / prepare_cfs / _compute_socie_period\neach run once per click, not 2-3× as the un-cached path did.","operationId":"post_signoff_api_engagements__engagement_id__signoff_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignOffReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignOffStateResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/signoff/readiness":{"get":{"tags":["signoff"],"summary":"Get Signoff Readiness","description":"IND-59: what would stop a signature, before anyone clicks.\n\nRuns the full gate set read-only and returns every blocker with\nthe same structured shape the POST raises, so the Overview card\ncan list them with their action links.  Deliberately NOT folded\ninto ``GET /signoff``: that read backs the Overview page and this\none loads the trial balance and runs three preparations.","operationId":"get_signoff_readiness_api_engagements__engagement_id__signoff_readiness_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignoffReadinessResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/signoff/{role}":{"delete":{"tags":["signoff"],"summary":"Delete Signoff","description":"Clear a single role's sign-off — used when a reviewer rejects\na preparer's pack and the workflow needs to reset, or when a stamp\nwas made in error and needs to be un-done before re-stamping.\n\n19 Jul 2026 — B1 · same role-specific capability gate as POST.\nClearing a partner stamp requires partner-tier capability +\nstep-up MFA; clearing a preparer stamp requires preparer-tier.\nWrites an ``AuthEvent`` (event = ``engagement_signoff_cleared``)\nwith the actor + engagement + role — so the audit trail records\nboth the stamp and its later revocation.","operationId":"delete_signoff_api_engagements__engagement_id__signoff__role__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"role","in":"path","required":true,"schema":{"type":"string","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignOffStateResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/uploads":{"get":{"tags":["uploads"],"summary":"List Uploads","operationId":"list_uploads_api_engagements__engagement_id__uploads_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UploadOut"},"title":"Response List Uploads Api Engagements  Engagement Id  Uploads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Upload File","operationId":"upload_file_api_engagements__engagement_id__uploads_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_engagements__engagement_id__uploads_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/uploads/activity":{"get":{"tags":["uploads"],"summary":"List Upload Activity","description":"Every upload added or deleted for this engagement, newest first\n(ported from GMC-PRISM): the upload slice of the audit_logs table,\nso deleted files stay visible with who removed them and when.","operationId":"list_upload_activity_api_engagements__engagement_id__uploads_activity_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UploadActivityOut"},"title":"Response List Upload Activity Api Engagements  Engagement Id  Uploads Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/uploads/{upload_id}/content":{"get":{"tags":["uploads"],"summary":"Stream Upload Content","description":"Stream the bytes of a user-uploaded original file.\n\nUsed by the document-chat AR viewer (Sprint B.2) to embed PDFs\nin-browser via <iframe>.  Encrypted-at-rest files are decrypted\ntransparently.","operationId":"stream_upload_content_api_uploads__upload_id__content_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/uploads/{upload_id}/amount-scale":{"put":{"tags":["uploads"],"summary":"Set Upload Amount Scale","description":"IND-71 (15 Sep 2026): record the unit a trial balance's amounts\nare stated in (\"Actuals\", \"Lakhs\", \"Millions\", \"Crores\", ...).\n\nThe TB loader multiplies the workbook up to actual figures from\nthis, so a file in crores and a file in rupees land on the same\ncontract: trial balance and mapping in actuals, faces and notes\ndivided by the engagement's round-off scale.  Changing it changes\nevery derived number, so every cache that reads the trial balance\nis dropped.","operationId":"set_upload_amount_scale_api_uploads__upload_id__amount_scale_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmountScaleReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/uploads/{upload_id}":{"delete":{"tags":["uploads"],"summary":"Delete Upload","operationId":"delete_upload_api_uploads__upload_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/balance-sheet":{"get":{"tags":["fs"],"summary":"Get Fs Balance Sheet","description":"X-25 Phase 1C: Balance Sheet (Statement of Financial Position).\n\nUses the framework-aware mapping library (Schedule III for IndAS,\nIAS 1 for IFRS) to classify TB rows into NCA / CA / EQ / NCL / CL\nsections.  Equity + Liabilities = Assets check is included; the\nUI renders a warning when the diff exceeds tolerance.","operationId":"get_fs_balance_sheet_api_engagements__engagement_id__fs_balance_sheet_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pnl":{"get":{"tags":["fs"],"summary":"Get Fs Pnl","description":"X-32 Phase C item 2: detailed line-by-line Profit & Loss.\n\nReturns every TB account in its IFRS 18.47 category bucket plus\nthe four mandatory subtotals (Operating profit, Profit before\nfinancing & tax, Profit before tax, Profit for the period from\ncontinuing operations, Profit for the period).  Replaces the\n\"only-totals\" rendering the old FsPreparationPage produced.\n\nConvention: ``net = credit - debit`` so revenue is +ve and\nexpenses are -ve.  Subtotals are computed by addition (no sign\nflips) once the category nets are in this convention.","operationId":"get_fs_pnl_api_engagements__engagement_id__fs_pnl_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/ratios":{"get":{"tags":["fs"],"summary":"Get Schedule Iii Ratios","operationId":"get_schedule_iii_ratios_api_engagements__engagement_id__fs_schedule_iii_ratios_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/ratio-inputs":{"put":{"tags":["fs"],"summary":"Put Schedule Iii Ratio Inputs","operationId":"put_schedule_iii_ratio_inputs_api_engagements__engagement_id__fs_schedule_iii_ratio_inputs_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioInputsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/ageing":{"get":{"tags":["fs"],"summary":"Get Schedule Iii Ageing","operationId":"get_schedule_iii_ageing_api_engagements__engagement_id__fs_schedule_iii_ageing_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/ageing/{schedule_key}":{"put":{"tags":["fs"],"summary":"Put Schedule Iii Ageing","operationId":"put_schedule_iii_ageing_api_engagements__engagement_id__fs_schedule_iii_ageing__schedule_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"schedule_key","in":"path","required":true,"schema":{"type":"string","title":"Schedule Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgeingScheduleReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/disclosures":{"get":{"tags":["fs"],"summary":"Get Schedule Iii Disclosures","operationId":"get_schedule_iii_disclosures_api_engagements__engagement_id__fs_schedule_iii_disclosures_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/disclosures/{key}":{"put":{"tags":["fs"],"summary":"Put Schedule Iii Disclosure","operationId":"put_schedule_iii_disclosure_api_engagements__engagement_id__fs_schedule_iii_disclosures__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/nbfc":{"get":{"tags":["fs"],"summary":"Get Nbfc Regulatory","operationId":"get_nbfc_regulatory_api_engagements__engagement_id__fs_schedule_iii_nbfc_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/nbfc/capital":{"put":{"tags":["fs"],"summary":"Put Nbfc Capital","operationId":"put_nbfc_capital_api_engagements__engagement_id__fs_schedule_iii_nbfc_capital_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapitalReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/schedule-iii/nbfc/liquidity/{table_key}":{"put":{"tags":["fs"],"summary":"Put Nbfc Liquidity Table","operationId":"put_nbfc_liquidity_table_api_engagements__engagement_id__fs_schedule_iii_nbfc_liquidity__table_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"table_key","in":"path","required":true,"schema":{"type":"string","title":"Table Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiquidityTableReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/oci":{"get":{"tags":["fs"],"summary":"Get Fs Oci","description":"X-25 Phase 1C: Other Comprehensive Income.\n\nWalks TB for OCI items and splits them into IAS 1 reclassifiable\nvs not-reclassifiable buckets.","operationId":"get_fs_oci_api_engagements__engagement_id__fs_oci_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/socie":{"get":{"tags":["fs"],"summary":"Get Fs Socie","description":"X-25 Phase 1C: Statement of Changes in Equity.\n\nBuilt from explicit movement inputs derived from the latest\navailable data: opening balances from the prior-period BS (when\non file), P&L net for the year from the categorised P&L, OCI\nfor the year from the OCI engine, dividends + share movements\nfrom TB rows tagged by the SOCIE row-rules.\n\n11 Jun 2026 (#164): now also returns a `comparative` block with\nthe prior-period SOCIE so the UI can render both periods stacked.\nOpening for the comparative period back-solves from prior closing\nwhen pre-prior TB isn't on file.","operationId":"get_fs_socie_api_engagements__engagement_id__fs_socie_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/oci-reserve-map":{"get":{"tags":["fs"],"summary":"Get Oci Reserve Map","description":"Every OCI line on this engagement with how it is currently routed.\n\n``source`` tells the preparer where the answer came from:\n  * ``preparer`` — pinned here, and it wins over everything\n  * ``keyword``  — the classifier recognised the label\n  * ``tax``      — the tax component of OCI, which belongs with the\n                   item it taxes rather than in a reserve of its own\n  * ``unrouted`` — nothing placed it; this blocks the run","operationId":"get_oci_reserve_map_api_engagements__engagement_id__oci_reserve_map_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Oci Reserve Map Api Engagements  Engagement Id  Oci Reserve Map Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs"],"summary":"Put Oci Reserve Map","description":"Pin one OCI line to a reserve column.\n\nBody: ``{\"oci_item\": \"...\", \"reserve_column\": \"...\" | null}``.\n\nA null clears the pin and hands the line back to the classifier —\nwhich may leave it unrouted, and that is a legitimate state to\nreturn to.  The preparer's answer always wins over the keyword\nsuggestion, and is never overwritten by a later re-classification.","operationId":"put_oci_reserve_map_api_engagements__engagement_id__oci_reserve_map_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Oci Reserve Map Api Engagements  Engagement Id  Oci Reserve Map Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow":{"get":{"tags":["fs"],"summary":"Get Fs Cash Flow","description":"X-25 Phase 1C: Cash Flow Statement (IAS 7 / Ind AS 7 indirect).\n\nFramework-correct interest-paid classification (IFRS 18.B49\namendment for IFRS; entity-policy default for Ind AS).\nWorking-capital movements are auto-computed when a prior-period\nTB is on file; otherwise placeholder rows render.","operationId":"get_fs_cash_flow_api_engagements__engagement_id__fs_cash_flow_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/mappings":{"get":{"tags":["fs"],"summary":"List Cfs Mappings","description":"Every preparer intervention in this engagement's CFS.","operationId":"list_cfs_mappings_api_engagements__engagement_id__fs_cash_flow_mappings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Cfs Mappings Api Engagements  Engagement Id  Fs Cash Flow Mappings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fs"],"summary":"Upsert Cfs Mapping","description":"Create or update one mapping.\n\nValidation is strict on purpose.  A mapping that is accepted but\nmatches nothing is the worst outcome available here: the preparer\nsees their intervention saved and the statement unchanged, and has\nno way to tell \"the tool ignored me\" from \"my change had no\neffect\".  So a reclassify or exclude must name an account that is\nactually on the trial balance, and the request is refused if it\ndoes not.","operationId":"upsert_cfs_mapping_api_engagements__engagement_id__fs_cash_flow_mappings_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Cfs Mapping Api Engagements  Engagement Id  Fs Cash Flow Mappings Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/mappings/{mapping_id}":{"delete":{"tags":["fs"],"summary":"Delete Cfs Mapping","description":"Remove a mapping, returning the CFS to its derived state.\n\nA hard delete is right here where it would be wrong for an upload:\nthe row is an instruction, not evidence.  Removing it restores the\nrule-based derivation, and what a preparer once instructed and then\nwithdrew is not a fact about the entity.","operationId":"delete_cfs_mapping_api_engagements__engagement_id__fs_cash_flow_mappings__mapping_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Cfs Mapping Api Engagements  Engagement Id  Fs Cash Flow Mappings  Mapping Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working":{"get":{"tags":["fs"],"summary":"Get Cf Working","operationId":"get_cf_working_api_engagements__engagement_id__fs_cash_flow_working_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"standalone","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/corrections":{"post":{"tags":["fs"],"summary":"Post Cf Working Correction","operationId":"post_cf_working_correction_api_engagements__engagement_id__fs_cash_flow_working_corrections_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/corrections/{correction_id}":{"delete":{"tags":["fs"],"summary":"Delete Cf Working Correction","operationId":"delete_cf_working_correction_api_engagements__engagement_id__fs_cash_flow_working_corrections__correction_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"correction_id","in":"path","required":true,"schema":{"type":"string","title":"Correction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/reviews":{"post":{"tags":["fs"],"summary":"Post Cf Working Review","description":"Accept a caption's balancing entry as it stands.  The amount\naccepted is the one on screen now, recorded; a new trial balance\nthat moves the entry puts it back in the queue.","operationId":"post_cf_working_review_api_engagements__engagement_id__fs_cash_flow_working_reviews_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/home-lines":{"post":{"tags":["fs"],"summary":"Post Cf Working Home Line","description":"Where a caption's balancing entry goes, for this engagement.  A\ncash line only: a non-cash home would push the non-cash transfers\noff nil.","operationId":"post_cf_working_home_line_api_engagements__engagement_id__fs_cash_flow_working_home_lines_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeLineIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/reviews/{decision_id}":{"delete":{"tags":["fs"],"summary":"Delete Cf Working Review","operationId":"delete_cf_working_review_api_engagements__engagement_id__fs_cash_flow_working_reviews__decision_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"decision_id","in":"path","required":true,"schema":{"type":"string","title":"Decision Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/cash-flow/working/home-lines/{decision_id}":{"delete":{"tags":["fs"],"summary":"Delete Cf Working Home Line","operationId":"delete_cf_working_home_line_api_engagements__engagement_id__fs_cash_flow_working_home_lines__decision_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"decision_id","in":"path","required":true,"schema":{"type":"string","title":"Decision Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pnl/adjustments":{"get":{"tags":["fs"],"summary":"List Pnl Adjustments","operationId":"list_pnl_adjustments_api_engagements__engagement_id__fs_pnl_adjustments_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PnlAdjustmentOut"},"title":"Response List Pnl Adjustments Api Engagements  Engagement Id  Fs Pnl Adjustments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fs"],"summary":"Create Pnl Adjustment","operationId":"create_pnl_adjustment_api_engagements__engagement_id__fs_pnl_adjustments_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PnlAdjustmentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PnlAdjustmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pnl/adjustments/{adjustment_id}":{"delete":{"tags":["fs"],"summary":"Delete Pnl Adjustment","operationId":"delete_pnl_adjustment_api_engagements__engagement_id__fs_pnl_adjustments__adjustment_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"adjustment_id","in":"path","required":true,"schema":{"type":"string","title":"Adjustment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/adjustments":{"get":{"tags":["fs"],"summary":"List Fs Adjustments","operationId":"list_fs_adjustments_api_engagements__engagement_id__fs_adjustments_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statement"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FsAdjustmentOut"},"title":"Response List Fs Adjustments Api Engagements  Engagement Id  Fs Adjustments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fs"],"summary":"Create Fs Adjustment","operationId":"create_fs_adjustment_api_engagements__engagement_id__fs_adjustments_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsAdjustmentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsAdjustmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/adjustments/{adjustment_id}":{"patch":{"tags":["fs"],"summary":"Update Fs Adjustment","description":"Change the amount of a manual adjustment in place (OCI page\nEdit).  Same gates as create: capability, sign-off lock, and the\nmateriality cap that routes large amounts through maker-checker.","operationId":"update_fs_adjustment_api_engagements__engagement_id__fs_adjustments__adjustment_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"adjustment_id","in":"path","required":true,"schema":{"type":"string","title":"Adjustment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsAdjustmentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsAdjustmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fs"],"summary":"Delete Fs Adjustment","operationId":"delete_fs_adjustment_api_engagements__engagement_id__fs_adjustments__adjustment_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"adjustment_id","in":"path","required":true,"schema":{"type":"string","title":"Adjustment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/notes/draft":{"get":{"tags":["fs"],"summary":"Get Fs Notes Draft","description":"X-32 Phase C item 7: generate the seven mandatory IFRS 18 /\nInd AS 118 disclosure notes for an engagement.\n\nThe notes are generated from engagement data (framework, archetype\nfrom the latest succeeded run, MPMs from the inventory, materiality\nfrom the engagement profile).  Where data is missing, the note text\ncarries a clearly-marked \"[Preparer note: ...]\" placeholder rather\nthan silently omitting the disclosure.\n\nThis endpoint is read-only and side-effect-free.  Inline editing of\nnotes (with persistence) ships as part of Phase D item 6 (source\ncalculation + edit on every FS line).","operationId":"get_fs_notes_draft_api_engagements__engagement_id__fs_notes_draft_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/notes/schedule-iii":{"get":{"tags":["fs"],"summary":"Get Fs Notes Schedule Iii","description":"X-38 Phase E: Schedule III note disaggregation.\n\nBuilds the mandatory Schedule III BS + P&L notes from the current\n+ prior TB.  Notes covered: PPE class-wise reconciliation, TR\nageing (placeholder pending sub-ledger feed), Borrowings by\nsource, TP MSME ageing, Provisions by nature, NBFC Loans\nclassification, Revenue from operations split, Other Income (Div\nII §5) / Interest Income + FV changes split (Div III), Finance\ncosts (Sch III §4), Employee Benefits expense breakdown, Items\nindividually >= 1% of Revenue or INR 10 lakh.\n\nThese are deterministic / rule-driven and serve as a draft for\nthe preparer.  Class-wise / ageing schedules that need\nsub-ledger data carry a \"preparer must populate\" placeholder.","operationId":"get_fs_notes_schedule_iii_api_engagements__engagement_id__fs_notes_schedule_iii_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/notes":{"get":{"tags":["fs"],"summary":"Get Fs Notes","description":"X-25 Phase 1C: Notes index.\n\nAggregates all the disclosure inputs into a single index page:\n  * Memos by template (each becomes a note section)\n  * Disclosure schedule rows (the 10 IFRS 18 disclosures)\n  * MPM inventory (one note per MPM)\n  * Materiality (basis-of-preparation note input)\n  * Classification + comparative reconciliation (linked notes)","operationId":"get_fs_notes_api_engagements__engagement_id__fs_notes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}":{"get":{"tags":["fs"],"summary":"Get Engagement Note","description":"Return the per-note payload consumed by NoteCanvas — body,\nparagraph refs, AR quote + freshness, and AR upload metadata.\n\n404 if ``note_key`` is not in the framework-appropriate extension\nnotes set for this engagement.","operationId":"get_engagement_note_api_engagements__engagement_id__notes__note_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/batch":{"post":{"tags":["fs"],"summary":"Batch Engagement Notes","description":"Return {key: note_payload} for every requested key in ONE call.\n\nShared context (framework, archetype, notes_values, AR cache,\nT18 forms, extension-notes list, AR upload metadata, AR freshness\nbaseline) is computed ONCE — the per-key loop only does the\nnarrative-override lookup (per-note DB row) and the small AR-body\npromotion + payload construction.\n\nSee the block comment above for context on why this exists.","operationId":"batch_engagement_notes_api_engagements__engagement_id__notes_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchNotesReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/provenance":{"get":{"tags":["fs"],"summary":"Get Engagement Note Provenance","description":"21 Jul 2026 — Wave 2 · per-note provenance.\n\nReturns:\n  * ``engine.module`` / ``engine.source_path`` — where the builder\n    function lives.\n  * ``engine.function`` — the specific ``_n_*`` builder (from the\n    static hint map above; falls back to ``null`` when the key is\n    outside the hint set — the module path is still authoritative).\n  * ``template.id`` — the note key itself, which is also the\n    template identifier the layout registry keys off.\n  * ``template.linked_memo`` — the M5 memo template this note\n    references (when set on the NoteDraft).\n  * ``standards.paragraph_refs`` — IFRS / Ind AS paragraph\n    anchors from the NoteDraft.\n  * ``narrative.source`` — ``\"auditor_override\"`` when an\n    EngagementNonTbInput ``NARR.<note_key>`` row exists, else\n    ``\"engine\"``.\n  * ``narrative.updated_at`` — override timestamp (null when\n    source is engine).\n\n404 if ``note_key`` isn't in the framework-appropriate extension\nnotes set for this engagement.","operationId":"get_engagement_note_provenance_api_engagements__engagement_id__notes__note_key__provenance_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-note-content":{"get":{"tags":["fs"],"summary":"Get Ar Note Content","description":"25 Nov 2026 (client) — a numbered note as the uploaded Annual\nReport prints it: its tables and the short text between them, in\nthe report's order (api/ar_note_sections.ar_note_content; no AI).\nRead-only.  ``found`` is false when the AR has no section with the\nnote's title, or no AR is uploaded.","operationId":"get_ar_note_content_api_engagements__engagement_id__ar_note_content_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"title","in":"query","required":true,"schema":{"type":"string","title":"Title"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-form-fill":{"get":{"tags":["fs"],"summary":"Get Ar Form Fill","description":"25 Nov 2026 (client) — the note's input form filled from the\nAnnual Report's movement table (api/ar_form_fill; no AI).  A\nproposal only: the form shows it and the preparer saves it the\nusual way.  ``found`` is false when the form cannot be filled from\nthe report (no AR, no movement table, or a form not covered).","operationId":"get_ar_form_fill_api_engagements__engagement_id__ar_form_fill_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"title","in":"query","required":true,"schema":{"type":"string","title":"Title"}},{"name":"sheet_code","in":"query","required":true,"schema":{"type":"string","title":"Sheet Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/narrative-source":{"put":{"tags":["fs"],"summary":"Put Engagement Note Narrative Source","description":"Save whether the note uses the Annual Report's text or the\npreparer's own approved text.  Only the choice is saved; neither\ntext changes.","operationId":"put_engagement_note_narrative_source_api_engagements__engagement_id__notes__note_key__narrative_source_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NarrativeSourceReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/narrative":{"put":{"tags":["fs"],"summary":"Put Engagement Note Narrative","description":"Persist an auditor's inline narrative override for a note.\n\nAll notes are editable in-Canvas; there is no \"Memo Inbox\"\nround-trip.  Body is stored in ``EngagementNonTbInput`` with a\nsynthetic ``NARR.<note_key>`` sheet_code — same table,\nsoft-delete audit trail, and access checks the workpaper /\nface-line writes use.\n\nReturns the persisted body + updated_at so the FE can update\nlocal state without a refetch.\n\n19 Jul 2026 — B6 · optimistic concurrency control.  The optional\n``If-Match`` request header carries the ``updated_at`` value the\nclient received from its last GET.  When the header is present\nand doesn't match the current row's ``created_at``, the endpoint\nreturns HTTP 409 with a structured detail so the FE can prompt\nthe user to reload before losing their edit.  Legacy clients\nwithout the header keep the pre-fix ``last writer wins`` contract.","operationId":"put_engagement_note_narrative_api_engagements__engagement_id__notes__note_key__narrative_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NarrativePutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/tables":{"get":{"tags":["fs"],"summary":"Get Engagement Note Tables","description":"Return the canonical numeric tables for a single note.  See\n``_build_note_tables_payload`` for the precedence order and\nbehaviour — this endpoint is a thin auth wrapper.","operationId":"get_engagement_note_tables_api_engagements__engagement_id__notes__note_key__tables_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/tables/batch":{"post":{"tags":["fs"],"summary":"Batch Engagement Note Tables","description":"Return {key: TablesPayload} for every requested key in ONE call.\nNotes that link to a P&L FSLI get a table built from the P&L face\nresponse (all accounts of the FSLI line, so the total ties to the face)\ngrouped under NLI headings from the pins.  All other notes are left\nexactly as _build_note_tables_payload produced them.","operationId":"batch_engagement_note_tables_api_engagements__engagement_id__notes_tables_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchNoteTablesReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-structure":{"get":{"tags":["fs"],"summary":"Get Notes Structure","description":"Return the per-engagement Notes Structure config.\n\nOrdered by ``ordinal``.  When the engagement has no rows (never\nhad a template applied), returns an empty ``rows`` list and\n``is_seeded=false`` so the FE can fall back to the runtime\nsequential assigner.\n\nRBAC — same engagement-access gate as every other engagement-\nscoped endpoint in this router.","operationId":"get_notes_structure_api_engagements__engagement_id__notes_structure_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NotesStructureResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs"],"summary":"Put Notes Structure","description":"Replace the full Notes Structure for an engagement (editor save).\n\nDelete-then-insert inside a single transaction.  Validation:\n  * ordinals must be unique\n  * note_num values must be unique (auditors read them; two\n    notes carrying the same \"5\" would break the printed pack)\n  * kind must be one of the known layout kinds\n  * parent_ordinal, when set, must reference another row in the\n    same payload\n\nRBAC — engagement-access gate (same as GET).","operationId":"put_notes_structure_api_engagements__engagement_id__notes_structure_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NotesStructurePutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NotesStructureResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-choices":{"get":{"tags":["fs"],"summary":"Get Note Choices","description":"What \"Notes to include\" shows: required and statement notes\n(locked), suggestions, Schedule III items, own notes, and how many\nstill wait for a decision.","operationId":"get_note_choices_api_engagements__engagement_id__note_choices_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-choices/decide":{"post":{"tags":["fs"],"summary":"Decide Note Choice","description":"Include a suggested note or mark it not applicable (with a\nreason); the same for a Schedule III item, plus where it prints.","operationId":"decide_note_choice_api_engagements__engagement_id__note_choices_decide_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteDecisionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-choices/custom":{"post":{"tags":["fs"],"summary":"Add Custom Note","description":"Add the preparer's own note, after the note they chose.","operationId":"add_custom_note_api_engagements__engagement_id__note_choices_custom_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CustomNoteReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-choices/custom/{item_key}":{"patch":{"tags":["fs"],"summary":"Patch Custom Note","operationId":"patch_custom_note_api_engagements__engagement_id__note_choices_custom__item_key__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"item_key","in":"path","required":true,"schema":{"type":"string","title":"Item Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CustomNotePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fs"],"summary":"Delete Custom Note","operationId":"delete_custom_note_api_engagements__engagement_id__note_choices_custom__item_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"item_key","in":"path","required":true,"schema":{"type":"string","title":"Item Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-choices/text":{"put":{"tags":["fs"],"summary":"Put Note Choice Text","description":"The text of an own note, or of a suggested note that has no\ncatalogue note behind it (share-based payments, ...).","operationId":"put_note_choice_text_api_engagements__engagement_id__note_choices_text_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteTextReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/note-register":{"get":{"tags":["fs"],"summary":"Get Note Register","description":"FSP-1: the engagement's numbered notes, built once on the\nserver from the note template, the Note settings, the notes'\ncontent and the face lines (or the Notes Structure override).\nEvery surface that prints a note number reads this.","operationId":"get_note_register_api_engagements__engagement_id__fs_note_register_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"standalone","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/print-format":{"get":{"tags":["fs"],"summary":"Get Print Format","description":"How this engagement's printed pack is formatted, with the\ndefaults filled in for anything not saved.","operationId":"get_print_format_api_engagements__engagement_id__fs_print_format_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs"],"summary":"Put Print Format","description":"Save the format (owner, 18 Nov 2026).  Whole object; unknown\nkeys or values are refused (422).  Locked once the pack is\npartner-signed.","operationId":"put_print_format_api_engagements__engagement_id__fs_print_format_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PrintFormatPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/note-links":{"put":{"tags":["fs"],"summary":"Put Note Link","description":"Set the note a statement line points at (owner, 18 Nov 2026:\n\"Note reference can be updated by the user, if not directly\nidentifiable\").  The line then shows that note's number and follows\nit when the notes are renumbered.  Returns the register as it now\nstands.","operationId":"put_note_link_api_engagements__engagement_id__fs_note_links_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteLinkReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-settings":{"get":{"tags":["fs"],"summary":"Get Note Settings","description":"The engagement's note settings, with the framework's defaults\nfilled in for anything not saved.","operationId":"get_note_settings_api_engagements__engagement_id__note_settings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteSettingsResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs"],"summary":"Put Note Settings","description":"Save the note settings.  Whole object; unknown keys or values\nare refused (422).  Locked once the pack is partner-signed (423).","operationId":"put_note_settings_api_engagements__engagement_id__note_settings_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteSettingsPutReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_NoteSettingsResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/matrix":{"get":{"tags":["fs"],"summary":"Get Engagement Note Matrix","description":"Return the resolved matrix for a single note.\n\nResponse shape (see api/matrix_designer.py :class:`ResolvedMatrix`):\n\n    {\n      \"engagement_id\": \"...\",\n      \"note_key\": \"n21_ppe\",\n      \"orientation\": \"class_in_rows\",\n      \"template\": \"rollforward\",\n      \"rows\":    [ MatrixAxis, ... ],\n      \"columns\": [ MatrixAxis, ... ],\n      \"span_headers\": [ ... ],\n      \"cells\": {\n        \"r_land::c_open\": {kind:\"bind\", number: 142860,\n                             source_kind:\"FACE\",\n                             source_ref:\"BS.NC.ppe\"},\n        ...\n      },\n      \"presentation_currency\": \"AED\",\n      \"scale\": \"Millions\",\n      \"warnings\": [ ... ]\n    }\n\n404 when the note has no matrix yet — client calls\n``/matrix/seed`` to obtain a template-shaped starter, edits, then\nPUTs the result.  Clean 404 lets the FE distinguish \"no matrix\ndesigned yet\" from \"empty matrix\" (which is a valid state — an\nauditor may deliberately publish an empty grid).","operationId":"get_engagement_note_matrix_api_engagements__engagement_id__notes__note_key__matrix_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs"],"summary":"Put Engagement Note Matrix","description":"Save an auditor-authored matrix.\n\nThe FE POSTs the *authored* form (with ``bind`` / ``formula``\ncells, not resolved numbers).  BE validates via NoteMatrix, then\npersists.  Response echoes the resolved matrix (same shape GET\nreturns) so the FE can re-render without a second round-trip.","operationId":"put_engagement_note_matrix_api_engagements__engagement_id__notes__note_key__matrix_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/matrix/batch":{"post":{"tags":["fs"],"summary":"Batch Engagement Note Matrices","description":"Every asked note's resolved matrix in one call (26 Nov 2026):\nFS Preview asked once a note -- about 70 requests on opening --\nwhich used up the rate limit and held the page on \"Loading...\".\nA note with no matrix designed is left out (the single GET's 404).\nA read.","operationId":"batch_engagement_note_matrices_api_engagements__engagement_id__notes_matrix_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MatrixBatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/matrix/seed":{"post":{"tags":["fs"],"summary":"Seed Engagement Note Matrix","description":"Return a template-shaped empty matrix for the editor to open\nwith.  Does NOT persist — the FE only saves when the auditor\nhits \"Save draft\" / \"Publish\".  Keeps the storage layer clean of\nabandoned matrices from users who bounced off the editor.","operationId":"seed_engagement_note_matrix_api_engagements__engagement_id__notes__note_key__matrix_seed_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MatrixSeedReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preview-changes":{"post":{"tags":["fs-preview-changes"],"summary":"Create Fs Preview Change","description":"Create a pending tracked-change from an inline FS Preview edit.\n\nThe FE calls this when the preparer clicks Save in the inline\neditor overlay.  Both before_text (the engine-rendered text at\ntime of edit) and after_text (the preparer's replacement) are\nstored so downstream renderers can compute a diff even if the\nengine text changes later.\n\nReturns 400 if before_text == after_text (no actual change).\nReturns 200 with the new row on success.","operationId":"create_fs_preview_change_api_engagements__engagement_id__fs_preview_changes_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__fs_preview_changes___ChangeCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["fs-preview-changes"],"summary":"List Fs Preview Changes","description":"List tracked-changes for an engagement.\n\nOptional query filters:\n\n  * ``note_key`` — restrict to changes on a specific note\n    (e.g. ``n18a_basis_of_preparation``).  Case-sensitive.\n  * ``status`` — restrict to a specific status (pending /\n    accepted / rejected).  Returns 400 if an unknown status\n    is supplied.\n\nRows are ordered by ``created_at`` descending (most-recent first).\n\nB2 note: this is a READ path — a locked (partner-signed) engagement\nstill exposes its tracked-change history.  Only the mutating paths\n(create / accept / reject / cancel) are gated by the edit-lock.","operationId":"list_fs_preview_changes_api_engagements__engagement_id__fs_preview_changes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Note Key"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preview-changes/{change_id}/accept":{"post":{"tags":["fs-preview-changes"],"summary":"Accept Fs Preview Change","description":"Owner / OrgAdmin accepts a pending change.  Idempotent when the\nchange is already accepted (returns the row unchanged); errors when\nthe change is rejected (a rejected change must be re-created).","operationId":"accept_fs_preview_change_api_engagements__engagement_id__fs_preview_changes__change_id__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__fs_preview_changes___ChangeReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preview-changes/{change_id}/reject":{"post":{"tags":["fs-preview-changes"],"summary":"Reject Fs Preview Change","description":"Owner / OrgAdmin rejects a pending or accepted change.\nIdempotent when already rejected.","operationId":"reject_fs_preview_change_api_engagements__engagement_id__fs_preview_changes__change_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__fs_preview_changes___ChangeReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preview-changes/{change_id}":{"delete":{"tags":["fs-preview-changes"],"summary":"Cancel Fs Preview Change","description":"Cancel a pending change — author only, pending status only.\n\nErrors:\n  * 404 when the change doesn't exist.\n  * 403 when the caller isn't the author.\n  * 400 when the change has already been reviewed\n    (accepted / rejected) — the audit trail is preserved.","operationId":"cancel_fs_preview_change_api_engagements__engagement_id__fs_preview_changes__change_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-narrative-changes":{"post":{"tags":["notes-narrative-changes"],"summary":"Create Notes Narrative Change","description":"Propose a change to a note's narrative.  Called when the\npreparer submits the Notes Canvas narrative editor for review,\ninstead of writing the body immediately.","operationId":"create_notes_narrative_change_api_engagements__engagement_id__notes_narrative_changes_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__notes_narrative_changes___ChangeCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["notes-narrative-changes"],"summary":"List Notes Narrative Changes","description":"List narrative changes for an engagement.  A READ path — a\nlocked (partner-signed) engagement still shows its history.","operationId":"list_notes_narrative_changes_api_engagements__engagement_id__notes_narrative_changes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Note Key"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-narrative-changes/{change_id}/accept":{"post":{"tags":["notes-narrative-changes"],"summary":"Accept Notes Narrative Change","description":"Owner / OrgAdmin accepts a pending change — writes it as the\nnote's narrative.  Idempotent when already accepted; a rejected\nchange must be re-proposed.","operationId":"accept_notes_narrative_change_api_engagements__engagement_id__notes_narrative_changes__change_id__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__notes_narrative_changes___ChangeReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-narrative-changes/{change_id}/reject":{"post":{"tags":["notes-narrative-changes"],"summary":"Reject Notes Narrative Change","description":"Owner / OrgAdmin rejects a pending or accepted change.\nIdempotent when already rejected.  Nothing is written to the\nnarrative.","operationId":"reject_notes_narrative_change_api_engagements__engagement_id__notes_narrative_changes__change_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__notes_narrative_changes___ChangeReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-narrative-changes/{change_id}":{"delete":{"tags":["notes-narrative-changes"],"summary":"Cancel Notes Narrative Change","description":"Cancel a pending change — author only, pending status only.","operationId":"cancel_notes_narrative_change_api_engagements__engagement_id__notes_narrative_changes__change_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-edit-approvals":{"get":{"tags":["notes-narrative-changes"],"summary":"List Note Edit Approvals","description":"20 Nov 2026 — the Approvals page's \"Note edits\" tab: Notes\nCanvas narrative changes and FS Preview paragraph changes in one\nlist, newest first, with author / reviewer names.  Accept and\nreject go through each kind's own endpoint.  A READ path.\n\n25 Nov 2026 (owner): a note's own tables and text (\"Send for\nreview\" on the Notes page, ``note_blocks``) are listed too, with\nthe note's number and title and what the change does.","operationId":"list_note_edit_approvals_api_engagements__engagement_id__note_edit_approvals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}":{"get":{"tags":["note-blocks"],"summary":"Get Note Blocks","operationId":"get_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/batch":{"post":{"tags":["note-blocks"],"summary":"Batch Note Blocks","description":"The accepted blocks of the notes asked for that have any.  A\nnote with none prints its library parts as it always has.","operationId":"batch_note_blocks_api_engagements__engagement_id__note_blocks_batch_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_blocks___BatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}/preview":{"post":{"tags":["note-blocks"],"summary":"Preview Note Blocks","description":"An unsaved arrangement with its figures filled in, so the editor\nshows the numbers while the preparer works.  Stores nothing.","operationId":"preview_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PreviewReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks-sources":{"get":{"tags":["note-blocks"],"summary":"Note Block Sources","description":"What a figure can be linked to, for the link pop-up.","operationId":"note_block_sources_api_engagements__engagement_id__note_blocks_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}/changes":{"post":{"tags":["note-blocks"],"summary":"Propose Note Blocks","operationId":"propose_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__changes_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ProposeReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}/changes/{change_id}/accept":{"post":{"tags":["note-blocks"],"summary":"Accept Note Blocks","operationId":"accept_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__changes__change_id__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_blocks___ReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}/changes/{change_id}/reject":{"post":{"tags":["note-blocks"],"summary":"Reject Note Blocks","operationId":"reject_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__changes__change_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routers__note_blocks___ReviewReq","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/note-blocks/{entry_key}/changes/{change_id}":{"delete":{"tags":["note-blocks"],"summary":"Cancel Note Blocks","operationId":"cancel_note_blocks_api_engagements__engagement_id__note_blocks__entry_key__changes__change_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"entry_key","in":"path","required":true,"schema":{"type":"string","title":"Entry Key"}},{"name":"change_id","in":"path","required":true,"schema":{"type":"string","title":"Change Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/preview/pdf":{"post":{"tags":["fs-pdf"],"summary":"Request Pdf","operationId":"request_pdf_api_engagements__engagement_id__fs_preview_pdf_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pdfs":{"get":{"tags":["fs-pdf"],"summary":"List Pdfs","operationId":"list_pdfs_api_engagements__engagement_id__fs_pdfs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pdfs/{pdf_id}/file":{"get":{"tags":["fs-pdf"],"summary":"Download Pdf","operationId":"download_pdf_api_engagements__engagement_id__fs_pdfs__pdf_id__file_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"pdf_id","in":"path","required":true,"schema":{"type":"string","title":"Pdf Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes-structure/from-annual-report":{"get":{"tags":["notes-structure"],"summary":"Propose From Annual Report","operationId":"propose_from_annual_report_api_engagements__engagement_id__notes_structure_from_annual_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/consent/accept":{"post":{"tags":["consent"],"summary":"Accept Consent","description":"Record the user's acceptance of the currently-published legal\npolicies.  Bumps ``user.consent_version`` to\n``CURRENT_CONSENT_VERSION`` and stamps ``consent_accepted_at``.\n\nWrites an AuthEvent row so the audit trail records exactly what\nthe user consented to and when.  Idempotent — calling twice at\nthe same version just refreshes the timestamp.","operationId":"accept_consent_api_consent_accept_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/consent/status":{"get":{"tags":["consent"],"summary":"Get Consent Status","description":"Explicit consent-state read.  The /api/auth/me endpoint also\nexposes ``consent_version`` + ``needs_reconsent`` so most FE code\nwon't need this — provided as an audit-friendly single-purpose\nsurface.","operationId":"get_consent_status_api_consent_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/tenants/{tenant_id}/sso/configs":{"get":{"tags":["sso"],"summary":"List Sso Configs","operationId":"list_sso_configs_api_tenants__tenant_id__sso_configs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SsoConfigOut"},"title":"Response List Sso Configs Api Tenants  Tenant Id  Sso Configs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sso"],"summary":"Create Sso Config","operationId":"create_sso_config_api_tenants__tenant_id__sso_configs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConfigIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/sso/configs/{config_id}":{"put":{"tags":["sso"],"summary":"Update Sso Config","operationId":"update_sso_config_api_tenants__tenant_id__sso_configs__config_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConfigIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["sso"],"summary":"Delete Sso Config","operationId":"delete_sso_config_api_tenants__tenant_id__sso_configs__config_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/metadata.xml":{"get":{"tags":["sso"],"summary":"Sp Metadata Xml","operationId":"sp_metadata_xml_api_sso_metadata_xml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/sso/login":{"get":{"tags":["sso"],"summary":"Sso Login Initiate","description":"FE-facing entry point.  Given an email hint, looks up the\ntenant's SSO config, builds a SAML AuthN request, and returns a\n302 redirect to the IdP.  Feature-gated for B9.1.","operationId":"sso_login_initiate_api_sso_login_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/acs":{"post":{"tags":["sso"],"summary":"Sso Acs","description":"Assertion Consumer Service.  IdPs POST the SAML response here;\nonce we validate the signature + assertion conditions, we JIT-\nprovision the user + mint a JWT + redirect to the app.  Feature-\ngated for B9.1 — until B9.2 accepts assertions, this endpoint\nrejects with 501.","operationId":"sso_acs_api_sso_acs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/sso/slo":{"get":{"tags":["sso"],"summary":"Sso Slo","description":"Single Logout callback.  Feature-gated for B9.1.","operationId":"sso_slo_api_sso_slo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/library/note-narratives":{"get":{"tags":["library"],"summary":"List Note Narrative Variants","description":"List available narrative variants for a note.\n\nResponse ordering:\n  1. The engine variant (always first — represents \"restore\n     engine\" and is the seed for authoring new variants).\n  2. Tenant-custom variants (status=\"approved\") scoped to the\n     user's tenants, matching (framework, industry) with\n     framework=\"either\" and industry=\"general\" both counting as\n     universal matches.\n  3. When ``include_candidates=true`` — auto-ingested AR-extract\n     candidates (status=\"candidate\") appear after the approved\n     variants.  Hidden by default so the picker isn't polluted\n     by low-quality machine-harvested rows.","operationId":"list_note_narrative_variants_api_library_note_narratives_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"note_key","in":"query","required":true,"schema":{"type":"string","title":"Note Key"}},{"name":"framework","in":"query","required":true,"schema":{"type":"string","title":"Framework"}},{"name":"industry","in":"query","required":false,"schema":{"type":"string","default":"general","title":"Industry"}},{"name":"include_candidates","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Candidates"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["library"],"summary":"Create Note Narrative Variant","description":"Create a tenant-scoped custom variant.  Requires\n``tenant.update`` capability (Owner or OrgAdmin).","operationId":"create_note_narrative_variant_api_library_note_narratives_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CreateVariantReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/note-narratives/{variant_id}":{"delete":{"tags":["library"],"summary":"Delete Note Narrative Variant","description":"Soft-delete a tenant custom variant.  Idempotent — deleting an\nalready-deleted variant returns the same 200 shape.  Applied\noverrides in engagements are NOT rolled back — they stay as\ninline text (which is exactly what happened when the variant was\napplied).  A separate 'Restore engine' action on the engagement\nreverts the override.","operationId":"delete_note_narrative_variant_api_library_note_narratives__variant_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/library/note-narratives/{variant_id}/promote":{"post":{"tags":["library"],"summary":"Promote Note Narrative Variant","description":"Promote a candidate (auto-harvested from an AR extract) to\napproved so the picker surfaces it by default.  Idempotent —\npromoting an already-approved variant returns the same 200\nshape.  Only tenant admins (Owner / OrgAdmin) can promote.","operationId":"promote_note_narrative_variant_api_library_note_narratives__variant_id__promote_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/apply-variant":{"post":{"tags":["library"],"summary":"Apply Variant To Engagement","description":"Apply a variant to an engagement.\n\n``variant_id == \"engine\"`` restores the engine text (soft-deletes\nany active narrative override).  Any other value must be a valid\nUUID of a custom variant belonging to the engagement's tenant.\n\nSame capability gate as ``put_engagement_note_narrative``\n(``engagement.update``), same edit-lock gate (rejects 423 if\npartner-signed), same audit-trail projection into\n``EngagementNonTbInput``.","operationId":"apply_variant_to_engagement_api_engagements__engagement_id__notes__note_key__apply_variant_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ApplyVariantReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/ar-extract":{"get":{"tags":["library"],"summary":"Get Note Ar Extract","description":"Return the AR-extracted narrative for a note (or an empty\npayload with a reason when unavailable).\n\nNever raises 404 — the FE relies on the boolean + reason to\nrender either the accept/edit/reject action panel (available=True)\nor a helpful empty state (e.g. \"Upload an Annual Report to\nenable AR extraction for this note\").","operationId":"get_note_ar_extract_api_engagements__engagement_id__notes__note_key__ar_extract_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/{note_key}/apply-ar-extract":{"post":{"tags":["library"],"summary":"Apply Ar Extract To Engagement","description":"Project the AR-extracted narrative into the same\nNARR.<note_key> override row put_engagement_note_narrative\nwrites to.\n\n404 if no AR body available (with the same reason codes the GET\nendpoint returns).  423 if the engagement is partner-signed.","operationId":"apply_ar_extract_to_engagement_api_engagements__engagement_id__notes__note_key__apply_ar_extract_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"note_key","in":"path","required":true,"schema":{"type":"string","title":"Note Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/subscription/invoice-po":{"post":{"tags":["billing"],"summary":"Create Invoice Po Subscription","description":"Enterprise operator-flip: PO signed → tenant is paid.\n\nNo external payment provider — the row is authoritative.  The\ntrial gate (api/plan_gate.py) sees ``plan_status='paid'`` and\nstops issuing 402.  When the PO invoice goes past due, the\noperator calls the ``expire`` endpoint below.","operationId":"create_invoice_po_subscription_api_admin_tenants__tenant_id__subscription_invoice_po_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePoRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/subscription/expire":{"post":{"tags":["billing"],"summary":"Expire Active Subscription","description":"Operator flip: invoice past due / customer churned.  Cancels\nthe active subscription + flips Tenant.plan_status='expired'.\n\n``reason`` is required — logged to billing_events for auditability.","operationId":"expire_active_subscription_api_admin_tenants__tenant_id__subscription_expire_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_expire_active_subscription_api_admin_tenants__tenant_id__subscription_expire_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/billing":{"get":{"tags":["billing"],"summary":"Get Tenant Billing","description":"Subscription + last 20 events for the admin UI.","operationId":"get_tenant_billing_api_tenants__tenant_id__billing_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantBillingOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/subscription/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout Session Unimplemented","operationId":"create_checkout_session_unimplemented_api_tenants__tenant_id__subscription_checkout_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Stripe Webhook Unimplemented","operationId":"stripe_webhook_unimplemented_api_webhooks_stripe_post","responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/webhooks/razorpay":{"post":{"tags":["billing"],"summary":"Razorpay Webhook Unimplemented","operationId":"razorpay_webhook_unimplemented_api_webhooks_razorpay_post","responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/subscriptions":{"get":{"tags":["subscriptions"],"summary":"List Subscriptions","description":"Every workspace with where it stands: trial, paid, in grace, expired.","operationId":"list_subscriptions_api_admin_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Subscriptions Api Admin Subscriptions Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/tenants/{tenant_id}/subscriptions":{"get":{"tags":["subscriptions"],"summary":"Tenant Subscriptions","operationId":"tenant_subscriptions_api_admin_tenants__tenant_id__subscriptions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tenant Subscriptions Api Admin Tenants  Tenant Id  Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["subscriptions"],"summary":"Create Subscription","operationId":"create_subscription_api_admin_tenants__tenant_id__subscriptions_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Subscription Api Admin Tenants  Tenant Id  Subscriptions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{sub_id}/payments":{"post":{"tags":["subscriptions"],"summary":"Record Payment","operationId":"record_payment_api_admin_subscriptions__sub_id__payments_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Payment Api Admin Subscriptions  Sub Id  Payments Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscription-payments/{payment_id}/reverse":{"post":{"tags":["subscriptions"],"summary":"Reverse Payment","operationId":"reverse_payment_api_admin_subscription_payments__payment_id__reverse_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reverse Payment Api Admin Subscription Payments  Payment Id  Reverse Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{sub_id}/extend":{"post":{"tags":["subscriptions"],"summary":"Extend Subscription","operationId":"extend_subscription_api_admin_subscriptions__sub_id__extend_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Extend Subscription Api Admin Subscriptions  Sub Id  Extend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{sub_id}/cancel":{"post":{"tags":["subscriptions"],"summary":"Cancel Subscription","operationId":"cancel_subscription_api_admin_subscriptions__sub_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Subscription Api Admin Subscriptions  Sub Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscription-payments":{"get":{"tags":["subscriptions"],"summary":"Payments Ledger","operationId":"payments_ledger_api_admin_subscription_payments_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"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/tenants/{tenant_id}/subscription":{"get":{"tags":["subscriptions"],"summary":"My Subscription","description":"Read-only: the plan, what it runs to and the payments received.  No\nadmin notes or event log.","operationId":"my_subscription_api_tenants__tenant_id__subscription_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response My Subscription Api Tenants  Tenant Id  Subscription Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ifrs-drafts/ifrs7":{"get":{"tags":["ifrs-engine-drafts"],"summary":"Get Ifrs7 Engine Draft","description":"Compute the IFRS 7 disclosure draft from the engagement's\ncurrent T4.4 preparer inputs + return the engine result.","operationId":"get_ifrs7_engine_draft_api_engagements__engagement_id__ifrs_drafts_ifrs7_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Ifrs7 Engine Draft Api Engagements  Engagement Id  Ifrs Drafts Ifrs7 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ifrs-drafts/ifrs8":{"get":{"tags":["ifrs-engine-drafts"],"summary":"Get Ifrs8 Engine Draft","description":"Compute the IFRS 8 operating-segments draft from the\nengagement's current T6.1 preparer inputs.","operationId":"get_ifrs8_engine_draft_api_engagements__engagement_id__ifrs_drafts_ifrs8_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Ifrs8 Engine Draft Api Engagements  Engagement Id  Ifrs Drafts Ifrs8 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ifrs-drafts/ifrs12":{"get":{"tags":["ifrs-engine-drafts"],"summary":"Get Ifrs12 Engine Draft","description":"Compute the IFRS 12 interests-in-other-entities draft.\n\nPrior to this endpoint the IFRS 12 engine had ZERO production\ncall sites — the audit's most-severe C1 sub-finding.  Now the\nengine is addressable via the API, even if the notes builder\nstill emits an empty T-form for the preparer to fill.","operationId":"get_ifrs12_engine_draft_api_engagements__engagement_id__ifrs_drafts_ifrs12_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Ifrs12 Engine Draft Api Engagements  Engagement Id  Ifrs Drafts Ifrs12 Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/interim/periods":{"get":{"tags":["corporate-features"],"summary":"List Interim Periods","description":"Return every interim period configured for the engagement.","operationId":"list_interim_periods_api_engagements__engagement_id__interim_periods_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Interim Periods Api Engagements  Engagement Id  Interim Periods Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/interim/generate":{"post":{"tags":["corporate-features"],"summary":"Generate Interim Pack","description":"C21 · generate the Ind AS 34 condensed pack.  Not implemented.","operationId":"generate_interim_pack_api_engagements__engagement_id__interim_generate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle":{"get":{"tags":["corporate-features"],"summary":"Get Close Cycle","description":"Return every close cycle configured for the engagement.","operationId":"get_close_cycle_api_engagements__engagement_id__close_cycle_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Close Cycle Api Engagements  Engagement Id  Close Cycle Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["corporate-features"],"summary":"Create Close Cycle","description":"Register a new close cycle on this engagement.\n\nOne cycle per (engagement, cadence) — the DB uniqueness\nconstraint enforces this.  A tenant can run monthly + quarterly\n+ annual cycles side-by-side on the same engagement if they\ntruly close monthly and separately roll up to a quarterly SEBI\nfiling.\n\nAuto-populates the audit event ``close_cycle_created``.","operationId":"create_close_cycle_api_engagements__engagement_id__close_cycle_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseCycleCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseCycleResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle/{cycle_id}/close":{"post":{"tags":["corporate-features"],"summary":"Close Close Cycle","description":"Freeze the current period on this cycle.\n\nReuses the existing snapshot-freeze pipeline\n(``api.routers.snapshots._build_snapshot_payload``): the engagement\nmust have all three sign-offs (preparer + reviewer + partner)\nin place; the payload gets SHA-256-hashed and stored in the\nwrite-once ``engagement_period_snapshots`` table.  The cycle\nis then updated with the new snapshot id + freeze timestamp\nso the next rollforward has a reference.\n\nAuto-populates the audit event ``close_cycle_closed``.","operationId":"close_close_cycle_api_engagements__engagement_id__close_cycle__cycle_id__close_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"cycle_id","in":"path","required":true,"schema":{"type":"string","title":"Cycle Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseCycleCloseResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle/{cycle_id}/rollforward":{"post":{"tags":["corporate-features"],"summary":"Rollforward Close Cycle","description":"Advance this cycle to the next period.\n\nPreconditions:\n\n  * A prior close snapshot must exist (``last_close_snapshot_id``\n    populated); otherwise returns 409 ``no_prior_close``.\n  * The last-close snapshot must not already have been used to\n    seed a period on THIS cycle (409 ``snapshot_already_rolled_forward``).\n    Prevents \"close once then rollforward twice\" — close the\n    current period again before the next rollforward.\n\nEffects:\n\n  * Derives the next period's label + end date from the cadence\n    (operator can override either via the request body).\n  * Advances ``current_period_label`` + ``current_period_end``.\n  * Sprint 2: extracts opening balances from the source snapshot\n    via ``gmc_prism.close_cycle_engine.derive_next_period_openings``\n    and persists a write-once ``EngagementPeriodOpening`` row\n    atomically with the cursor advance.  Rollback happens if\n    extraction or persistence fails.\n  * Clears the three sign-off timestamps on the engagement so\n    the new period can be worked (the frozen sign-off state is\n    preserved in the snapshot row).\n  * Writes ``AuthEvent`` = ``close_cycle_rollforward``.\n\nSprint 3 scope note: the persisted openings row is now\naddressable via GET ``/close-cycle/{cid}/openings/{period_label}``\n— the fs_engine layer that reads these on FS render is sprint 3\nwork.  For sprint 2, the openings pack is the durable primitive\nthat later work builds on.","operationId":"rollforward_close_cycle_api_engagements__engagement_id__close_cycle__cycle_id__rollforward_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"cycle_id","in":"path","required":true,"schema":{"type":"string","title":"Cycle Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CloseCycleRollforwardReq"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseCycleRollforwardResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle/{cycle_id}/openings/preview":{"post":{"tags":["corporate-features"],"summary":"Preview Openings","description":"Dry-run the openings extraction.\n\nReads the cycle's ``last_close_snapshot_id`` and computes the\nopenings pack from it — without persisting anything.  Useful\nfor the preparer to review what will be seeded into the next\nperiod BEFORE running rollforward.\n\nReturns 409 if no prior close exists (same contract as the\nreal rollforward action).","operationId":"preview_openings_api_engagements__engagement_id__close_cycle__cycle_id__openings_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"cycle_id","in":"path","required":true,"schema":{"type":"string","title":"Cycle Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseCycleOpeningsPreviewResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle/{cycle_id}/openings":{"get":{"tags":["corporate-features"],"summary":"List Openings","description":"Return all persisted opening-balance packs for this cycle,\nordered oldest-first (chronological).","operationId":"list_openings_api_engagements__engagement_id__close_cycle__cycle_id__openings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"cycle_id","in":"path","required":true,"schema":{"type":"string","title":"Cycle Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Openings Api Engagements  Engagement Id  Close Cycle  Cycle Id  Openings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/close-cycle/{cycle_id}/openings/{period_label}":{"get":{"tags":["corporate-features"],"summary":"Get Openings","description":"Return one persisted opening-balance pack (full JSON payload).","operationId":"get_openings_api_engagements__engagement_id__close_cycle__cycle_id__openings__period_label__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"cycle_id","in":"path","required":true,"schema":{"type":"string","title":"Cycle Id"}},{"name":"period_label","in":"path","required":true,"schema":{"type":"string","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Openings Api Engagements  Engagement Id  Close Cycle  Cycle Id  Openings  Period Label  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/erp/credentials":{"get":{"tags":["corporate-features"],"summary":"List Erp Credentials","description":"Return every ERP credential configured for the tenant.  The\nencrypted credential blob is NEVER returned — only metadata\n(kind / display name / status / last pull).","operationId":"list_erp_credentials_api_tenants__tenant_id__erp_credentials_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Erp Credentials Api Tenants  Tenant Id  Erp Credentials Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/erp/credentials/{credential_id}/pull":{"post":{"tags":["corporate-features"],"summary":"Erp Credential Pull","description":"C23 · trigger a live pull from the ERP against the stored\ncredential.  Not implemented for any ERP kind yet.","operationId":"erp_credential_pull_api_tenants__tenant_id__erp_credentials__credential_id__pull_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","title":"Credential Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-approvals":{"get":{"tags":["corporate-features"],"summary":"List Journal Approvals","description":"Return every journal-approval row for the engagement.","operationId":"list_journal_approvals_api_engagements__engagement_id__journal_approvals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Journal Approvals Api Engagements  Engagement Id  Journal Approvals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["corporate-features"],"summary":"Propose Journal Approval","description":"C24 sprint 1 — preparer proposes an adjustment for maker-checker.\n\nStores the full payload in ``payload_json`` — the actual\nPnlAdjustment / FsAdjustment row is materialised at approve\ntime, not now.  No SoD check here; SoD fires at the approval\nsteps.  ``amount_abs`` is captured for the 2× materiality\nstep-up decision at approve time.\n\nWrites ``AuthEvent`` ``journal_approval_proposed``.","operationId":"propose_journal_approval_api_engagements__engagement_id__journal_approvals_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalApprovalCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Propose Journal Approval Api Engagements  Engagement Id  Journal Approvals Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-approvals/{approval_id}/review":{"post":{"tags":["corporate-features"],"summary":"Review Journal Approval","description":"Reviewer stamps a proposed approval.  SoD: reviewer ≠ proposer.\nIdempotent for same reviewer re-stamping the note.","operationId":"review_journal_approval_api_engagements__engagement_id__journal_approvals__approval_id__review_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalApprovalReviewReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Review Journal Approval Api Engagements  Engagement Id  Journal Approvals  Approval Id  Review Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-approvals/{approval_id}/approve":{"post":{"tags":["corporate-features"],"summary":"Approve Journal Approval","description":"Approver stamps a reviewed approval AND materialises the real\nPnlAdjustment / FsAdjustment row atomically.\n\nSoD: approver ≠ proposer, approver ≠ reviewer.  Step-up MFA when\n|amount_abs| > 2× the engagement's absolute materiality (C17).","operationId":"approve_journal_approval_api_engagements__engagement_id__journal_approvals__approval_id__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve Journal Approval Api Engagements  Engagement Id  Journal Approvals  Approval Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-approvals/{approval_id}/reject":{"post":{"tags":["corporate-features"],"summary":"Reject Journal Approval","description":"Reviewer or approver rejects a proposed / reviewed approval.\nNote is mandatory.  SoD: rejecter ≠ proposer.","operationId":"reject_journal_approval_api_engagements__engagement_id__journal_approvals__approval_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalApprovalRejectReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Journal Approval Api Engagements  Engagement Id  Journal Approvals  Approval Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-approvals/{approval_id}/withdraw":{"post":{"tags":["corporate-features"],"summary":"Withdraw Journal Approval","description":"Proposer withdraws their own proposal before review.  Fires only\nfrom the 'proposed' state; once reviewed, the reviewer/approver\npath controls the outcome.","operationId":"withdraw_journal_approval_api_engagements__engagement_id__journal_approvals__approval_id__withdraw_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Withdraw Journal Approval Api Engagements  Engagement Id  Journal Approvals  Approval Id  Withdraw Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pack":{"post":{"tags":["fs"],"summary":"Generate Fs Pack","description":"X-58 Sprint 2: generate the Working-Papers Pack (IFRS 18 /\nInd AS 118) workbook from the engagement's live DB data.\n\nX-58 Sprint 9 — IFRS toggle enforcement: Ind AS is locked to\nper-face-head lead-schedule granularity (mandatory per Sch III\nDiv II / III); only IFRS engagements can opt for ``disclosure`` or\n``both``.  Requests that send ``lead_schedule_granularity !=\nface_head`` on an Ind AS engagement get a 422 with a helpful\nmessage rather than silently downgrading.\n\nWrites the xlsx into the latest succeeded run's output directory\nand appends an entry to that run's ``files_json`` so the\nDeliverables UI surfaces it alongside the other run artefacts.\n\nThe build (workbook, then a LibreOffice PDF that alone can take\n~50 s) runs on the job worker, ported from GMC-PRISM: this endpoint\ndoes the request-time checks, enqueues an ``fs_pack``\nDeliverableJob and answers 202.  Poll\n``GET /api/deliverable-jobs/{id}``; on success its ``result`` is the\nformer response body and ``files`` the new Run file entries.","operationId":"generate_fs_pack_api_engagements__engagement_id__fs_pack_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsPackGenerateReq"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["fs"],"summary":"List Fs Pack Files","description":"List FS Pack deliverables previously generated for this\nengagement, most-recent first.","operationId":"list_fs_pack_files_api_engagements__engagement_id__fs_pack_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FsPackFileOut"},"title":"Response List Fs Pack Files Api Engagements  Engagement Id  Fs Pack Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pack/{filename}":{"delete":{"tags":["fs"],"summary":"Delete Fs Pack File","description":"Delete a previously-generated FS Pack file from this engagement's\nDeliverables history.\n\nSafety:\n  * filename is the BASE filename only (e.g. ENG-2026-9344_FS_Pack_v3.xlsx);\n    path-traversal characters are rejected.\n  * Only matches files declared in the parent run's files_json AND\n    flagged as FS Pack (same predicate as ``list_fs_pack_files``).\n  * RBAC: requires ``engagement.update`` capability on the tenant.","operationId":"delete_fs_pack_file_api_engagements__engagement_id__fs_pack__filename__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/pack/sync":{"post":{"tags":["fs"],"summary":"Sync Fs Pack","description":"X-58 Sprint 6: round-trip sync of an edited FS Pack workbook.\n\nThe preparer downloads the workbook, edits JE_Log / Reclass_Log\nrows offline, and uploads it back.  We:\n\n  1. verify access + capability,\n  2. validate the upload is an .xlsx,\n  3. open it with openpyxl and read the embedded engagement_id,\n  4. 409 if the embedded id doesn't match the URL path,\n  5. upsert each Posted + Pending-upload JE_Log row into\n     ``engagement_pnl_adjustments`` and each Reclass_Log row into\n     ``engagement_reclassification``,\n  6. mark the workbook cells Synced and overwrite the on-disk\n     copy so the next download reflects the new state.","operationId":"sync_fs_pack_api_engagements__engagement_id__fs_pack_sync_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_sync_fs_pack_api_engagements__engagement_id__fs_pack_sync_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsPackSyncResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/deliverable-jobs/{job_id}":{"get":{"tags":["deliverable-jobs"],"summary":"Get Deliverable Job","operationId":"get_deliverable_job_api_deliverable_jobs__job_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/deliverable-jobs/{job_id}/download":{"get":{"tags":["deliverable-jobs"],"summary":"Download Deliverable Job","operationId":"download_deliverable_job_api_deliverable_jobs__job_id__download_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/deliverable-jobs":{"get":{"tags":["deliverable-jobs"],"summary":"List Deliverable Jobs","description":"Most recent jobs first -- lets a page pick up a build that is\nstill running after the user navigated away and back.","operationId":"list_deliverable_jobs_api_engagements__engagement_id__deliverable_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"job_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliverableJobOut"},"title":"Response List Deliverable Jobs Api Engagements  Engagement Id  Deliverable Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reference/industries":{"get":{"summary":"List Industries","operationId":"list_industries_api_reference_industries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["entity","organisation"],"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/industries/export":{"get":{"summary":"Export Industries","operationId":"export_industries_api_admin_industries_export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},{"name":"format","in":"query","required":false,"schema":{"enum":["xlsx","csv"],"type":"string","default":"xlsx","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/industries/versions":{"get":{"summary":"List Versions","operationId":"list_versions_api_admin_industries_versions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/industries/versions/{version}/changes":{"get":{"summary":"List Version Changes","operationId":"list_version_changes_api_admin_industries_versions__version__changes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/industries/import/preview":{"post":{"summary":"Preview Import","description":"Validate an uploaded file and show what would change.  Changes\nnothing; the UI confirms by sending ``rows`` + ``base_version`` to\n/publish.","operationId":"preview_import_api_admin_industries_import_preview_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_import_api_admin_industries_import_preview_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/industries/publish":{"post":{"summary":"Publish Industries","operationId":"publish_industries_api_admin_industries_publish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/industries/{code}":{"patch":{"summary":"Edit Industry","description":"Single-row edit.  The code itself can't change (retire it and add\na new one instead); only the fields sent are changed.","operationId":"edit_industry_api_admin_industries__code__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation":{"get":{"tags":["fs-preparation"],"summary":"Get Fs Preparation","description":"X-6 - draft P&L from the engagement's trial-balance uploads.\n\nReads every TrialBalance upload, runs each row through the\ndeterministic categoriser, and returns the IFRS-18.47 5-category\nP&L plus an Unknown-accounts list the preparer must review.\n\nArchetype defaults to 'General' until the engagement has been\nclassified; the latest run's archetype is preferred when present\n(so an NBFC's customer-loan interest classifies as Operating).","operationId":"get_fs_preparation_api_engagements__engagement_id__fs_preparation_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/comparative":{"get":{"tags":["fs-preparation"],"summary":"Get Fs Preparation Comparative","description":"X-21 / B17: comparative-period P&L (current vs prior) plus the\nC5 reclassification reconciliation that IFRS 18.C5 requires on\nfirst-time application.\n\nReads two sets of TrialBalance uploads on the engagement:\n  * Uploads with period_label that starts 'prior' OR equals\n    'comparative' OR contains the prior-FY tag are the prior\n    period.\n  * Everything else (including legacy unlabelled uploads) is the\n    current period.\nThe current archetype comes from the latest run; the prior\narchetype defaults to the same value (set\n``?prior_archetype=...`` to override when the entity changed\nclassification between periods, e.g. a manufacturer that became\nan NBFC).","operationId":"get_fs_preparation_comparative_api_engagements__engagement_id__fs_preparation_comparative_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/overrides":{"get":{"tags":["fs-preparation"],"summary":"List Account Overrides","description":"List preparer overrides currently in effect for this engagement.","operationId":"list_account_overrides_api_engagements__engagement_id__fs_preparation_overrides_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountOverrideOut"},"title":"Response List Account Overrides Api Engagements  Engagement Id  Fs Preparation Overrides Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["fs-preparation"],"summary":"Set Account Override","description":"Set or replace an override for a single TB-account name on\nthis engagement.  Idempotent: re-PUTting the same account_name\noverwrites the prior choice and refreshes set_by/set_at.","operationId":"set_account_override_api_engagements__engagement_id__fs_preparation_overrides_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOverrideReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOverrideOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fs-preparation"],"summary":"Delete Account Override","description":"Remove a single override.  ``account_name`` is the query\nparameter (so the URL doesn't need URL-encoded slashes).  After\nremoval the keyword rules apply again.","operationId":"delete_account_override_api_engagements__engagement_id__fs_preparation_overrides_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"account_name","in":"query","required":true,"schema":{"type":"string","title":"Account Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/source-candidates":{"get":{"tags":["fs-preparation"],"summary":"List Copy Source Candidates","description":"Sprint 72 / Sprint 83 (i): list engagements the preparer can\npick from when copying mappings.\n\nDEFAULT behaviour (Sprint 83): returns ONLY same-entity prior\nengagements (matched by client_id or legal_name).  This is what\nyear-over-year mapping copy is actually for — pulling last year's\nwork for this Company forward into this year.\n\nTo opt into the broader Sprint-72 behaviour (any engagement on\nthe same tenant), pass ``?include_other_entities=true``.  The\nMapping Engine UI exposes this as an explicit \"show other\nengagements\" expander rather than as the default view.\n\nExcludes the current engagement either way.","operationId":"list_copy_source_candidates_api_engagements__engagement_id__fs_preparation_source_candidates_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"include_other_entities","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Other Entities"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/overrides/copy-from-source":{"post":{"tags":["fs-preparation"],"summary":"Copy Overrides From Source","description":"Sprint 71 (B): copy FSLI + NLI overrides from another\nengagement (typically prior year on the same entity) to this one.\n\nFor each override in the source engagement:\n  * if the target's current TB contains an account with the same\n    name, and the target doesn't already have an override on\n    that account (unless overwrite=True), copy both\n    override_category and nli_code.\n  * otherwise skip and bump the appropriate counter.\n\nCuts mapping work for year 2+ engagements when the chart of\naccounts is stable.","operationId":"copy_overrides_from_source_api_engagements__engagement_id__fs_preparation_overrides_copy_from_source_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopyOverridesReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopyOverridesResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/mapping-diff":{"get":{"tags":["fs-preparation"],"summary":"Get Mapping Diff","description":"Sprint 71 (D): show what mappings have CHANGED between this\nengagement and a source engagement (typically prior year).\n\nFor every account that exists in either, returns:\n  { account_name, current, prior, status }\nwhere status is 'changed' / 'same' / 'added_in_current'\n/ 'removed_in_current'.  The auditor's first question - \"what\nmoved year over year and why\" - is answered in one screen.","operationId":"get_mapping_diff_api_engagements__engagement_id__fs_preparation_mapping_diff_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"source_engagement_id","in":"query","required":true,"schema":{"type":"string","title":"Source Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/apply-erp-template":{"post":{"tags":["fs-preparation"],"summary":"Apply Erp Template","description":"Apply a packaged ERP mapping template to this engagement.\n\nWalks the engagement's current TB account names; for every account\nmatching a template rule it seeds an override carrying both the\nstructured FSLI form (e.g. 'NCA:Property, plant and equipment')\nAND the NLI pin (e.g. 'I2BS.NCA.01.01').\n\nExisting overrides are NEVER touched unless ``overwrite=True`` is\nset explicitly, so re-running the apply is safe.  ``dry_run=True``\nreturns the same per-row response without writing.","operationId":"apply_erp_template_api_engagements__engagement_id__fs_preparation_apply_erp_template_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyErpTemplateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/face-heads":{"get":{"tags":["fs"],"summary":"List Face Heads","description":"Return every BS / P&L / OCI face head with its total +\nconstituent TB account lines.\n\nThe classifier is the same one used by the FS Pack workbook\ngenerator (``gmc_prism.engines.tb_face_head_mapping``), so the\nUI's drill-down totals reconcile exactly to the workbook.\n\nNumbers are returned in raw INR-cr (the unit the TB columns\npersist).  The caller (FaceStatementsPage) formats display using\nthe engagement's presentation_currency + default_scale via the\nSprint 14 ``fmtMoney`` helper.","operationId":"list_face_heads_api_engagements__engagement_id__fs_face_heads_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaceHeadsResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/balance-sheet":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Balance Sheet","description":"Consolidated BS: parent + linked subsidiary TBs (translated, joint\noperations at share) + elimination journals, from the shared\nperiod loader that every consolidated statement reads (CON-0.3).\n\nQuery param ``period`` is the TB period label (current/prior or\na Sprint 75 named period e.g. FY2024).","operationId":"get_consolidation_balance_sheet_api_engagements__engagement_id__consolidation_balance_sheet_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/balance-sheet/drilldown":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Drilldown","description":"Item 22 follow-up: for one face line of the consolidation matrix,\nreturn the TB-level constituents per entity column.\n\nQuery params:\n  * ``section`` — section code as it appears in the matrix\n    (NCA/CA/EQ/NCL/CL for Div II; FA/NFA/EQ/FL/NFL for Div III).\n  * ``line`` — face line label, e.g. \"Property, plant and equipment\".\n  * ``period`` — TB period label (defaults to \"current\"; pass\n    a Sprint 75 named period code such as \"FY2024\" if needed).\n\nResponse shape mirrors the matrix endpoint's per-entity column\nlayout so the UI can render the drilldown as expandable rows\nbeneath the clicked face-line row.","operationId":"get_consolidation_drilldown_api_engagements__engagement_id__consolidation_balance_sheet_drilldown_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"section","in":"query","required":true,"schema":{"type":"string","title":"Section"}},{"name":"line","in":"query","required":true,"schema":{"type":"string","title":"Line"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/profit-loss":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Profit Loss","description":"Consolidated Profit & Loss — same shape as /fs/pnl, but over the\nparent + linked sub TBs + IC eliminations.","operationId":"get_consolidation_profit_loss_api_engagements__engagement_id__consolidation_profit_loss_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/oci":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Oci","description":"Consolidated Other Comprehensive Income — parent + subs + elim.","operationId":"get_consolidation_oci_api_engagements__engagement_id__consolidation_oci_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/socie":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Socie","description":"Consolidated Statement of Changes in Equity — parent + subs + elim.\n\nprepare_socie takes explicit movement inputs (opening_equity,\npnl_net, oci_for_year, dividends_paid, share_movements) — it does\nNOT take a TB rows list.  We derive those inputs from the\nconsolidated TB: P&L net via prepare_pnl, OCI via prepare_oci,\nopening equity from the BS equity section, dividends + share\nmovements from BS reserves movements.","operationId":"get_consolidation_socie_api_engagements__engagement_id__consolidation_socie_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}},{"name":"closing_in_actuals","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Closing In Actuals"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/cash-flow":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Cash Flow","description":"Consolidated Cash Flow Statement — parent + subs + elim.\n\nCash Flow derivation is BS-movement-based (IAS 7 §10-§17 indirect\nmethod); the consolidated CFS is built from the consolidated BS\nrollup vs prior-period BS rollup.","operationId":"get_consolidation_cash_flow_api_engagements__engagement_id__consolidation_cash_flow_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/workings":{"get":{"tags":["consolidation"],"summary":"Get Consolidation Workings","description":"Opening, movement, closing and per-entity contributions for each\nconsolidation mechanism.\n\nItem (d): \"consolidation is a black box with no workings view and\nno way to intervene when it is wrong\", and the remedy it prescribes\nis workings FIRST — an override on top of a rollup nobody can see\nis how wrong numbers get frozen.  This is that view's data.\n\nNothing here is newly computed.  All three aggregators already\nexisted and were already correct; they were being called only by\nthe offline FS Pack hydrator and, for NCI, by the SOCIE endpoint.\nA reviewer looking at a consolidated statement on screen had no way\nto ask how a figure was built.\n\n``coverage`` sits at the top level per mechanism, deliberately.  A\nsubsidiary with no translation rate on file still contributes —\nunadjusted — and coverage drops to \"partial\" rather than the\nrollup failing.  That is a reasonable default for a draft and a\ndangerous one to meet only in a footnote, so it is stated before\nthe numbers.","operationId":"get_consolidation_workings_api_engagements__engagement_id__consolidation_workings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/openings/{subsidiary_id}/{kind}":{"put":{"tags":["consolidation"],"summary":"Put Consolidation Opening","description":"State the opening balance for one entity and mechanism.\n\nIn the first year on this tool there is no prior year IN the tool\nto derive an opening from, so the preparer states it.  Where the\nentity does have a prior-period trial balance here, the figure is\nchecked against a recomputation from it — see the workings\nresponse — and any difference must be corrected or explained.\n\n``source_note`` is required.  An opening balance a reviewer cannot\ntrace is a number with no evidence behind it, and this one feeds\nstraight into a roll-forward that reaches the face of the\nstatement of changes in equity.","operationId":"put_consolidation_opening_api_engagements__engagement_id__consolidation_openings__subsidiary_id___kind__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/openings/{subsidiary_id}/{kind}/resolve":{"put":{"tags":["consolidation"],"summary":"Resolve Consolidation Opening","description":"Accept a difference between the directed opening and the\nrecomputation, with a reason.\n\nA difference is not automatically an error.  An equity-method\ncarrying amount that includes acquisition goodwill will\nlegitimately exceed the group share of the investee's net assets,\nand a preparer who can say so should not be blocked.\n\nWhat is refused is a bare dismissal.  The reason is required, and\nthe acceptance is bound to the SPECIFIC pair of figures it\nexplains: the stored ``check_key`` hashes the directed amount\ntogether with the recomputed one, so changing either reopens the\ncheck.  An acceptance that outlives the thing it accepted is worse\nthan no acceptance at all.","operationId":"resolve_consolidation_opening_api_engagements__engagement_id__consolidation_openings__subsidiary_id___kind__resolve_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/overrides":{"get":{"tags":["consolidation"],"summary":"List Consolidation Overrides","description":"Every preparer override on this engagement's consolidation.","operationId":"list_consolidation_overrides_api_engagements__engagement_id__consolidation_overrides_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/consolidation/overrides/{subsidiary_id}/{kind}":{"put":{"tags":["consolidation"],"summary":"Put Consolidation Override","description":"Impose a period movement on one entity and mechanism.\n\nThe MOVEMENT is what gets overridden, never the closing figure.\nClosing = opening + movement, and the opening is already governed —\ncarried forward from what the tool closed at last year, or directed\nwith a source note.  Overriding the closing figure would break that\nidentity and leave a roll-forward whose own three numbers do not\nadd up, which is the defect the workings view exists to expose.\n\nWhat the engine currently computes is captured alongside, so a\nlater change to the underlying data can be reported as a **stale**\noverride rather than silently applied.  The reason was written\nabout a specific number; if that number moves, a human should\ndecide again.","operationId":"put_consolidation_override_api_engagements__engagement_id__consolidation_overrides__subsidiary_id___kind__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"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":["consolidation"],"summary":"Delete Consolidation Override","description":"Withdraw an override, returning the mechanism to what the\nengine computes.\n\nA hard delete is right here: the row is an instruction, not\nevidence.  What a preparer once imposed and then withdrew is not a\nfact about the group, and leaving a tombstone would make the\nworkings harder to read for no gain.","operationId":"delete_consolidation_override_api_engagements__engagement_id__consolidation_overrides__subsidiary_id___kind__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/eps-inputs":{"get":{"tags":["engagement-inputs"],"summary":"Get Eps Inputs","description":"Return the persisted EPS inputs blob (or null if none set).","operationId":"get_eps_inputs_api_engagements__engagement_id__eps_inputs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["engagement-inputs"],"summary":"Put Eps Inputs","description":"Validate + persist EPS inputs.\n\nReturns 400 with the engine's error message if from_dict\nrejects.  On success, persists and returns the round-tripped\npayload so the UI can confirm.","operationId":"put_eps_inputs_api_engagements__engagement_id__eps_inputs_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EpsInputsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lease-inputs":{"get":{"tags":["engagement-inputs"],"summary":"Get Lease Inputs","description":"Return the persisted lease inputs blob (or null if none set).","operationId":"get_lease_inputs_api_engagements__engagement_id__lease_inputs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["engagement-inputs"],"summary":"Put Lease Inputs","description":"Validate + persist lease inputs.\n\nReturns 400 with the engine's error message if from_dict rejects.","operationId":"put_lease_inputs_api_engagements__engagement_id__lease_inputs_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaseInputsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ecl-inputs":{"get":{"tags":["engagement-inputs"],"summary":"Get Ecl Inputs","description":"Return the persisted ECL inputs blob (or null if none set).\n\nThe 3-stage ECL register only applies to banking engagements;\nnon-bank engagements will simply persist null.","operationId":"get_ecl_inputs_api_engagements__engagement_id__ecl_inputs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["engagement-inputs"],"summary":"Put Ecl Inputs","description":"Validate + persist ECL inputs.\n\nReturns 400 with the engine's error message if from_dict rejects.","operationId":"put_ecl_inputs_api_engagements__engagement_id__ecl_inputs_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EclInputsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/retention":{"get":{"tags":["engagement-inputs"],"summary":"Get Engagement Retention","operationId":"get_engagement_retention_api_engagements__engagement_id__retention_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["engagement-inputs"],"summary":"Put Engagement Retention","operationId":"put_engagement_retention_api_engagements__engagement_id__retention_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/demo-request":{"post":{"summary":"Create Lead","description":"Persist a lead from the public landing-page demo-request form\nand notify the sales inbox via SMTP.  The Lead row is the source\nof truth; the email is best-effort.","operationId":"create_lead_api_leads_demo_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreateReq"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreateResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/clients":{"get":{"summary":"List Clients","operationId":"list_clients_api_tenants__tenant_id__clients_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Client","operationId":"create_client_api_tenants__tenant_id__clients_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ClientUpsertReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/clients/deleted":{"get":{"summary":"List Deleted Clients","description":"A view-only list of soft-deleted entities (ported from GMC-PRISM;\nclient feedback #12 / open question #5).  Owner-only, and\ndeliberately view-only -- no restore endpoint exists (an entity can\nbe re-created manually); this is for confirming what happened and\nwho did it, not undoing it.","operationId":"list_deleted_clients_api_tenants__tenant_id__clients_deleted_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/clients/{client_id}":{"get":{"summary":"Get Client","operationId":"get_client_api_clients__client_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Client","operationId":"update_client_api_clients__client_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ClientUpsertReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Client","operationId":"delete_client_api_clients__client_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/clients/{client_id}/kyc":{"post":{"summary":"Kyc Action","description":"Apply a KYC lifecycle action to the client.\n\nThe Big-4 standard onboarding-DD flow is:\n    NotStarted -> InProgress -> Completed\n                             -> Rejected\n    Completed  -> Expired (annual refresh missed)","operationId":"kyc_action_api_clients__client_id__kyc_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_KYCActionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/engagements":{"get":{"summary":"List Engagements","operationId":"list_engagements_api_tenants__tenant_id__engagements_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EngagementOut"},"title":"Response List Engagements Api Tenants  Tenant Id  Engagements Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Engagement","operationId":"create_engagement_api_tenants__tenant_id__engagements_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}":{"get":{"summary":"Get Engagement","operationId":"get_engagement_api_engagements__engagement_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Engagement","operationId":"update_engagement_api_engagements__engagement_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Engagement","operationId":"delete_engagement_api_engagements__engagement_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/readiness":{"get":{"summary":"Get Engagement Readiness","operationId":"get_engagement_readiness_api_engagements__engagement_id__readiness_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/ai-accept-velocity":{"get":{"summary":"Get Ai Accept Velocity","description":"Returns the user's AI Accept velocity counters used by the\nbulk-accept interstitial.  Computed from AuthEvent — no new\ntable.  Server-side counter so client JS can't game the\nthreshold by resetting in-memory state.","operationId":"get_ai_accept_velocity_api_users_me_ai_accept_velocity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAcceptVelocityResp"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/users/me/ai-bulk-attestation":{"post":{"summary":"Post Ai Bulk Attestation","description":"User clicked \"I confirm I reviewed each source\" in the velocity\ninterstitial.  Persists an AuthEvent so post-hoc EQCR analysis\ncan see which users were prompted + confirmed today (vs which\ncancelled and went back to one-at-a-time clicks).","operationId":"post_ai_bulk_attestation_api_users_me_ai_bulk_attestation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiBulkAttestReq"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/fs/{statement_code}/insights":{"get":{"summary":"Get Fs Insights","description":"Read cached narrative insights for a face statement.  Returns\n404 when none have been generated yet.  When they exist but the\ncached input_hash doesn't match the current face, returns the\ncached bullets with ``stale=True`` so the UI can show \"Face\nchanged — regenerate\" instead of stale commentary.","operationId":"get_fs_insights_api_engagements__engagement_id__fs__statement_code__insights_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement_code","in":"path","required":true,"schema":{"type":"string","title":"Statement Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsInsightResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/{statement_code}/insights/regenerate":{"post":{"summary":"Regenerate Fs Insights","description":"Fire the LLM, filter bullets to defensibility floor, persist\none row per (engagement, statement).  Rate-limited 1 call / 60s\nper engagement (reviewer condition — prevents spam-click LLM-bill\nleak).","operationId":"regenerate_fs_insights_api_engagements__engagement_id__fs__statement_code__insights_regenerate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement_code","in":"path","required":true,"schema":{"type":"string","title":"Statement Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsInsightResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/{statement_code}/insights/approval":{"patch":{"summary":"Patch Fs Insight Approval","description":"Partner approves or rejects the current insight bullets for a\nface statement.  Reset-on-regenerate semantics: the Sprint 2 upsert\nclears accepted_by_partner so the partner must re-approve after a\nnew run.  Rejection writes the reason to an AuthEvent for\npost-hoc EQCR review.","operationId":"patch_fs_insight_approval_api_engagements__engagement_id__fs__statement_code__insights_approval_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"statement_code","in":"path","required":true,"schema":{"type":"string","title":"Statement Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsInsightApprovalReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsInsightResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/overrides/ai-accept":{"post":{"summary":"Ai Accept Override","description":"Preparer accepted an AI mapping suggestion via the inline UI.\n\nReviewer-mandated audit trail captures all six provenance fields\n+ writes the AuthEvent that the UI's velocity counter reads to\ndecide when to surface the bulk-accept interstitial.\n\nSA 230 ¶A23 reproducibility: prompt_hash points back to\nai_prompt_registry which holds the literal system+user prompt\ntext used at suggestion time.","operationId":"ai_accept_override_api_engagements__engagement_id__overrides_ai_accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAcceptReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOverrideOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries":{"get":{"summary":"List Journal Entries","description":"Sprint 73: list JEs on this engagement (newest first).","operationId":"list_journal_entries_api_engagements__engagement_id__journal_entries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"include_drafts","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Drafts"}},{"name":"include_posted","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Posted"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JeOut"},"title":"Response List Journal Entries Api Engagements  Engagement Id  Journal Entries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Journal Entry","description":"Sprint 73: create a JE (draft or posted in one shot).\n\nValidation:\n  * each line must have exactly ONE of debit / credit > 0\n  * sum(debit) must equal sum(credit) within 0.01 INR tolerance\n  * at least 2 lines","operationId":"create_journal_entry_api_engagements__engagement_id__journal_entries_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JeCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries/template.xlsx":{"get":{"summary":" Download Je Import Template Route","operationId":"_download_je_import_template_route_api_engagements__engagement_id__journal_entries_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries/export.xlsx":{"get":{"summary":"Export Journal Entries Xlsx","description":"Export all non-deleted journal entries and their lines to Excel.","operationId":"export_journal_entries_xlsx_api_engagements__engagement_id__journal_entries_export_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries/{je_id}":{"get":{"summary":"Get Journal Entry","operationId":"get_journal_entry_api_engagements__engagement_id__journal_entries__je_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"je_id","in":"path","required":true,"schema":{"type":"string","title":"Je Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Journal Entry","operationId":"delete_journal_entry_api_engagements__engagement_id__journal_entries__je_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"je_id","in":"path","required":true,"schema":{"type":"string","title":"Je Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb-manual-rows":{"get":{"summary":"List Manual Tb Rows","operationId":"list_manual_tb_rows_api_engagements__engagement_id__tb_manual_rows_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Add Manual Tb Row","description":"Add a ledger to the trial balance.  The code and name must not\nalready be on the TB, and a period carries a debit or a credit.","operationId":"add_manual_tb_row_api_engagements__engagement_id__tb_manual_rows_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualTbRowReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb-manual-rows/{row_id}":{"delete":{"summary":"Delete Manual Tb Row","operationId":"delete_manual_tb_row_api_engagements__engagement_id__tb_manual_rows__row_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb-corrections":{"get":{"summary":"List Ledger Corrections","operationId":"list_ledger_corrections_api_engagements__engagement_id__tb_corrections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Ledger Correction","description":"Correct a ledger's name and / or account code.  The ledger must be a\nrow of the uploaded TB; the corrected name and code must not already\nbelong to another row.","operationId":"set_ledger_correction_api_engagements__engagement_id__tb_corrections_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerCorrectionReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb-corrections/{correction_id}":{"delete":{"summary":"Undo Ledger Correction","operationId":"undo_ledger_correction_api_engagements__engagement_id__tb_corrections__correction_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"correction_id","in":"path","required":true,"schema":{"type":"string","title":"Correction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries/{je_id}/post":{"post":{"summary":"Post Journal Entry","description":"Sprint 73: post a draft JE.  After posting, the lines feed\nthe FS engine on the next BS / P&L preparation.","operationId":"post_journal_entry_api_engagements__engagement_id__journal_entries__je_id__post_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"je_id","in":"path","required":true,"schema":{"type":"string","title":"Je Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/journal-entries/import-xlsx":{"post":{"summary":"Import Journal Entries Xlsx","description":"Bulk JE import.  Accepts the workbook produced by\n``/journal-entries/template.xlsx`` (filled in by the preparer).\n\nRows with the same ``JE Group`` value aggregate into a single JE.\nEach group must satisfy the same validation rules as the\ninteractive create endpoint: >= 2 lines, balanced (Dr == Cr\nwithin 0.01 INR), each line has either Dr > 0 OR Cr > 0.\n\nAll imported JEs land as drafts UNLESS ``post_now=true`` is set\non the query string (preparer's choice from the upload modal).\nGroups that fail validation are SKIPPED with the error surfaced;\nother valid groups still import.","operationId":"import_journal_entries_xlsx_api_engagements__engagement_id__journal_entries_import_xlsx_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"post_now","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Post Now"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_journal_entries_xlsx_api_engagements__engagement_id__journal_entries_import_xlsx_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JeImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/presentation/align-to-source":{"post":{"summary":"Align Presentation To Source","description":"4 Jun 2026: copy a SOURCE engagement's presentation settings\nAND face-head / NLI overrides onto THIS engagement so the two\nrender identically on the BS + P&L pages.\n\nTwo independent knobs:\n  * ``copy_settings`` (default True) mirrors the structural\n    presentation fields: framework, Sch III division override,\n    presentation_currency, default_scale, display_decimals,\n    industry / sub_industry.  These drive section ordering,\n    labels, and money formatting.\n  * ``copy_face_heads_and_nli`` (default True) walks the source\n    EngagementAccountOverride table and applies each row whose\n    ``account_name`` exists in the target's current TB.  Both\n    override_category (which carries face-head pin via the\n    \"Cat|FaceHead\" pipe encoding) and nli_code are copied.  Set\n    ``overwrite_overrides=False`` to fill blanks only.\n\nReturns a diff of what changed so the operator can sanity-check\nbefore re-running.\n\nCaller must have engagement.update on the target + engagement.view\non the source.","operationId":"align_presentation_to_source_api_engagements__engagement_id__presentation_align_to_source_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlignPresentationReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlignPresentationResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/mapping/fsli-catalogue":{"get":{"summary":"Get Fsli Catalogue","description":"Sprint 29: FSLI tree for the Mapping Engine override dropdown.\n\nReturns the framework-aware list of every BS line (grouped by\nsection: NCA / CA / EQ / NCL / CL for Div II + IFRS; FA / NFA /\nFL / NFL / EQ for NBFC Div III) plus every canonical IFRS 18 P&L\nface head (grouped by Operating / Investing / Financing /\nIncomeTaxes / DiscontinuedOps), plus OCI lines and the legacy\nbare-category fallbacks.\n\nOverride encoding the UI must use:\n  * BS line:        ``\"NCA:Property, plant and equipment\"``\n  * P&L face head:  ``\"Operating|Revenue from operations\"``\n  * OCI face head:  ``\"OCI|Remeasurements of defined benefit plans\"``\n  * Legacy:         ``\"Equity\"`` / ``\"Asset\"`` / ``\"Liability\"`` /\n                     ``\"Unknown\"``","operationId":"get_fsli_catalogue_api_engagements__engagement_id__mapping_fsli_catalogue_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/uploads/{upload_id}/ar-extract":{"post":{"summary":"Reextract Ar From Upload","description":"Re-run the AR auto-extractor against an existing AnnualReport\nupload.  Use when the original upload didn't produce extractions\n(e.g. the trigger fired before the KB chunk count was persisted,\nor the LLM hiccuped on the first pass).  Owners + OrgAdmins.\n\nIdempotent: existing rows for this (engagement, kind, fingerprint)\nare dedup-skipped, only NEW candidates are inserted.  The response\n`counts` reflects NEW rows only; zero counts on a re-run typically\nmean \"everything that could be extracted from this AR is already\nin the table\" (the dedup case) OR \"the AR's heading conventions\ndon't match the extractor's patterns\" (a real gap).","operationId":"reextract_ar_from_upload_api_engagements__engagement_id__uploads__upload_id__ar_extract_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArReextractResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-extractions":{"get":{"summary":"List Ar Extractions","description":"List AR-extracted candidates for this engagement.  Optional\nfilters by kind ('policy' | 'nli' | 'fsli') and status ('new' |\n'applied_per_engagement' | 'queued_for_global' | 'applied_global'\n| 'rejected').  Default returns all rows sorted newest-first.","operationId":"list_ar_extractions_api_engagements__engagement_id__ar_extractions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ArExtractionOut"},"title":"Response List Ar Extractions Api Engagements  Engagement Id  Ar Extractions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-extractions/{extraction_id}/apply-per-engagement":{"post":{"summary":"Apply Ar Extraction Per Engagement","description":"Approve a policy candidate for THIS engagement only.\n\nAfter approval the memo path picks up the extracted policy via\n``gmc_prism.ar_extractor.load_approved_policies_for_engagement``\nin addition to the bundled global library.  No global write.\n\nOnly valid on kind='policy'; other kinds must use\n/queue-for-global which routes through the global admin queue.","operationId":"apply_ar_extraction_per_engagement_api_engagements__engagement_id__ar_extractions__extraction_id__apply_per_engagement_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionActionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-extractions/{extraction_id}/queue-for-global":{"post":{"summary":"Queue Ar Extraction For Global","description":"Promote an extracted candidate (policy / nli / fsli) into the\nglobal admin-review queue.  Status becomes 'queued_for_global'.\n\nCommit 2 will wire the global admin to:\n  * approve queued policies into accounting_policy_library\n    (writes to disk + reseeds the in-process cache),\n  * approve queued NLIs into the v8 NLI catalogue (mirrors the\n    existing /api/catalogue-gaps/{id}/resolve eager-add path),\n  * approve queued FSLIs into the framework's FSLI catalogue\n    (new admin endpoint -- no current path exists for FSLI).","operationId":"queue_ar_extraction_for_global_api_engagements__engagement_id__ar_extractions__extraction_id__queue_for_global_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionActionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-extractions/{extraction_id}/reject":{"post":{"summary":"Reject Ar Extraction","description":"Dismiss a candidate as not-applicable.  Status becomes\n'rejected'.  The unique index on (engagement_id, kind,\nfingerprint) preserves the row so a future AR re-upload's\nextractor pass does NOT re-surface the same candidate.","operationId":"reject_ar_extraction_api_engagements__engagement_id__ar_extractions__extraction_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionActionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/ar-extractions/{extraction_id}/apply-global":{"post":{"summary":"Apply Ar Extraction To Global","description":"Promote a queued candidate into the global catalogue / policy\nlibrary.  Requires catalogue-manage capability (same gate as\n/api/catalogue-gaps/{id}/resolve).\n\nBehaviour by kind:\n  * policy -- inserts an AccPolicyTopic + ar_extracted variant\n              via acc_policy_library.apply_extracted_policy_to_global\n              scoped to the engagement's tenant.  Canonical only\n              if no canonical variant existed before.\n  * nli    -- NOT WIRED HERE today (Commit 2b).  Returns 501.\n              The NLI extractor will land its own resolve flow\n              via the existing /api/catalogue-gaps/{id}/resolve\n              endpoint when the gap is detected at TB-mapping time.\n  * fsli   -- NOT WIRED HERE today (Commit 2b).  Returns 501;\n              FSLI admin add-endpoint lands in 2b.","operationId":"apply_ar_extraction_to_global_api_engagements__engagement_id__ar_extractions__extraction_id__apply_global_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionActionReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArExtractionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-preparation/ai-suggest-overrides":{"post":{"summary":"Ai Suggest Account Overrides","description":"X-32 Phase C item 8: LLM-assisted TB grouping.\n\nWalks the engagement's current TB, runs the rule-library\ncategoriser, picks the accounts that fell to category=Unknown\nAND don't already have a user-set override, and asks the LLM to\npropose a category for each.  Returns proposals only — the user\naccepts each via the existing PUT override endpoint.\n\nPhase 2 hotfix (10K-account support): unknowns are now processed\nin batches of ``_AI_GROUPING_BATCH_SIZE`` (50) with a hard cap of\n``_AI_GROUPING_MAX_ACCOUNTS`` (10000), so a Maruti-Suzuki-shaped\nTB doesn't blow the output token budget and crash with \"AI\nreturned malformed JSON\".  Prompt caching keeps the per-batch\ncost low after the first call.","operationId":"ai_suggest_account_overrides_api_engagements__engagement_id__fs_preparation_ai_suggest_overrides_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGroupingResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/home":{"get":{"summary":"Get Firm Home","description":"X-25 / Phase 1F: aggregated read model for the firm-level\ndashboard (replaces the simple 'My Work' inbox).\n\nReturns:\n  * stats: counts the dashboard tiles need (active engagements,\n    clients, KYC pending, memos awaiting me, engagements at risk,\n    runs in last 7 days)\n  * my_engagements: top N most-recent engagements user belongs to\n  * recent_activity: last 10 audit-relevant events\n  * action_items: top items needing the user","operationId":"get_firm_home_api_me_home_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/tb/quality":{"get":{"summary":"Get Tb Quality","description":"Sprint 71 (A + E): TB quality summary.  Single endpoint that\nserves both the Mapping Engine top-of-page badge and the Quality\n& Review hub:\n\n  * total_debit / total_credit / diff / pct_off    (TB auto-tie)\n  * tie_status: 'ok' / 'warning' / 'fail'\n  * total_accounts                                  (count)\n  * mapped_count + unmapped_count + unmapped_pct    (completeness)\n  * overrides_count                                 (how many\n                                                      accounts the\n                                                      preparer pinned)\n  * stale_accounts: accounts with no movement vs prior period\n    AND the same closing balance as prior (helps spot dormant /\n    retired accounts that should be removed from the chart).\n\nThe auto-tie thresholds:\n  * |diff| <= 1 INR             -> ok      (rounding only)\n  * |diff| <= 0.1% of total Dr  -> warning (likely posting drift)\n  * else                        -> fail    (TB out of balance)","operationId":"get_tb_quality_api_engagements__engagement_id__tb_quality_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/overrides/stale":{"delete":{"summary":"Delete Stale Overrides","description":"13 Aug 2026 — clean up orphan EngagementAccountOverride rows.\n\nAn override becomes STALE when its account_name no longer appears\nin the current TB — common after re-uploading a TB with different\nrow naming, or when AR-extractor / AI-accept flows created overrides\nfor names that never landed as TB rows.  Nesarul flagged FSLI\nOVERRIDES=291 on an engagement with 97 TB rows; 194 of those were\norphans dragging the mapping-quality signal.\n\nRequires the preparer / OrgAdmin role.  Deletes rows outright (no\nsoft-delete flag on EngagementAccountOverride).  Returns the count\ndeleted so the FE can render a confirmation toast.","operationId":"delete_stale_overrides_api_engagements__engagement_id__overrides_stale_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb/coa-evolution":{"get":{"summary":"Get Tb Coa Evolution","description":"13 Jun 2026 — Phase E: chart-of-accounts evolution across\nperiods.\n\nCompares the set of account codes (+ display names) parsed from\nthe current-period TB uploads against the prior-period uploads\nand returns three buckets:\n\n  * ``new_in_current``  -- codes the prior period didn't carry;\n                            often indicates a Chart-of-Accounts\n                            addition.  Surface on the Mapping\n                            Engine so the preparer mapping a\n                            new account doesn't miss the prior-\n                            period parity check.\n  * ``dropped_in_current`` -- codes the prior had but current\n                            doesn't.  Often a discontinued\n                            account, ledger merge, or upload\n                            slice.  Useful for cleanup.\n  * ``retained``        -- common codes (count only; full list\n                            kept off the payload for size).\n\nReturns ``{\"new_in_current\": [...], \"dropped_in_current\": [...],\n\"retained_count\": <n>}`` plus the per-period code counts.\n\nReturns empty buckets when either period is missing -- this is\nNOT an error; the caller's UI just hides the panel.","operationId":"get_tb_coa_evolution_api_engagements__engagement_id__tb_coa_evolution_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb-mapping-export":{"get":{"summary":"Export Tb Mapping Xlsx","description":"Download the mapped TB: every account (current + prior) with its\nFSLI section / line and NLI code / name, as .xlsx (ported from\nGMC-PRISM, client feedback #26/#27).  Built from the same data the\nMapping Engine shows (api/tb_mapping_export.py); when the uploaded\nTB reads back, the export keeps its sheet and columns and appends\nthe mapping.","operationId":"export_tb_mapping_xlsx_api_engagements__engagement_id__tb_mapping_export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb/account-codes":{"get":{"summary":"Get Tb Account Codes","description":"Sprint 69: lightweight {account_name: account_code} map for the\ncurrent (or prior) trial balance.  The BS / Mapping Engine\nresponses carry account_name only - this endpoint surfaces the\noriginal TB code so the Mapping Engine table can display it\nalongside the name.\n\nSprint 70 fix: walks the workbook ourselves to extract both code\nAND name columns (the production parser drops the code), and\nindexes both exact-case AND lower-case keys for tolerant lookup.\n\nReturns: {\"engagement_id\": \"...\", \"period\": \"current\",\n          \"codes\": {\"<account_name>\": \"<code>\"} }","operationId":"get_tb_account_codes_api_engagements__engagement_id__tb_account_codes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/tb/periods":{"get":{"summary":"List Tb Periods","description":"Return distinct period_labels found across this engagement's\nTrialBalance uploads, plus the per-period row counts.  The\nMulti-period FS view uses this to populate its column picker.","operationId":"list_tb_periods_api_engagements__engagement_id__tb_periods_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/multi-period":{"get":{"summary":"Get Fs Multi Period","description":"Sprint 75: render BS + P&L for N parallel periods in one shot.\n\nQuery param ``periods`` is a comma-separated list of period_labels\nin DISPLAY order (left-to-right column order).  Typical values:\n  ?periods=current,prior                          (legacy 2-col)\n  ?periods=FY2024,FY2023,FY2022                   (Sch III 3-col)\n  ?periods=current,FY2023,FY2022                  (mix)\n\n29 May 2026 (live-tool reviewer AMBER 3.9): when called without\n``?periods=``, the endpoint used to return 422 with an empty\ndetail body — the UI had no idea what was missing.  Now degrades\ngracefully: defaults to \"current,prior\", and returns 200 with a\nsingle column + banner if only the current TB exists.\n\nReturns parallel section/line tables with one amount column per\nperiod; missing-period cells are returned as null so the UI can\nrender a gap rather than zero (avoids confusing the auditor when\na TB for that period simply wasn't uploaded).","operationId":"get_fs_multi_period_api_engagements__engagement_id__fs_multi_period_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"periods","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Periods"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/socie/template.xlsx":{"get":{"summary":"Download Socie Template","operationId":"download_socie_template_api_engagements__engagement_id__fs_socie_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/socie/import-xlsx":{"post":{"summary":"Import Socie Xlsx","description":"Bulk SOCIE adjustments import.  Each row creates one\nEngagementFsAdjustment with statement='SOCIE'.  Bad rows skip\nindividually with the error surfaced.","operationId":"import_socie_xlsx_api_engagements__engagement_id__fs_socie_import_xlsx_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_socie_xlsx_api_engagements__engagement_id__fs_socie_import_xlsx_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/refresh-fs":{"post":{"summary":"Refresh Fs Face","description":"Invalidate then warm the FS face cache for this engagement.\n\nOn success the response carries the cache metadata so the UI can\nrender \"Last refreshed: HH:MM\" + the per-statement priming status.\nPer-statement failures (e.g. BS imbalance, missing TB) do NOT fail\nthe whole request -- they're reported in the ``statements`` map\nand the user can retry after fixing the upstream issue.","operationId":"refresh_fs_face_api_engagements__engagement_id__refresh_fs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-face-cache/status":{"get":{"summary":"Get Fs Face Cache Status","description":"Return cache metadata + \"n mapping changes since last refresh\".\n\nPowers the \"Refresh FS\" button label / banner on the Mapping\nEngine + FS pages: ``cached`` tells the UI whether to show the\nbutton as \"warm\" (refresh now) or \"cold\" (first compute will be\nslow), ``pending_override_changes`` drives the \"N pending\" badge\nand the \"click Refresh FS to update face statements\" prompt.","operationId":"get_fs_face_cache_status_api_engagements__engagement_id__fs_face_cache_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/attribution":{"get":{"summary":"Get Fs Attribution","operationId":"get_fs_attribution_api_engagements__engagement_id__fs_attribution_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/ixbrl":{"post":{"summary":"Export Ixbrl","description":"Produce an Inline XBRL document for the engagement's FS.\n\nBuilt on the job worker (it prepares every face): this checks the\nscale, the TB and the reporting period, queues an ``ixbrl_export``\njob and answers 202.  The ``application/xhtml+xml`` document\ndownloads from ``GET /api/deliverable-jobs/{id}/download``; the\nuser opens it locally to view, or hands it to the MCA XBRL\nvalidator for SEBI filing.\n\n``scale`` accepts 0 (units), 3 (thousands), 5 (lakhs), 7 (crores).\nWave 3 C1 RED-3 / C5 RED-3: when omitted the scale derives from\nthe engagement's ``default_scale`` setting (Thousands / Lakhs /\nMillions / Crores / Billions) so a USD-Millions Tech engagement\nno longer emits with scale=3 hardcoded.","operationId":"export_ixbrl_api_engagements__engagement_id__fs_ixbrl_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"scale","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scale"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/group":{"get":{"summary":"Get Group Structure","description":"Return the engagement's subsidiary tree (top-level entities with\nchildren nested via ``children``).  Soft-deleted rows are skipped.","operationId":"get_group_structure_api_engagements__engagement_id__group_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupStructureResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Subsidiary","description":"Add a subsidiary to this engagement's group structure.","operationId":"create_subsidiary_api_engagements__engagement_id__group_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsidiaryCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsidiaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/group/parent-tax-rate":{"put":{"summary":"Put Parent Income Tax Rate","description":"CON-0.5: set or clear the parent's income-tax rate.","operationId":"put_parent_income_tax_rate_api_engagements__engagement_id__group_parent_tax_rate_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParentTaxRateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupStructureResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/group/{subsidiary_id}":{"patch":{"summary":"Update Subsidiary","description":"Partial update.  Setting ``parent_id`` is the slice-and-dice\noperation: move a step-sub to be a direct-sub of the parent (or up\nto root by setting parent_id=None).","operationId":"update_subsidiary_api_engagements__engagement_id__group__subsidiary_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsidiaryUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubsidiaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Subsidiary","description":"Soft-delete a subsidiary.  Blocks if it has live descendants -\nresponse shows the list so the UI can prompt 'reparent first'.","operationId":"delete_subsidiary_api_engagements__engagement_id__group__subsidiary_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"subsidiary_id","in":"path","required":true,"schema":{"type":"string","title":"Subsidiary Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/intercompany":{"get":{"summary":"List Intercompany","description":"List intercompany pairs for the engagement, optionally filtered\nby period_label.","operationId":"list_intercompany_api_engagements__engagement_id__intercompany_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntercompanyOut"},"title":"Response List Intercompany Api Engagements  Engagement Id  Intercompany Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Intercompany","operationId":"create_intercompany_api_engagements__engagement_id__intercompany_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercompanyCreateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercompanyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/intercompany/{ic_id}":{"patch":{"summary":"Update Intercompany","operationId":"update_intercompany_api_engagements__engagement_id__intercompany__ic_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"ic_id","in":"path","required":true,"schema":{"type":"string","title":"Ic Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercompanyUpdateReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercompanyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Intercompany","operationId":"delete_intercompany_api_engagements__engagement_id__intercompany__ic_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"ic_id","in":"path","required":true,"schema":{"type":"string","title":"Ic Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/group/template.xlsx":{"get":{"summary":"Download Group Template","operationId":"download_group_template_api_engagements__engagement_id__group_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/intercompany/template.xlsx":{"get":{"summary":"Download Ic Template","operationId":"download_ic_template_api_engagements__engagement_id__intercompany_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/group/import-xlsx":{"post":{"summary":"Import Group Structure Xlsx","description":"Bulk Group Structure import.  Accepts the workbook produced by\n``/group/template.xlsx``.  Rows are processed top-to-bottom so a\nlater row can reference an earlier row's Subsidiary Code as its\nParent Code; duplicate codes are skipped.","operationId":"import_group_structure_xlsx_api_engagements__engagement_id__group_import_xlsx_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_group_structure_xlsx_api_engagements__engagement_id__group_import_xlsx_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/intercompany/import-xlsx":{"post":{"summary":"Import Intercompany Xlsx","description":"Bulk Intercompany import.  Accepts the workbook produced by\n``/intercompany/template.xlsx``.  Subsidiary codes referenced\nmust already exist in the Group Structure (run the group import\nfirst, or seed manually).","operationId":"import_intercompany_xlsx_api_engagements__engagement_id__intercompany_import_xlsx_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_intercompany_xlsx_api_engagements__engagement_id__intercompany_import_xlsx_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb/template.xlsx":{"get":{"summary":"Download Non Tb Template","operationId":"download_non_tb_template_api_engagements__engagement_id__non_tb_template_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb/export.xlsx":{"get":{"summary":"Export Non Tb Inputs","description":"The Non-TB template with everything uploaded for the period\nwritten back in.\n\nSame workbook as \"Download template\" — cover, index, instructions,\nstyling, tables, formulas — with each uploaded value in the cell it\ncame from, so the preparer can edit it and upload it again.  Sheets\nnever uploaded stay blank, exactly as in the template.","operationId":"export_non_tb_inputs_api_engagements__engagement_id__non_tb_export_xlsx_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb/import-xlsx":{"post":{"summary":"Import Non Tb Xlsx","description":"Ingest a filled Non-TB input workbook.\n\nEvery data sheet (Cover / Index skipped) is parsed into a JSON\npayload and stored on EngagementNonTbInput.  A re-import replaces\nonly the sheets the workbook carries (superseded rows are\nsoft-deleted for the audit trail).\n\n5 Nov 2026 (owner review): the table also holds work saved in the\napp (disclosure forms from the Note Canvas, narrative overrides\n``NARR.*``, matrices ``MATRIX.*``, workpapers), all written with no\nsource file.  The import used to soft-delete every live row for the\nperiod, so a re-import wiped that work.  Now:\n  * sheets absent from the workbook, and every NARR.* / MATRIX.*\n    row, are never touched;\n  * a sheet the workbook leaves blank keeps what is already saved\n    for it, whether saved in the app or by an earlier upload (owner,\n    19 Nov 2026).  \"Blank\" is nothing filled, or unchanged from the\n    blank template - its printed labels count as filled rows, so\n    \"nothing filled\" alone rarely fires.  An app-saved sheet kept so\n    is listed under ``kept_app_edited``;\n  * when the workbook's sheet does carry data it replaces the saved\n    copy (latest wins); an app-saved copy replaced so is listed under\n    ``replaced_app_edited`` so the preparer is told.","operationId":"import_non_tb_xlsx_api_engagements__engagement_id__non_tb_import_xlsx_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_non_tb_xlsx_api_engagements__engagement_id__non_tb_import_xlsx_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb":{"get":{"summary":"List Non Tb Inputs","description":"Per-sheet summaries of the ingested Non-TB inputs (no payload —\nfetch /non-tb/{sheet_code} for the parsed blocks).","operationId":"list_non_tb_inputs_api_engagements__engagement_id__non_tb_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb-all":{"get":{"summary":"Get All Non Tb Payloads","description":"Every ingested Non-TB sheet WITH its parsed payload, in one call.\n\nThe FS Preview needs the disclosure sheets to render notes that no\ntrial balance can produce (contingent liabilities, EPS, related\nparty, the RBI SBR block).  Fetching them one sheet at a time\nwould be a 37-way fan-out on every pack load - the same pattern\nthat saturated the connection pool and 503'd the notes fetch\nbefore it was batched (task #139).  So this returns them together.","operationId":"get_all_non_tb_payloads_api_engagements__engagement_id__non_tb_all_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/non-tb/{sheet_code}":{"get":{"summary":"Get Non Tb Sheet","operationId":"get_non_tb_sheet_api_engagements__engagement_id__non_tb__sheet_code__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"sheet_code","in":"path","required":true,"schema":{"type":"string","title":"Sheet Code"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/snapshot":{"post":{"summary":"Generate Fs Snapshot","description":"Generate the FS Snapshot — PFS + IFRS 18 / Ind AS 118 Notes +\nTB Mapping — for an assessment-tier engagement.\n\nThe face payloads are sourced from the SAME live endpoints the UI\nconsumes (``/fs/balance-sheet``, ``/fs/pnl``, ``/fs/oci``,\n``/fs/socie``, ``/fs/cash-flow``, ``/fs/notes``) so the workbook is\nguaranteed to tie to the preparer's screen.  TB rows come from\n``_load_engagement_tb_accounts`` + ``_load_overrides`` — the same\nsources that power the live Mapping Engine page.\n\nBuilt on the job worker (ported from GMC-PRISM's queue): this does\nthe module gate, the capability and the succeeded-Run checks,\nqueues an ``fs_snapshot`` job and answers 202.  The job's ``result``\nis the former response body; ``files`` is the new Run file entry.","operationId":"generate_fs_snapshot_api_engagements__engagement_id__fs_snapshot_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Fs Snapshot Files","description":"List FS Snapshot deliverables previously generated for this\nengagement, most-recent first.  Mirror of ``list_fs_pack_files`` —\nsame files_json walk, scoped to ``kind == 'fs_snapshot'`` rows.","operationId":"list_fs_snapshot_files_api_engagements__engagement_id__fs_snapshot_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Fs Snapshot Files Api Engagements  Engagement Id  Fs Snapshot Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/disclosures/coverage":{"get":{"summary":"Get Disclosure Coverage","operationId":"get_disclosure_coverage_api_engagements__engagement_id__disclosures_coverage_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/peer-benchmark":{"get":{"summary":"Get Peer Benchmark","operationId":"get_peer_benchmark_api_engagements__engagement_id__peer_benchmark_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/disclosures":{"get":{"summary":"Get Disclosure Checklist","description":"X-25 Phase 1D: IFRS 18 Disclosure Checklist (10 canonical rows).\n\nEach row is checked against the engagement's memos; status\nbecomes 'Drafted' / 'Approved' / 'Not started' based on whether\na memo template matches and what its workflow_status is.","operationId":"get_disclosure_checklist_api_engagements__engagement_id__disclosures_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/overview":{"get":{"summary":"Get Engagement Overview","description":"X-25 / Phase 1B: engagement workspace dashboard.\n\nA single response that the new EngagementOverviewPage consumes:\nstat tiles, action items, pipeline status, recent runs.  This\nis the read model for the engagement workspace home; deeper\ndrill-down lives on the per-section pages (FS, Memos, etc.).","operationId":"get_engagement_overview_api_engagements__engagement_id__overview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/validations":{"get":{"summary":"Get Validation Dashboard","operationId":"get_validation_dashboard_api_engagements__engagement_id__validations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationDashboardResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/exec-summary":{"get":{"summary":"Get Exec Summary","description":"X-4.4 - One-page executive roll-up of an engagement.\n\nAggregates everything a partner / EQCR reviewer wants to see at a\nglance: identity, KYC posture, lifecycle, latest classification +\nconfidence tier, reconciliation health (blockers / overrides /\nEQCR pending), memo counts by status, and run / deliverable\nsummary.  This is the read model for the engagement summary\npage; the source of truth lives in the underlying tables /\n/lifecycle / /reconciliation endpoints.","operationId":"get_exec_summary_api_engagements__engagement_id__exec_summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/materiality/benchmark/{benchmark}":{"get":{"summary":"Get Materiality Benchmark Amount","description":"Sprint 87 (g) / Phase 0 Item 12: fetch the benchmark amount\n(PBT / Revenue / Total Assets / Total Expense) for an engagement.\n\nPhase 0 Item 12 fix: the reviewer wanted Annual-Report-extracted\namounts to take precedence over TB-derived figures because the\nAR is the authoritative published source.  We now read the\nEvidenceProfile (populated by the AR parser into\n``evidence_profile_json``) FIRST and fall back to TB only when\nthe AR-detected value is absent or low-confidence.\n\nReturns the amount in the engagement's CONFIGURED scale and\ncurrency (presentation_currency + default_scale).  Previously\nevery value was returned in INR crores which broke USD-reporting\nor Lakhs-rounded engagements.\n\nBest-effort: returns None when neither the AR nor TB carry the\nrelevant value; the UI then falls back to a manually-typed amount.","operationId":"get_materiality_benchmark_amount_api_engagements__engagement_id__materiality_benchmark__benchmark__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"benchmark","in":"path","required":true,"schema":{"type":"string","title":"Benchmark"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/materiality":{"get":{"summary":"Get Engagement Materiality","description":"30 May 2026 (Wave 3 C2 #6 fix): read-back endpoint for the\npartner-set materiality posture.  Returns ``{is_set: False}`` when\nno posture has been recorded so the FE can render the wizard's\n\"Set materiality\" empty state instead of 405-ing on every reload.","operationId":"get_engagement_materiality_api_engagements__engagement_id__materiality_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Clear Engagement Materiality","description":"30 May 2026 (Wave 3 C2 #6 fix): clear the partner-set\nmateriality posture (revert to auto-computed).  Same RBAC gate\nas the PUT.","operationId":"clear_engagement_materiality_api_engagements__engagement_id__materiality_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Set Engagement Materiality","description":"X-9: record the partner-set materiality posture for this\nengagement.  Restricted to Owner / EngagementLead / Approver.","operationId":"set_engagement_materiality_api_engagements__engagement_id__materiality_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaterialityReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/signatories":{"get":{"summary":"Get Engagement Signatories","description":"Return the signatory block for this engagement.  Empty dict\nwhen nothing has been recorded yet — FE renders the \"pending\nsignature\" placeholder rows.","operationId":"get_engagement_signatories_api_engagements__engagement_id__signatories_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Set Engagement Signatories","description":"Persist the signatory block.  Body: {\"signatories\": {...}}.\nGated by `engagement.update` — same capability that guards the\nEngagement Settings page.  Preparer edits are allowed until the\nengagement is signed off; downstream FS-freeze snapshots the\npayload alongside the face statements.","operationId":"set_engagement_signatories_api_engagements__engagement_id__signatories_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lock":{"get":{"summary":"Get Engagement Lock","description":"Return the current lock state.  Cheap, read-only - safe to\npoll from the FE.  Does NOT auto-release stale locks (acquire\npath does that).","operationId":"get_engagement_lock_api_engagements__engagement_id__lock_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lock/acquire":{"post":{"summary":"Acquire Engagement Lock","description":"Take or extend the editing lease.\n\nReturns 200 with the new lock state when:\n  * the engagement is currently free, OR\n  * the current holder is the caller (re-entrancy), OR\n  * the current holder's heartbeat has timed out (auto-released), OR\n  * ``force=true`` was passed (audited takeover).\n\nReturns 409 + the conflicting holder's identity otherwise so the\nFE can prompt the user with \"X is editing; force takeover?\".","operationId":"acquire_engagement_lock_api_engagements__engagement_id__lock_acquire_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lock/heartbeat":{"post":{"summary":"Heartbeat Engagement Lock","description":"Refresh the lease without re-acquiring.  No-op when the caller\nisn't the holder (returns 409 so the FE can prompt re-acquire).","operationId":"heartbeat_engagement_lock_api_engagements__engagement_id__lock_heartbeat_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lock/release":{"post":{"summary":"Release Engagement Lock","description":"Voluntarily release the lease.  No-op when the caller isn't the\nholder (returns the current state without error so the FE can\nfire-and-forget on page-unload).","operationId":"release_engagement_lock_api_engagements__engagement_id__lock_release_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/roll-forward":{"post":{"summary":"Roll Forward Engagement","description":"X-58 Sprint 17: clone an engagement for the next reporting\nperiod.  Carries STRUCTURAL inputs forward, BLANKS transactional\ninputs, ADVANCES the code year + first_ifrs18_year_end by one\nyear.\n\nStructural copies (carry forward):\n  - Engagement scalar fields: legal_name, industry, sub_industry,\n    framework, jurisdictions, listing/regulator flags,\n    classification flags, client_master_id, presentation_currency,\n    default_scale, attestation_method, EQCR partner, auditor of\n    record, going-concern flag, group/standalone flag.\n  - engagement_group_structure (subsidiary tree, NCI %, acquisition\n    dates, parent_id self-references re-mapped).\n  - engagement_translation_rate (subsidiary FK + rate_kind +\n    period_label structure copied; rate values blanked so the\n    preparer enters fresh FY+1 rates).\n  - mpm_items if copy_mpms=True (MPM definitions persist; values\n    are recomputed against the new TB).\n  - engagement_erp_connector if copy_erp_connectors=True\n    (encrypted creds carry; last_sync_* fields reset).\n\nBlanked (start fresh):\n  - revenue_inr_cr, evidence_profile_json, reconciliation_*,\n    materiality_json, llm_augmentation_json, lifecycle/audit\n    json, attestation envelope state, last_run_at.\n  - engagement_intercompany, engagement_pnl_adjustments,\n    engagement_fs_adjustments, engagement_reclassification.\n  - uploads (new TB / AR uploaded for new year).\n  - runs, audit_events (new pipeline run for new year).","operationId":"roll_forward_engagement_api_engagements__engagement_id__roll_forward_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollForwardReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollForwardResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs-period":{"put":{"summary":"Confirm Fs Period","description":"Adopt a reporting period as the one the FS cover.\n\nWhy this exists rather than the full engagement PATCH: after\nIND-37 every engagement on the platform resolved its period from\nsomewhere other than ``fs_period`` - 57 read off the legacy\nyear-end string, 28 from nothing at all - and NONE had a stated\none.  The dates the tool derives are usually right; what was\nmissing was a way for a preparer to say so without retyping them\ninto a twenty-field form.\n\nThis is deliberately NOT a backfill.  A migration writing those 57\ninferences into ``fs_period`` would make a guess indistinguishable\nfrom a preparer's statement, which is the exact property the\n``source`` stamp exists to preserve.  A human pressing confirm is\nwhat turns one into the other, and that is a different act from\nthe tool assuming consent.\n\nOmitting both dates confirms whatever the resolver currently reads,\nwhich is the one-click case; supplying them sets those instead.","operationId":"confirm_fs_period_api_engagements__engagement_id__fs_period_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FsPeriodConfirmReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Fs Period Api Engagements  Engagement Id  Fs Period Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/edit-form":{"get":{"summary":"Get Engagement Edit Form","operationId":"get_engagement_edit_form_api_engagements__engagement_id__edit_form_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/overrides/refresh-from-uploads":{"post":{"summary":"Refresh Overrides From Uploads","description":"Re-run the SAP-FSLI + classification-aware detectors against every\nexisting TrialBalance upload on the engagement and persist any\nauto-derived overrides.  Solves the \"I uploaded before the fix\nwent live\" case (no re-upload required).\n\nReturns counts + per-upload breakdown so the FE can show a\nconfirmation toast.","operationId":"refresh_overrides_from_uploads_api_engagements__engagement_id__overrides_refresh_from_uploads_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/signals":{"get":{"summary":"Get Signals","operationId":"get_signals_api_engagements__engagement_id__signals_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/extract-evidence":{"post":{"summary":"Extract Evidence Endpoint","description":"Run the notes-aware extractor + reconciliation; persist both.","operationId":"extract_evidence_endpoint_api_engagements__engagement_id__extract_evidence_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/reconciliation":{"get":{"summary":"Get Reconciliation","description":"29 May 2026 (live-tool reviewer AMBER 3.10): used to return\n404 when no reconciliation report existed — broke the UI page\nthat backs this endpoint.  Now returns an EMPTY SKELETON with\n`reconciliation_report: null` so the UI can render the \"no\nreport yet — run extract-evidence\" empty state instead of\nblowing up with a 404.","operationId":"get_reconciliation_api_engagements__engagement_id__reconciliation_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/reconciliation/items/{item_idx}/resolve":{"post":{"summary":"Resolve Reconciliation Item","operationId":"resolve_reconciliation_item_api_engagements__engagement_id__reconciliation_items__item_idx__resolve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"item_idx","in":"path","required":true,"schema":{"type":"integer","title":"Item Idx"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ResolveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/reconciliation/items/{item_idx}/reopen":{"post":{"summary":"Reopen Reconciliation Item","description":"X-32 Phase D item 1: re-open a previously-resolved reconciliation\nitem.  Partner-role users only (Owner / Approver / EngagementLead).\n\nClears the resolution + EQCR fields, restores the item status,\nre-increments blockers_unresolved if the item was a blocker that\nhad previously cleared.  Audit-logged with reason.","operationId":"reopen_reconciliation_item_api_engagements__engagement_id__reconciliation_items__item_idx__reopen_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"item_idx","in":"path","required":true,"schema":{"type":"integer","title":"Item Idx"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReopenBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/reconciliation/items/{item_idx}/eqcr":{"post":{"summary":"Eqcr Concurrence","operationId":"eqcr_concurrence_api_engagements__engagement_id__reconciliation_items__item_idx__eqcr_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"item_idx","in":"path","required":true,"schema":{"type":"integer","title":"Item Idx"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_EQCRBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/reconciliation/lock":{"post":{"summary":"Lock Reconciliation","operationId":"lock_reconciliation_api_engagements__engagement_id__reconciliation_lock_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lifecycle":{"get":{"summary":"Get Engagement Lifecycle","operationId":"get_engagement_lifecycle_api_engagements__engagement_id__lifecycle_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/lifecycle/transition":{"post":{"summary":"Transition Engagement Lifecycle","operationId":"transition_engagement_lifecycle_api_engagements__engagement_id__lifecycle_transition_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_LifecycleTransitionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/runs":{"get":{"summary":"List Runs","operationId":"list_runs_api_engagements__engagement_id__runs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunOut"},"title":"Response List Runs Api Engagements  Engagement Id  Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Run","description":"Sprint 3: this endpoint is now ASYNCHRONOUS.\n\nWe insert a Run row with status='queued' and return immediately\nwith HTTP 202 Accepted.  The background worker (started in\n`lifespan`) picks it up and executes the pipeline, updating\nprogress_percent and progress_step every few seconds.\n\nClients should poll GET /api/runs/{id} every ~2 seconds and\nrender a progress bar.  When status reaches 'succeeded' or\n'failed', the run is terminal.\n\nThe previous synchronous behaviour is preserved on the worker\nside - all the engine code is unchanged - we have simply moved\nexecution off the request thread.","operationId":"create_run_api_engagements__engagement_id__runs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}":{"get":{"summary":"Get Run","operationId":"get_run_api_runs__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Run","description":"31 May 2026 (PV2-4): delete a run + its deliverable outputs.\n\nRemoves the Run row plus any output files on the local volume\n(best-effort -- missing files don't fail the delete).  Memo\nrecords are cascaded via FK; storage-mirrored outputs are NOT\nauto-deleted from remote object storage (operator must use the\nstorage console for that).\n\nGuards:\n  * Cannot delete a run that's still in 'queued' or 'running'\n    state -- caller should cancel via job_worker first.\n  * RBAC capability ``run.execute`` (same capability that\n    creates runs -- creator can delete).","operationId":"delete_run_api_runs__run_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/runs/diff":{"get":{"summary":"Diff Engagement Runs","description":"Return a structured diff between two runs of the same engagement.\n\nQuery params:\n  * base_run_id    - the earlier / \"from\" run\n  * compare_run_id - the later / \"to\" run\n\nBoth runs must belong to the engagement; cross-engagement diffs\nare rejected (404 on the mismatched run).\n\nReturns:\n  {\n    \"engagement_id\": ...,\n    \"base\": {summary fields},\n    \"compare\": {summary fields},\n    \"metadata_changes\": [{field, base, compare}],\n    \"deliverables\": {added, removed, common, ...},\n    \"had_status_change\": bool,\n    \"duration_delta_seconds\": Optional[int],\n  }","operationId":"diff_engagement_runs_api_engagements__engagement_id__runs_diff_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"base_run_id","in":"query","required":true,"schema":{"type":"string","title":"Base Run Id"}},{"name":"compare_run_id","in":"query","required":true,"schema":{"type":"string","title":"Compare Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}/profile":{"get":{"summary":"Get Run Profile","description":"Sprint 34: per-module timing + LLM call breakdown for a Run.\n\nUsed by the Run detail page's Performance panel to answer 'where\ndid the time go?' on slow Assessment Runs.","operationId":"get_run_profile_api_runs__run_id__profile_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/docs/audit-defensibility":{"get":{"summary":"Get Audit Defensibility Doc","operationId":"get_audit_defensibility_doc_api_docs_audit_defensibility_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/samples/{filename}":{"get":{"summary":"Get Public Sample File","description":"Serve a curated public sample file.  Used by the first-run\nbanner (\"Download a sample TB\") + the /ifrs18 landing page CTAs.\nFilenames are whitelisted (no path traversal possible).","operationId":"get_public_sample_file_api_samples__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}/files/{filename}":{"get":{"summary":"Download Run File","description":"Run-scoped download.  Verifies ownership of the engagement AND\nthat the filename actually belongs to this run (CYB-01 fix).\nFiles are served from the run's own output directory\n(outputs/<engagement_id>/<run_id>/...) — see P0.1.","operationId":"download_run_file_api_runs__run_id__files__filename__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}/files/{filename}/preview":{"get":{"summary":"Preview Run File","description":"X-55: render a run deliverable as inline-viewable HTML / PDF.\n\nSame auth + ownership checks as the download endpoint - we just\nserialise the content differently so the UI can show it in an\niframe / modal without forcing a download.","operationId":"preview_run_file_api_runs__run_id__files__filename__preview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/tb":{"get":{"summary":"Download Tb Template","description":"X-56: serve the canonical Trial Balance + Chart-of-Accounts\ntemplate (Ind AS / Schedule III Division II + IFRS 18 aligned).\n\nNo engagement-scoping — this is the tenant-admin / generic\nfallback that ships all frameworks mixed.  For in-engagement\ndownloads the UI uses ``/api/engagements/{id}/tb-template`` which\nfilters the Dropdowns sheet to the engagement's framework +\ndivision.","operationId":"download_tb_template_api_templates_tb_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/tb-template":{"get":{"summary":"Download Engagement Tb Template","description":"4 Jul 2026 (Sprint TB-hard) — engagement-scoped TB template.\n\nReads the engagement's ``framework`` + ``schedule_iii_division``\n(with fallback to auto-detect from other fields) and hands them\nto ``build_template`` so the Dropdowns sheet only lists FSLI /\nNLI rows valid for THIS engagement.  Always regenerated on the\nfly against the latest v8 catalogue on disk — no stale caching.\n\n6 Jul 2026 (roundtrip hotfix — VPPL bug): if the engagement\nalready has ``EngagementAccountOverride`` rows (from any\nprevious mapping — manual, AI, prior template upload), those\nnow pre-populate the Trial_Balance sheet so a\ndownload → edit → re-upload roundtrip round-trips cleanly.","operationId":"download_engagement_tb_template_api_engagements__engagement_id__tb_template_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/certificates/{filename}":{"get":{"summary":"Download My Cert","description":"Personal-scoped download for training certificates issued via\n``/api/train``.\n\nC8 fix: cross-check filename against ``LearnerCertificate`` rows\nowned by the current user before serving. Earlier the docstring\npromised this check but the code didn't enforce it, so any\nauthenticated user could download any cert by guessing the\nfilename. The filename now must match a row this user owns.","operationId":"download_my_cert_api_me_certificates__filename__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/train":{"post":{"summary":"Train","description":"Legacy demo endpoint: issues a perfect-score certificate for the\nrequested tier.  Kept for backward compatibility with the early\nTraining UI; the new learner flow uses /api/courses + /api/me/...\n\nC9 fix (Sprint 6): persist a LearnerCertificate row.  Without this\nthe cert PDF was issued but the verifier (/api/verify) returned\n\"unknown cert\" and the \"my certificates\" view didn't list it,\nbecause nothing wrote a row to learner_certificates.","operationId":"train_api_train_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/courses":{"get":{"summary":"List Courses","description":"Public catalogue of training courses.  Auth-gated only so the\naudience tags don't leak to the open internet.","operationId":"list_courses_api_courses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CourseSummaryOut"},"type":"array","title":"Response List Courses Api Courses Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/courses/{course_id}":{"get":{"summary":"Get Course","operationId":"get_course_api_courses__course_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string","title":"Course Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseDetailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/courses/{course_id}/quiz":{"get":{"summary":"Get Course Quiz","operationId":"get_course_quiz_api_courses__course_id__quiz_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string","title":"Course Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuizOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/courses/{course_id}/quiz/submit":{"post":{"summary":"Submit Course Quiz","operationId":"submit_course_quiz_api_courses__course_id__quiz_submit_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string","title":"Course Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuizSubmitReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuizResultOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/progress":{"get":{"summary":"My Progress","operationId":"my_progress_api_me_progress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgressOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/me/certificates":{"get":{"summary":"My Certificates","operationId":"my_certificates_api_me_certificates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CertificateOut"},"type":"array","title":"Response My Certificates Api Me Certificates Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"summary":"Issue My Certificate","description":"Issue a real (not demo) certificate after the user has passed\nevery course required for the requested tier.","operationId":"issue_my_certificate_api_me_certificates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueCertificateReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/ai/ask":{"post":{"summary":"Ai Ask","description":"Answer a free-form IFRS 18 / Ind AS 118 question using the KB.\n\nPattern:\n  1. KB retrieval is always run -- this is the citation backbone\n     and works even when the LLM is offline / unconfigured.\n  2. If the LLM is configured we build a tightly-scoped system\n     prompt + KB context + (optional) engagement metadata and\n     call llm_client.complete().  Tenant consent is enforced\n     only when an engagement_id is supplied (because that's\n     when the prompt would carry client PII like legal name).\n  3. We never raise on LLM failure -- the user still gets\n     deterministic KB references plus an `llm_unavailable_reason`\n     string so the UI can explain.","operationId":"ai_ask_api_ai_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/memos/{memo_id}/approve":{"post":{"tags":["memos-workflow"],"summary":"Approve Memo","operationId":"approve_memo_api_memos__memo_id__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoRecordOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/reject":{"post":{"tags":["memos-workflow"],"summary":"Reject Memo","operationId":"reject_memo_api_memos__memo_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoRecordOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}":{"delete":{"tags":["memos-workflow"],"summary":"Delete Memo","description":"Soft-delete a memo.\n\nPermitted to:\n  * the drafter (the user who triggered the run that produced it),\n  * any Tenant Admin / Workspace Owner,\n  * the system-level admin.\n\nRejected for Approved memos - those are signed off and must\nsurvive in the working papers; if you need to invalidate an\napproved memo, raise a memo review note instead.","operationId":"delete_memo_api_memos__memo_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_MemoDeleteReq"},{"type":"null"}],"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Memo","operationId":"get_memo_api_memos__memo_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoBodyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/board-report":{"get":{"summary":"Board Report","description":"Firm-wide AC-pack roll-up.\n\nReturns: total engagements, lifecycle breakdown, KYC posture\ncounts, sanctions hits, materiality coverage, LLM cost since\nfiscal-year start (1 April), top framework-gap categories, and\nAC-pending memo counts.","operationId":"board_report_api_tenants__tenant_id__board_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/data-export":{"post":{"summary":"Request Data Export","description":"DPDP §11: queue a data-portability export for this workspace.\n\nAuthorisation: caller must be on the tenant AND have the\n``tenant.invite_member`` capability (i.e. Owner/admin) - this is\na high-impact disclosure that needs an Owner's deliberate act.\n\nThe ZIP (every engagement's uploads and deliverables, then a\nSHA-256 pass over it) can run long for a large workspace, so it is\nbuilt on the job worker (ported from GMC-PRISM): this queues the\nrequest (status 'Pending') and answers 202.  Poll\n``GET /api/tenants/{tenant_id}/data-export``; the row moves through\nBuilding to Ready (or Failed), then ``/download`` serves it.","operationId":"request_data_export_api_tenants__tenant_id__data_export_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataExportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Data Exports","description":"List historical export requests for this workspace.  Useful\nfor an audit trail in the UI.","operationId":"list_data_exports_api_tenants__tenant_id__data_export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataExportOut"},"title":"Response List Data Exports Api Tenants  Tenant Id  Data Export Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/data-export/{request_id}/download":{"get":{"summary":"Download Data Export","description":"Stream the built ZIP back to the caller.\n\nRefuses if:\n  * the request belongs to a different tenant (403)\n  * status is not 'Ready' (409)\n  * the export file is gone or expired (410)","operationId":"download_data_export_api_tenants__tenant_id__data_export__request_id__download_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/audit-export":{"post":{"summary":"Tenant Audit Export","description":"Self-service export of THIS tenant's own audit trail (its\naudit_logs rows + its members' auth_events) -- e.g. to hand to an\nexternal auditor (ported from GMC-PRISM). Synchronous (see\napi/audit_export.py's docstring for why this doesn't need a\nbackground job). Platform-admin cross-tenant export is\nPOST /api/admin/audit-export instead.","operationId":"tenant_audit_export_api_tenants__tenant_id__audit_export_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/close":{"get":{"summary":"Get Account Closure","description":"Return this user's active closure request, or null if none.","operationId":"get_account_closure_api_account_close_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AccountClosureOut"},{"type":"null"}],"title":"Response Get Account Closure Api Account Close Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"summary":"Request Account Closure","description":"DPDP §12: open an account-closure request with a cooling-off\nwindow.  The user must:\n  1. Re-prove their password here (defence against a stolen JWT\n     being used to nuke the account).\n  2. Hit /confirm during the cooling-off window for the deletion\n     to actually run.\n  3. Or hit DELETE /close to cancel before the window closes.\n\nA single active request per user; if one already exists this\nreturns 409 with the existing request.","operationId":"request_account_closure_api_account_close_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseAccountReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountClosureOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"summary":"Cancel Account Closure","description":"Cancel a pending closure request before it's executed.","operationId":"cancel_account_closure_api_account_close_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountClosureOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/account/close/confirm":{"post":{"summary":"Confirm Account Closure","description":"Confirm a previously-requested closure.  Requires step-up MFA\nif the user has TOTP enrolled - this is the most destructive\nself-service action in the system, by far.\n\nThe deletion runs IMMEDIATELY on confirm (the cooling-off window\nis for catching mistakes / coercion - once the user has had time\nto think about it AND comes back to confirm, we honour the\nrequest).  After execution, the user's session is dead.","operationId":"confirm_account_closure_api_account_close_confirm_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountClosureOut"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/me/engagements":{"get":{"summary":"List My Engagements","description":"Big-4 'Engagements' top-level: flat list across the user's firms.\n\n29 Jun 2026 (perf P2): optional ``?page`` + ``?page_size`` for\npaginated reads.  When omitted, returns up to\n``_LIST_DEFAULT_PAGE_SIZE`` rows (500) — the historical\n\"unbounded\" behaviour now silently capped.  Cap-hits log a\nwarning so we know when to wire UI pagination controls.","operationId":"list_my_engagements_api_me_engagements_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id"}},{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EngagementOut"},"title":"Response List My Engagements Api Me Engagements Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/clients":{"get":{"summary":"List My Clients","description":"Big-4 'Clients' top-level: flat client roster across the user's\nfirms.  Each row carries ``tenant_id`` so the UI can render a\nFirm column when the user belongs to >1 firm.\n\n29 Jun 2026 (perf P2): same paging safety cap as\n``/api/me/engagements`` — see ``_resolve_list_paging``.","operationId":"list_my_clients_api_me_clients_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"firm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Id"}},{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/firms":{"get":{"summary":"List My Firms","description":"Lightweight list of the firms (tenants) the user belongs to.\nUsed by the UI to decide whether to show a 'Firm' column / picker\n(skip when len == 1).","operationId":"list_my_firms_api_me_firms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/me/inbox":{"get":{"summary":"My Work Inbox","description":"X-4.2 / GATE-3 nice-to-have - unified 'My Work' inbox with\npagination.\n\nAggregates pending actions across the user's accessible tenants:\n\n  * memos_pending_review     - memos in Drafted / AssignedForReview /\n                               UnderReview / NotesRaised\n  * recons_pending_eqcr      - reconciliation items where\n                               eqcr_concurrence_required is True\n                               and concurrence not yet recorded\n  * engagements_kyc_blocked  - engagements bound to a client whose\n                               KYC isn't Completed (so the\n                               engagement is stuck in Draft)\n  * engagements_for_review   - engagements in CLIENT_REVIEW or\n                               READY_FOR_REVIEW awaiting partner\n                               sign-off\n\nPagination: each list is independently paginated via the same\n``page`` / ``page_size`` params (page is 1-indexed; page_size\nclamped to [1, 100]).  The response carries a ``page_info``\nblock per stream with ``total`` / ``page`` / ``page_size`` /\n``has_more`` so the UI can render correct chevrons.","operationId":"my_work_inbox_api_me_inbox_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/inbox":{"get":{"summary":"Memos Inbox","description":"Memos awaiting any kind of action by the current user.\n\nReturns the union of:\n  * memos in any of my workspaces with workflow_status in\n    ('Drafted', 'AssignedForReview', 'UnderReview', 'NotesRaised')\n  * limited to 50 most recent\n\nSprint 30: when ``engagement_id`` is passed, the result is scoped\nto that single engagement (so /engagements/:id/memos shows only\nthat client's memos).  Without the param, the firm-level\ncross-engagement inbox is returned (used by /memos).","operationId":"memos_inbox_api_memos_inbox_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MemoRecordOut"},"title":"Response Memos Inbox Api Memos Inbox Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/runs/{run_id}/memos":{"get":{"summary":"List Run Memos","operationId":"list_run_memos_api_runs__run_id__memos_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MemoRecordOut"},"title":"Response List Run Memos Api Runs  Run Id  Memos Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/diff":{"get":{"summary":"Diff Memo Against","description":"Return a section-by-section paragraph diff between this memo\nrecord and another memo record (typically the prior pipeline-run\nversion).  Both records must belong to the same engagement and\nthe same template.\n\nIf `against` is None, the diff is taken against the most recent\nPRIOR run for the same (engagement_id, template).  Returns 404\nif no prior version exists.","operationId":"diff_memo_against_api_memos__memo_id__diff_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}},{"name":"against","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Against"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/assign-reviewer":{"post":{"summary":"Assign Reviewer","operationId":"assign_reviewer_api_memos__memo_id__assign_reviewer_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignReviewerReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoRecordOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/notes":{"post":{"summary":"Raise Note","operationId":"raise_note_api_memos__memo_id__notes_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseNoteReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoBodyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/notes/{note_id}/clear":{"post":{"summary":"Clear Note","operationId":"clear_note_api_memos__memo_id__notes__note_id__clear_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}},{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClearNoteReq"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoBodyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memos/{memo_id}/sections":{"patch":{"summary":"Edit Memo Sections","description":"Edit one or more memo sections in place.\n\nSections allowed: background, question, guidance, analysis,\nalternatives, conclusion, disclosure_implications, title.\n\nWorkflow gates:\n  * Status must NOT be Approved or Rejected (those are locked).\n  * SoD: drafter / reviewer / approver can all edit a memo\n    in a working state, but the existing approve flow remains\n    guarded by step-up MFA + drafter-cannot-approve checks.","operationId":"edit_memo_sections_api_memos__memo_id__sections_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"memo_id","in":"path","required":true,"schema":{"type":"string","title":"Memo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoSectionPatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoBodyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/memos/regenerate-deliverables":{"post":{"summary":"Regenerate Memo Deliverables","description":"Re-emit memo-driven deliverables from the current MemoRecord\nrows in the database, so user edits propagate without re-running\nthe full M1→M9 pipeline.\n\nCurrently regenerates:\n  * Technical Memo Set DOCX  (memo content)\n\nFuture scope (X-29+):\n  * Engagement Summary DOCX  (memo summaries)\n  * Audit Bundle .zip        (re-seal with new files)\n\nEach regen appends a fresh file to the latest run's files_json\nso the engagement deliverables UI surfaces the new file.  The\noriginal files are preserved so the audit chain remains intact;\nyou can see the v1 alongside the v2.\n\nRuns on the job worker (ported from GMC-PRISM): this queues a\n``memos`` DeliverableJob and answers 202; the job's ``result`` is\nthe former response body.","operationId":"regenerate_memo_deliverables_api_engagements__engagement_id__memos_regenerate_deliverables_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/memos/finalize":{"post":{"summary":"Finalize Memo","description":"X-58 Sprint 10: accept every pending track-change in the\nchosen memo revision, write a FINAL.docx companion to the run\ndirectory, and flip every other technical_memo rev's\n``is_archived`` flag so non-admin users only see the canonical\nFINAL.\n\nWorkflow per Nesar's directive (\"Memo for Tega is in track\nchanges which needs to be finalised; new edits should also appear\nas track changes; only final memo stays in the memo section;\nearlier versions sit in admin-only folder until deleted\"):\n\n  1. Locate the chosen rev file in the latest succeeded run.\n  2. Read the docx — if it has no pending revisions, we still\n     tag a FINAL copy (audit-trail: which rev was the canonical\n     one).\n  3. Strip <w:ins>/<w:del>/<w:moveFrom>/<w:moveTo>/marker tags\n     via docx_track_changes.accept_all_track_changes.\n  4. Save as ``{engagement_id}_Technical_Memos_FINAL.docx`` in\n     the same run directory.  Overwrites any prior FINAL — the\n     finalize action is idempotent.\n  5. Append a fresh entry to files_json with\n     ``kind=\"technical_memos_final\"`` + ``is_final=true``;\n     flip ``is_archived=true`` on every other\n     technical_memos / technical_memos_revised entry.\n  6. Emit an audit event.","operationId":"finalize_memo_api_engagements__engagement_id__memos_finalize_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoFinalizeReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoFinalizeResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/memos/archive":{"get":{"summary":"List Archived Memos","description":"Admin-only view of every archived memo rev (pre-finalize\nversions).  Tenant admins + platform admins can see the archive;\nregular preparers + reviewers see 403.","operationId":"list_archived_memos_api_engagements__engagement_id__memos_archive_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/memos/cleanup-stale":{"post":{"summary":"Cleanup Stale Memos","description":"Bulk-discard all stale (superseded) drafts of every template\non this engagement.  Keeps the LATEST live (non-Approved) draft\nper template + every Approved memo; soft-deletes the rest.\n\nUseful after several re-runs have accumulated old drafts.","operationId":"cleanup_stale_memos_api_engagements__engagement_id__memos_cleanup_stale_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/verify-cert":{"post":{"summary":"Verify Cert","operationId":"verify_cert_api_verify_cert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_verify_cert_api_verify_cert_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/engagements/{engagement_id}/translation-rates":{"get":{"summary":"List Translation Rates","description":"List every translation rate row attached to this engagement.\n\nUsed by the /fs/group editor sidebar + the Sprint 8C FCTR\nreconciliation sheet generator.","operationId":"list_translation_rates_api_engagements__engagement_id__translation_rates_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TranslationRateOut"},"title":"Response List Translation Rates Api Engagements  Engagement Id  Translation Rates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Upsert Translation Rate","description":"Insert-or-update a single (subsidiary, period, rate_kind) row.\n\nIdempotent via the unique constraint\nuq_etr_sub_period_kind — repeated POSTs for the same key update\nthe existing row instead of failing.","operationId":"upsert_translation_rate_api_engagements__engagement_id__translation_rates_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationRateUpsertReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationRateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/translation-rates/{rate_id}":{"patch":{"summary":"Patch Translation Rate","operationId":"patch_translation_rate_api_engagements__engagement_id__translation_rates__rate_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","title":"Rate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationRatePatchReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationRateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Translation Rate","operationId":"delete_translation_rate_api_engagements__engagement_id__translation_rates__rate_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","title":"Rate Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fctr-preview":{"get":{"summary":"Preview Fctr","description":"Compute FCTR per Ind AS 21 §39-§44 for the engagement on demand.\n\nUsed by the UI's \"FCTR preview\" panel + by the FS Pack generator\nwhen it builds the FCTR_Reconciliation sheet.  The computation\nmirrors the spreadsheet logic exactly so the live formulas in\nthe workbook reconcile to this endpoint penny-for-penny.\n\nMethodology (current rate method):\n  Closing net assets in FC × closing rate     = closing net INR\n  Opening net assets in FC × opening rate     = opening net INR\n  P&L in FC                × average rate     = P&L net INR\n  FCTR (current period)    = closing net INR\n                              - opening net INR\n                              - P&L net INR\n  FCTR (opening balance)   = opening net INR (FC) at historical\n                              vs. opening net INR (FC) at opening rate\n                              ≈ accumulated FCTR carried forward\n                              (we surface what we can compute from\n                              the rates table; the rest comes from\n                              the trial balance equity OCI bucket).","operationId":"preview_fctr_api_engagements__engagement_id__fctr_preview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}},{"name":"presentation_currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presentation Currency"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FctrPreviewResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/nci-preview":{"get":{"summary":"Get Nci Preview","description":"Engagement-level NCI + equity-method roll-forward preview.\n\nReturns per-subsidiary NCI lines (for nature=subsidiary with\nNCI% > 0) plus per-associate / JV equity-method lines.  When\nsub-level PL data isn't yet captured, each line shows zero\ncontributions and the coverage flag is 'partial' so the FE can\nnudge the preparer to upload missing data.","operationId":"get_nci_preview_api_engagements__engagement_id__nci_preview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period_label","in":"query","required":false,"schema":{"type":"string","default":"current","title":"Period Label"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NciPreviewResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/attestation":{"get":{"summary":"Get Attestation State","operationId":"get_attestation_state_api_engagements__engagement_id__attestation_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/attestation/method":{"put":{"summary":"Set Attestation Method","operationId":"set_attestation_method_api_engagements__engagement_id__attestation_method_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationMethodSetReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/attestation/docusign/send":{"post":{"summary":"Send Attestation Via Docusign","description":"X-58 Sprint 9: dispatch the FS Pack PDF through DocuSign.\n\nThis endpoint is *scaffolded* — it persists the envelope state and\nenforces the attestation method gate, but the actual DocuSign API\ncall is gated on the DOCUSIGN_* secrets being configured.  When\nthe secrets are missing the endpoint returns a 503 with the\nFly-secret instructions so the UI can render a configure-DocuSign\nflow.  Once the keys are in place a follow-up patch wires in the\n`docusign-esign` SDK Envelopes::create call.","operationId":"send_attestation_via_docusign_api_engagements__engagement_id__attestation_docusign_send_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocuSignSendReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connectors":{"get":{"summary":"List Erp Connectors","operationId":"list_erp_connectors_api_engagements__engagement_id__erp_connectors_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ErpConnectorOut"},"title":"Response List Erp Connectors Api Engagements  Engagement Id  Erp Connectors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Upsert Erp Connector","operationId":"upsert_erp_connector_api_engagements__engagement_id__erp_connectors_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpConnectorUpsertReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpConnectorOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connectors/{connector_id}/health":{"post":{"summary":"Erp Connector Health","description":"Run a connectivity check against the configured ERP.\n\nSprint 12 shipped only the Tally connector's health-check, which is\nnow blocked (see the connector_kind == \"tally\" branch below) — no\nconnector_kind currently has a working health-check.","operationId":"erp_connector_health_api_engagements__engagement_id__erp_connectors__connector_id__health_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"connector_id","in":"path","required":true,"schema":{"type":"string","title":"Connector Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/erp-connectors/{connector_id}":{"delete":{"summary":"Delete Erp Connector","operationId":"delete_erp_connector_api_engagements__engagement_id__erp_connectors__connector_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"connector_id","in":"path","required":true,"schema":{"type":"string","title":"Connector Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/access-grants":{"get":{"summary":"List Engagement Access Grants","operationId":"list_engagement_access_grants_api_engagements__engagement_id__access_grants_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EngagementAccessGrantOut"},"title":"Response List Engagement Access Grants Api Engagements  Engagement Id  Access Grants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/auditors":{"post":{"summary":"Invite Auditor","description":"X-58 Sprint 18: invite an auditor to a specific engagement.\n\nCreates an EngagementAccessGrant directly if the email is an\nexisting user; otherwise creates a TenantInvitation with\n``engagement_id`` set (the acceptance flow creates the grant).\nThe auditor never gets a TenantMember row — they cannot see the\nrest of the tenant.","operationId":"invite_auditor_api_engagements__engagement_id__auditors_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditorInviteReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementAccessGrantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/auditors/{grant_id}":{"delete":{"summary":"Revoke Auditor","operationId":"revoke_auditor_api_engagements__engagement_id__auditors__grant_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","title":"Grant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/comments":{"get":{"summary":"List Engagement Comments","description":"X-58 Sprint 18: list comments for an engagement.\n\nFilter by target_kind + target_ref to fetch the thread for one\nface head / note / memo.  Omit both to see every open comment\non the engagement (used by the dashboard top-bar badge).","operationId":"list_engagement_comments_api_engagements__engagement_id__comments_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"target_kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Kind"}},{"name":"target_ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Ref"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EngagementCommentOut"},"title":"Response List Engagement Comments Api Engagements  Engagement Id  Comments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Engagement Comment","operationId":"create_engagement_comment_api_engagements__engagement_id__comments_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentCreateReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementCommentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/comments/{comment_id}/resolve":{"post":{"summary":"Resolve Engagement Comment","operationId":"resolve_engagement_comment_api_engagements__engagement_id__comments__comment_id__resolve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentResolveReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementCommentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/comments/{comment_id}/reopen":{"post":{"summary":"Reopen Engagement Comment","operationId":"reopen_engagement_comment_api_engagements__engagement_id__comments__comment_id__reopen_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngagementCommentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/comments/{comment_id}":{"delete":{"summary":"Delete Engagement Comment","operationId":"delete_engagement_comment_api_engagements__engagement_id__comments__comment_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/xbrl":{"post":{"summary":"Export Xbrl","description":"X-58 Sprint 19: emit a minimal XBRL (or iXBRL) instance\ndocument for the engagement.\n\nScope: ~25 face-head facts under Schedule III Div II covering\nBS + P&L.  Full MCA Schedule III 2021 taxonomy coverage (notes,\nratios, ageing schedules) is a focused follow-up.\n\nQuery: ``format`` is \"xbrl\" (default) or \"ixbrl\".\n\nBuilt on the job worker (ported from GMC-PRISM): this checks the\nformat, the TB and the reporting period, queues an ``xbrl_export``\njob and answers 202; the document downloads from\n``GET /api/deliverable-jobs/{id}/download``.","operationId":"export_xbrl_api_engagements__engagement_id__fs_xbrl_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"xbrl","title":"Format"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverableJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/memos/validate":{"get":{"summary":"Validate Memos Endpoint","description":"Sprint 89: validate every memo on the engagement against\nrules V001-V013.  Returns per-memo + aggregate counts so the\nUI can show a 'cannot mark Final' banner when any memo carries\nan error-level finding.","operationId":"validate_memos_endpoint_api_engagements__engagement_id__memos_validate_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/input-checklist":{"get":{"summary":"Engagement Input Checklist Endpoint","description":"Sprint 91: 'rock-solid documentation' input checklist.\n\nScores the engagement's uploads + client master against the\ncanonical input set (TB + AR x3 + IP + Board minutes + segment\nreport + NBFC-specific items when applicable).  The UI renders\na Critical / Recommended / Optional traffic-light grid and the\nMark-Final action blocks until all CRITICAL items are present.","operationId":"engagement_input_checklist_endpoint_api_engagements__engagement_id__input_checklist_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/comparative-status":{"get":{"summary":"Get Comparative Status","description":"3 Sep 2026 (IND-48) — is there a real comparative period?\n\nUntil IND-48 the answer was always \"yes\", because a single-period\ntrial balance answered a request for the prior period with the\nCURRENT period's figures.  The comparative column was populated,\nit footed, and it tied to nothing: on prod, 19 of the 37\nengagements carrying a comparative were showing this year's\nnumbers under last year's heading, Tata Steel and Tata Motors\namong them.\n\nThe loader now returns nothing when no column can be shown to be\nthe prior period, so the column renders empty — and this endpoint\nexists so the UI can say WHY it is empty rather than leaving a\npreparer to wonder whether the figures failed to load.","operationId":"get_comparative_status_api_engagements__engagement_id__comparative_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/fs/xbrl/validate":{"post":{"summary":"Validate Xbrl Endpoint","description":"Generate a fresh XBRL instance for the engagement, run the\nstructural validator over it, and return the report (no file\noutput).  Same generation path as /fs/xbrl so the validation\nreport describes EXACTLY what the preparer would file.","operationId":"validate_xbrl_endpoint_api_engagements__engagement_id__fs_xbrl_validate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/nli":{"post":{"summary":"Add Tenant Nli","description":"Add a tenant-scoped NLI row.  Any member holding engagement.update\n(Owner / OrgAdmin / EngagementLead / Preparer) can call this — the\n12 Sep 2026 T-1 gate; ReadOnly could before.","operationId":"add_tenant_nli_api_tenants__tenant_id__nli_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantNliReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantNliOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tenant Nli","description":"List all active tenant-scoped NLI additions.  Soft-deleted\nrows are excluded.","operationId":"list_tenant_nli_api_tenants__tenant_id__nli_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantNliOut"},"title":"Response List Tenant Nli Api Tenants  Tenant Id  Nli Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/nli/{nli_id}":{"delete":{"summary":"Delete Tenant Nli","description":"Soft-delete a tenant-scoped NLI.  Existing mappings that point\nat this nli_code keep their reference (audit integrity); the row\njust stops appearing in the catalogue dropdown.","operationId":"delete_tenant_nli_api_tenants__tenant_id__nli__nli_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"nli_id","in":"path","required":true,"schema":{"type":"string","title":"Nli Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/fsli":{"post":{"summary":"Add Tenant Fsli","description":"Add a face line to the company's own catalogue.  Same gate as\nadding an NLI (engagement.update).","operationId":"add_tenant_fsli_api_tenants__tenant_id__fsli_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantFsliReq"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantFsliOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tenant Fsli","description":"The company's live added FSLIs, oldest first.","operationId":"list_tenant_fsli_api_tenants__tenant_id__fsli_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantFsliOut"},"title":"Response List Tenant Fsli Api Tenants  Tenant Id  Fsli Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/fsli/{fsli_id}":{"delete":{"summary":"Delete Tenant Fsli","description":"Remove an added FSLI.  Refused while any ledger in the company's\nengagements is mapped to it: those amounts would drop off the face.","operationId":"delete_tenant_fsli_api_tenants__tenant_id__fsli__fsli_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"fsli_id","in":"path","required":true,"schema":{"type":"string","title":"Fsli Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/transition-bridge":{"get":{"summary":"Get Transition Bridge","description":"IAS 1 → IFRS 18 restatement bridge for the engagement.\n\n``period`` defaults to \"prior\" (the comparative the entity must\nrestate); falls back to \"current\" if no prior TB is uploaded so\nadvisors running a feasibility / scoping analysis get useful\noutput without waiting for a full multi-period TB upload.","operationId":"get_transition_bridge_api_engagements__engagement_id__transition_bridge_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"prior","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionBridgeResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/extract-ar":{"post":{"summary":"Post Notes Extract Ar","description":"Run LLM extraction over the engagement's AR KB chunks and\npersist the result.  Cached for subsequent notes endpoint calls\nuntil the AR is re-indexed (input_hash changes).\n\nforce_refresh=true bypasses the cache and re-runs the LLM.\n\n6 Jul 2026: accepts an optional JSON body with\n``custom_instructions`` (per-topic preparer steering) and a\n``persist`` flag controlling whether the instructions are stored\nfor future extractions (default True).  When no body is given,\nthe extractor falls back to previously-persisted instructions\n(if any) so a one-off \"recompute now\" from the notes UI picks\nthem up automatically.","operationId":"post_notes_extract_ar_api_engagements__engagement_id__notes_extract_ar_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}},{"name":"force_refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force Refresh"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/NotesArExtractReq"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesArExtractResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/engagements/{engagement_id}/notes/extract-ar/instructions":{"get":{"summary":"Get Notes Extract Ar Instructions","description":"Return the preparer-supplied per-topic AR-extraction\ninstructions currently persisted on the engagement, plus the\ncatalogue of valid topic_keys the FE needs to render its form.","operationId":"get_notes_extract_ar_instructions_api_engagements__engagement_id__notes_extract_ar_instructions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesArInstructionsResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Notes Extract Ar Instructions","description":"Persist per-topic AR-extraction instructions for the\nengagement.  Instructions are NOT run through the LLM on this\ncall — the preparer triggers a fresh extraction via POST\n/extract-ar (which picks up the persisted instructions\nautomatically when no body is provided).","operationId":"put_notes_extract_ar_instructions_api_engagements__engagement_id__notes_extract_ar_instructions_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"engagement_id","in":"path","required":true,"schema":{"type":"string","title":"Engagement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesArInstructionsReq"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesArInstructionsResp"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AISettingsOut":{"properties":{"configured":{"type":"boolean","title":"Configured"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"api_key_preview":{"type":"string","title":"Api Key Preview"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["configured","provider","model","api_key_preview"],"title":"AISettingsOut"},"AISettingsReq":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},"type":"object","title":"AISettingsReq"},"AccPolicyExtractReq":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"upload_id":{"type":"string","title":"Upload Id"}},"type":"object","required":["engagement_id","upload_id"],"title":"AccPolicyExtractReq"},"AccPolicyExtractResp":{"properties":{"section_found":{"type":"boolean","title":"Section Found"},"topics_matched":{"type":"integer","title":"Topics Matched"},"variants_created":{"type":"integer","title":"Variants Created"},"skipped_duplicates":{"type":"integer","title":"Skipped Duplicates"},"unmatched_subsections":{"items":{"type":"string"},"type":"array","title":"Unmatched Subsections"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["section_found","topics_matched","variants_created","skipped_duplicates","unmatched_subsections"],"title":"AccPolicyExtractResp"},"AccPolicyTopicCreateReq":{"properties":{"topic_key":{"type":"string","title":"Topic Key"},"topic_label":{"type":"string","title":"Topic Label"},"nta_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nta Code"},"ind_as_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ind As Ref"},"applies_to_fs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applies To Fs"}},"type":"object","required":["topic_key","topic_label"],"title":"AccPolicyTopicCreateReq"},"AccPolicyTopicOut":{"properties":{"id":{"type":"string","title":"Id"},"topic_key":{"type":"string","title":"Topic Key"},"topic_label":{"type":"string","title":"Topic Label"},"nta_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nta Code"},"ind_as_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ind As Ref"},"applies_to_fs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applies To Fs"},"display_order":{"type":"integer","title":"Display Order"},"is_active":{"type":"boolean","title":"Is Active"},"variant_count":{"type":"integer","title":"Variant Count"},"canonical_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Variant Id"},"canonical_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Excerpt"},"canonical_source_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Source Kind"}},"type":"object","required":["id","topic_key","topic_label","display_order","is_active","variant_count"],"title":"AccPolicyTopicOut"},"AccPolicyVariantCreateReq":{"properties":{"text":{"type":"string","title":"Text"},"source_kind":{"type":"string","title":"Source Kind","default":"user_edited"}},"type":"object","required":["text"],"title":"AccPolicyVariantCreateReq"},"AccPolicyVariantOut":{"properties":{"id":{"type":"string","title":"Id"},"topic_id":{"type":"string","title":"Topic Id"},"source_kind":{"type":"string","title":"Source Kind"},"source_upload_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Upload Id"},"source_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Engagement Id"},"source_legal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Legal Name"},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename"},"text":{"type":"string","title":"Text"},"word_count":{"type":"integer","title":"Word Count"},"is_canonical":{"type":"boolean","title":"Is Canonical"},"edited_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Edited By User Id"},"edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Edited At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","topic_id","source_kind","text","word_count","is_canonical","created_at"],"title":"AccPolicyVariantOut"},"AccPolicyVariantPatchReq":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"AccPolicyVariantPatchReq"},"AccountClosureOut":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"requested_at":{"type":"string","title":"Requested At"},"scheduled_at":{"type":"string","title":"Scheduled At"},"confirmed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confirmed At"},"executed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executed At"},"cancelled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled At"},"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"cooloff_days_remaining":{"type":"integer","title":"Cooloff Days Remaining"}},"type":"object","required":["id","user_id","requested_at","scheduled_at","status","cooloff_days_remaining"],"title":"AccountClosureOut"},"AccountOverrideOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"account_name":{"type":"string","title":"Account Name"},"override_category":{"type":"string","title":"Override Category"},"nli_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nli Code"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"resolution_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Status"},"mapping_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mapping Source"},"set_by_user_id":{"type":"string","title":"Set By User Id"},"set_at":{"type":"string","title":"Set At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["id","engagement_id","account_name","override_category","set_by_user_id","set_at"],"title":"AccountOverrideOut"},"AccountOverrideReq":{"properties":{"account_name":{"type":"string","maxLength":255,"minLength":1,"title":"Account Name"},"override_category":{"type":"string","maxLength":255,"minLength":1,"title":"Override Category"},"nli_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Nli Code"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["account_name","override_category"],"title":"AccountOverrideReq"},"AdminCloneEngagementReq":{"properties":{"target_tenant_id":{"type":"string","maxLength":36,"minLength":1,"title":"Target Tenant Id"},"new_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"New Name"}},"type":"object","required":["target_tenant_id"],"title":"AdminCloneEngagementReq"},"AdminCloneEngagementResp":{"properties":{"new_engagement_id":{"type":"string","title":"New Engagement Id"},"new_engagement_code":{"type":"string","title":"New Engagement Code"},"new_client_id":{"type":"string","title":"New Client Id"},"uploads_copied":{"type":"integer","title":"Uploads Copied"},"overrides_copied":{"type":"integer","title":"Overrides Copied"}},"type":"object","required":["new_engagement_id","new_engagement_code","new_client_id","uploads_copied","overrides_copied"],"title":"AdminCloneEngagementResp"},"AdminEngagementRow":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"framework":{"type":"string","title":"Framework"},"legal_name":{"type":"string","title":"Legal Name"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"upload_count":{"type":"integer","title":"Upload Count"},"override_count":{"type":"integer","title":"Override Count"}},"type":"object","required":["id","code","name","framework","legal_name","tenant_id","tenant_name","status","created_at","upload_count","override_count"],"title":"AdminEngagementRow"},"AdminEntityRow":{"properties":{"id":{"type":"string","title":"Id"},"legal_name":{"type":"string","title":"Legal Name"},"industry":{"type":"string","title":"Industry"},"incorporation_country":{"type":"string","title":"Incorporation Country"},"is_listed":{"type":"boolean","title":"Is Listed"},"kyc_status":{"type":"string","title":"Kyc Status"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"has_engagement":{"type":"boolean","title":"Has Engagement"}},"type":"object","required":["id","legal_name","industry","incorporation_country","is_listed","kyc_status","tenant_id","tenant_name","created_at","has_engagement"],"title":"AdminEntityRow"},"AdminResetLinkOut":{"properties":{"reset_path":{"type":"string","title":"Reset Path"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["reset_path","expires_at"],"title":"AdminResetLinkOut"},"AdminTenantRow":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"industry":{"type":"string","title":"Industry"},"country":{"type":"string","title":"Country"},"tenant_mode":{"type":"string","title":"Tenant Mode"},"entitlements":{"items":{"type":"string"},"type":"array","title":"Entitlements"},"plan_status":{"type":"string","title":"Plan Status"},"trial_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Until"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"owner_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Full Name"},"member_count":{"type":"integer","title":"Member Count","default":0},"engagement_count":{"type":"integer","title":"Engagement Count","default":0},"entity_count":{"type":"integer","title":"Entity Count","default":0}},"type":"object","required":["id","name","industry","country","tenant_mode","entitlements","plan_status","created_at"],"title":"AdminTenantRow"},"AdminUserRow":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_admin":{"type":"boolean","title":"Is Admin"},"email_verified":{"type":"boolean","title":"Email Verified"},"mfa_enrolled":{"type":"boolean","title":"Mfa Enrolled"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"workspace_count":{"type":"integer","title":"Workspace Count","default":0}},"type":"object","required":["id","email","full_name","is_active","is_admin","email_verified","mfa_enrolled","created_at"],"title":"AdminUserRow"},"AdminUserUpdateReq":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"is_admin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Admin"},"must_change_password":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Must Change Password"},"mfa_required_for_approve":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mfa Required For Approve"},"unlock":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unlock"}},"type":"object","title":"AdminUserUpdateReq"},"AgeingScheduleReq":{"properties":{"cells":{"anyOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object"},{"type":"null"}],"title":"Cells"},"completion":{"anyOf":[{"items":{"$ref":"#/components/schemas/CompletionRow"},"type":"array"},{"type":"null"}],"title":"Completion"},"allowance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Allowance"}},"type":"object","title":"AgeingScheduleReq"},"AiAcceptReq":{"properties":{"account_name":{"type":"string","maxLength":255,"minLength":1,"title":"Account Name"},"override_category":{"type":"string","maxLength":255,"minLength":1,"title":"Override Category"},"nli_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Nli Code"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"citation":{"type":"string","maxLength":255,"minLength":1,"title":"Citation"},"kb_source_id":{"type":"string","maxLength":64,"minLength":1,"title":"Kb Source Id"},"model_version":{"type":"string","maxLength":64,"minLength":1,"title":"Model Version"},"prompt_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Prompt Hash"}},"type":"object","required":["account_name","override_category","confidence","citation","kb_source_id","model_version","prompt_hash"],"title":"AiAcceptReq"},"AiAcceptVelocityResp":{"properties":{"accepts_in_last_60s":{"type":"integer","title":"Accepts In Last 60S"},"accepts_today":{"type":"integer","title":"Accepts Today"},"attestation_given_today":{"type":"boolean","title":"Attestation Given Today"},"threshold_accepts_per_60s":{"type":"integer","title":"Threshold Accepts Per 60S","default":5}},"type":"object","required":["accepts_in_last_60s","accepts_today","attestation_given_today"],"title":"AiAcceptVelocityResp"},"AiBulkAttestReq":{"properties":{"confirmed_count":{"type":"integer","minimum":0.0,"title":"Confirmed Count"},"engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Id"}},"type":"object","required":["confirmed_count"],"title":"AiBulkAttestReq"},"AiGroupingProposal":{"properties":{"account_name":{"type":"string","title":"Account Name"},"suggested_category":{"type":"string","title":"Suggested Category"},"suggested_nli_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Nli Code"},"suggested_nli_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Nli Name"},"confidence":{"type":"number","title":"Confidence"},"rationale":{"type":"string","title":"Rationale"},"citation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Citation"},"kb_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Source Id"},"cited_span":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Cited Span"}},"type":"object","required":["account_name","suggested_category","confidence","rationale"],"title":"AiGroupingProposal"},"AiGroupingResp":{"properties":{"detected":{"items":{"$ref":"#/components/schemas/AiGroupingProposal"},"type":"array","title":"Detected","default":[]},"used_llm":{"type":"boolean","title":"Used Llm","default":false},"accounts_considered":{"type":"integer","title":"Accounts Considered","default":0},"llm_unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Unavailable Reason"},"catalogue_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Catalogue Version"},"batches_run":{"type":"integer","title":"Batches Run","default":0},"batches_failed":{"type":"integer","title":"Batches Failed","default":0},"partial_failure_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partial Failure Note"},"model_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Version"},"prompt_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Hash"}},"type":"object","title":"AiGroupingResp"},"AlignPresentationReq":{"properties":{"source_engagement_id":{"type":"string","title":"Source Engagement Id"},"copy_settings":{"type":"boolean","title":"Copy Settings","default":true},"copy_face_heads_and_nli":{"type":"boolean","title":"Copy Face Heads And Nli","default":true},"overwrite_overrides":{"type":"boolean","title":"Overwrite Overrides","default":true},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","required":["source_engagement_id"],"title":"AlignPresentationReq","description":"4 Jun 2026: align BS + P&L presentation to a source\nengagement's settings in one shot.  Re-applied solo after the\nb48b23a bundle revert (was part of 802fee8)."},"AlignPresentationResp":{"properties":{"settings_changed":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Settings Changed"},"overrides_copied":{"type":"integer","title":"Overrides Copied"},"overrides_skipped_existing":{"type":"integer","title":"Overrides Skipped Existing"},"overrides_not_found_in_target":{"type":"integer","title":"Overrides Not Found In Target"},"source_engagement_id":{"type":"string","title":"Source Engagement Id"},"target_engagement_id":{"type":"string","title":"Target Engagement Id"}},"type":"object","required":["settings_changed","overrides_copied","overrides_skipped_existing","overrides_not_found_in_target","source_engagement_id","target_engagement_id"],"title":"AlignPresentationResp"},"AmountScaleReq":{"properties":{"amount_scale":{"type":"string","title":"Amount Scale"}},"type":"object","required":["amount_scale"],"title":"AmountScaleReq"},"AnomaliesResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"presentation_currency":{"type":"string","title":"Presentation Currency"},"default_scale":{"type":"string","title":"Default Scale"},"materiality_overall":{"type":"number","title":"Materiality Overall"},"materiality_performance":{"type":"number","title":"Materiality Performance"},"materiality_clearly_trivial":{"type":"number","title":"Materiality Clearly Trivial"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"anomalies":{"items":{"$ref":"#/components/schemas/AnomalyOut"},"type":"array","title":"Anomalies"}},"type":"object","required":["engagement_id","presentation_currency","default_scale","materiality_overall","materiality_performance","materiality_clearly_trivial","counts","anomalies"],"title":"AnomaliesResp"},"AnomalyOut":{"properties":{"face_head_code":{"type":"string","title":"Face Head Code"},"face_head_label":{"type":"string","title":"Face Head Label"},"statement":{"type":"string","title":"Statement"},"kind":{"type":"string","title":"Kind"},"severity":{"type":"string","title":"Severity"},"message":{"type":"string","title":"Message"},"delta_abs":{"type":"number","title":"Delta Abs"},"delta_pct":{"type":"number","title":"Delta Pct"},"current_value":{"type":"number","title":"Current Value"},"prior_value":{"type":"number","title":"Prior Value"},"context":{"additionalProperties":true,"type":"object","title":"Context","default":{}},"anomaly_key":{"type":"string","title":"Anomaly Key","default":""},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation"},"resolved":{"type":"boolean","title":"Resolved","default":false},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"},"resolved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By User Id"}},"type":"object","required":["face_head_code","face_head_label","statement","kind","severity","message","delta_abs","delta_pct","current_value","prior_value"],"title":"AnomalyOut"},"AnomalyResolutionReq":{"properties":{"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation"},"resolved":{"type":"boolean","title":"Resolved","default":false}},"type":"object","title":"AnomalyResolutionReq","description":"Phase 3 Item 25: upsert payload for anomaly resolutions."},"AnthropicKeyReq":{"properties":{"api_key":{"type":"string","minLength":10,"title":"Api Key"}},"type":"object","required":["api_key"],"title":"AnthropicKeyReq"},"ApplyErpTemplateReq":{"properties":{"template_id":{"type":"string","maxLength":64,"minLength":1,"title":"Template Id"},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"overwrite":{"type":"boolean","title":"Overwrite","default":false}},"type":"object","required":["template_id"],"title":"ApplyErpTemplateReq"},"ApproveReq":{"properties":{"signature":{"type":"string","maxLength":255,"minLength":1,"title":"Signature"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["signature"],"title":"ApproveReq"},"ArExtractionActionReq":{"properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"ArExtractionActionReq"},"ArExtractionOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"upload_id":{"type":"string","title":"Upload Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Framework"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"source_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Source Page"},"source_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Excerpt"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"extracted_at":{"type":"string","format":"date-time","title":"Extracted At"},"extractor_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extractor Version"},"applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied At"}},"type":"object","required":["id","engagement_id","upload_id","kind","status","extracted_at"],"title":"ArExtractionOut"},"ArReextractResp":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Framework"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"message":{"type":"string","title":"Message"}},"type":"object","required":["upload_id","framework","counts","message"],"title":"ArReextractResp"},"AskCitation":{"properties":{"chunk_id":{"type":"string","title":"Chunk Id"},"publisher":{"type":"string","title":"Publisher"},"source_title":{"type":"string","title":"Source Title"},"paragraph_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Ref"},"heading":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heading"},"snippet":{"type":"string","title":"Snippet"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"score":{"type":"number","title":"Score"}},"type":"object","required":["chunk_id","publisher","source_title","snippet","score"],"title":"AskCitation"},"AskRequest":{"properties":{"question":{"type":"string","title":"Question"},"engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Id"},"top_k":{"type":"integer","title":"Top K","default":5},"publishers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Publishers"},"jurisdictions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Jurisdictions"},"paragraph_refs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Paragraph Refs"}},"type":"object","required":["question"],"title":"AskRequest"},"AskResponse":{"properties":{"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"used_llm":{"type":"boolean","title":"Used Llm"},"llm_unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Unavailable Reason"},"citations":{"items":{"$ref":"#/components/schemas/AskCitation"},"type":"array","title":"Citations"},"kb_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Version"},"retrieval_diagnostics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Retrieval Diagnostics"}},"type":"object","required":["answer","used_llm","citations"],"title":"AskResponse"},"AssignReviewerReq":{"properties":{"technical_committee_id":{"type":"string","title":"Technical Committee Id"}},"type":"object","required":["technical_committee_id"],"title":"AssignReviewerReq"},"AttestationMethodSetReq":{"properties":{"attestation_method":{"type":"string","title":"Attestation Method"}},"type":"object","required":["attestation_method"],"title":"AttestationMethodSetReq"},"AttestationStateOut":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"attestation_method":{"type":"string","title":"Attestation Method"},"attestation_envelope_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attestation Envelope Id"},"attestation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attestation Status"},"attestation_signed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Attestation Signed At"},"docusign_configured":{"type":"boolean","title":"Docusign Configured"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"}},"type":"object","required":["engagement_id","attestation_method","docusign_configured"],"title":"AttestationStateOut"},"AuditExportReq":{"properties":{"tenant_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tenant Ids"}},"type":"object","title":"AuditExportReq"},"AuditSettingsOut":{"properties":{"platform_default_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Platform Default Days"},"country_defaults":{"additionalProperties":{"type":"integer"},"type":"object","title":"Country Defaults","default":{}}},"type":"object","title":"AuditSettingsOut"},"AuditSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"AuditSettingsReq"},"AuditorInviteReq":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"Auditor"}},"type":"object","required":["email"],"title":"AuditorInviteReq"},"AuditorsReportOut":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"custom":{"type":"boolean","title":"Custom","default":false},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"updated_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By User Id"}},"type":"object","required":["engagement_id"],"title":"AuditorsReportOut"},"AuditorsReportPutReq":{"properties":{"body_html":{"type":"string","maxLength":400000,"title":"Body Html","default":""}},"type":"object","title":"AuditorsReportPutReq"},"AuthResp":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"additionalProperties":true,"type":"object","title":"User"}},"type":"object","required":["access_token","user"],"title":"AuthResp"},"BatchNoteTablesReq":{"properties":{"keys":{"items":{"type":"string"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"BatchNoteTablesReq"},"BatchNotesReq":{"properties":{"keys":{"items":{"type":"string"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"BatchNotesReq"},"BillingEventOut":{"properties":{"id":{"type":"string","title":"Id"},"provider":{"type":"string","title":"Provider"},"event_type":{"type":"string","title":"Event Type"},"provider_event_id":{"type":"string","title":"Provider Event Id"},"processed_at":{"type":"string","title":"Processed At"}},"type":"object","required":["id","provider","event_type","provider_event_id","processed_at"],"title":"BillingEventOut"},"Body_apply_workpaper_api_engagements__engagement_id__notes__note_key__workpaper_apply_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_apply_workpaper_api_engagements__engagement_id__notes__note_key__workpaper_apply_post"},"Body_coa_parse_api_tenants__tenant_id__coa_parse_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_coa_parse_api_tenants__tenant_id__coa_parse_post"},"Body_expire_active_subscription_api_admin_tenants__tenant_id__subscription_expire_post":{"properties":{"reason":{"type":"string","title":"Reason"}},"type":"object","required":["reason"],"title":"Body_expire_active_subscription_api_admin_tenants__tenant_id__subscription_expire_post"},"Body_import_catalogue_api_tenants__tenant_id__nli_catalogue_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_catalogue_api_tenants__tenant_id__nli_catalogue_import_post"},"Body_import_group_structure_xlsx_api_engagements__engagement_id__group_import_xlsx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_group_structure_xlsx_api_engagements__engagement_id__group_import_xlsx_post"},"Body_import_intercompany_xlsx_api_engagements__engagement_id__intercompany_import_xlsx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_intercompany_xlsx_api_engagements__engagement_id__intercompany_import_xlsx_post"},"Body_import_journal_entries_xlsx_api_engagements__engagement_id__journal_entries_import_xlsx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_journal_entries_xlsx_api_engagements__engagement_id__journal_entries_import_xlsx_post"},"Body_import_non_tb_xlsx_api_engagements__engagement_id__non_tb_import_xlsx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_non_tb_xlsx_api_engagements__engagement_id__non_tb_import_xlsx_post"},"Body_import_socie_xlsx_api_engagements__engagement_id__fs_socie_import_xlsx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_socie_xlsx_api_engagements__engagement_id__fs_socie_import_xlsx_post"},"Body_import_workpaper_preview_api_engagements__engagement_id__notes__note_key__workpaper_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_workpaper_preview_api_engagements__engagement_id__notes__note_key__workpaper_import_post"},"Body_preview_import_api_admin_industries_import_preview_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_preview_import_api_admin_industries_import_preview_post"},"Body_sync_fs_pack_api_engagements__engagement_id__fs_pack_sync_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_sync_fs_pack_api_engagements__engagement_id__fs_pack_sync_post"},"Body_upload_file_api_engagements__engagement_id__uploads_post":{"properties":{"kind":{"type":"string","title":"Kind"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"period_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"},"erp_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Erp Template Id"},"amount_scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Scale"}},"type":"object","required":["kind","file"],"title":"Body_upload_file_api_engagements__engagement_id__uploads_post"},"Body_verify_cert_api_verify_cert_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_verify_cert_api_verify_cert_post"},"BulkImportResult":{"properties":{"created":{"type":"integer","title":"Created"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["created","skipped","errors","summary"],"title":"BulkImportResult","description":"Generic bulk-import response shared by Phase 2 importers\n(SOCIE adjustments / Group Structure subsidiaries / Intercompany\ntransactions).  Defined here so it's available for the earliest\nendpoint that uses it (SOCIE) - the Group + IC endpoints later\nin this module reference the same class."},"CapitalReq":{"properties":{"values":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"object","title":"Values"}},"type":"object","required":["values"],"title":"CapitalReq"},"CatalogueAddNliReq":{"properties":{"nli_code":{"type":"string","maxLength":32,"minLength":1,"title":"Nli Code"},"nli_name":{"type":"string","maxLength":255,"minLength":1,"title":"Nli Name"},"parent_fsli_code":{"type":"string","maxLength":32,"minLength":1,"title":"Parent Fsli Code"},"parent_fsli_name":{"type":"string","maxLength":255,"minLength":1,"title":"Parent Fsli Name"},"element":{"type":"string","maxLength":32,"title":"Element","default":""},"statement":{"type":"string","maxLength":64,"title":"Statement","default":""},"section":{"type":"string","maxLength":64,"title":"Section","default":""},"note_grouping":{"type":"string","maxLength":128,"title":"Note Grouping","default":""},"framework":{"type":"string","maxLength":16,"minLength":1,"title":"Framework"},"division":{"type":"string","maxLength":8,"title":"Division","default":"-"},"industries":{"items":{"type":"string"},"type":"array","title":"Industries"},"normal_balance":{"type":"string","maxLength":4,"title":"Normal Balance","default":"Dr"},"guidance":{"type":"string","maxLength":2000,"title":"Guidance","default":""},"reason_for_add":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason For Add"}},"type":"object","required":["nli_code","nli_name","parent_fsli_code","parent_fsli_name","framework","reason_for_add"],"title":"CatalogueAddNliReq","description":"Phase 3 — eager add of a new NLI row from the gap-resolve form."},"CatalogueGapDismissReq":{"properties":{"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"CatalogueGapDismissReq"},"CatalogueGapOut":{"properties":{"id":{"type":"string","title":"Id"},"fsli_name_requested":{"type":"string","title":"Fsli Name Requested"},"fsli_name_norm":{"type":"string","title":"Fsli Name Norm"},"framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Framework"},"division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Division"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"hit_count":{"type":"integer","title":"Hit Count"},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"last_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Engagement Id"},"status":{"type":"string","title":"Status"},"resolved_by_nli_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By Nli Code"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"dismissed_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dismissed Reason"}},"type":"object","required":["id","fsli_name_requested","fsli_name_norm","hit_count","first_seen_at","last_seen_at","status"],"title":"CatalogueGapOut"},"CertificateOut":{"properties":{"cert_id":{"type":"string","title":"Cert Id"},"tier":{"type":"string","title":"Tier"},"learner_name":{"type":"string","title":"Learner Name"},"composite_score_pct":{"type":"number","title":"Composite Score Pct"},"courses_included":{"items":{"type":"string"},"type":"array","title":"Courses Included"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"pdf_url":{"type":"string","title":"Pdf Url"},"json_url":{"type":"string","title":"Json Url"}},"type":"object","required":["cert_id","tier","learner_name","composite_score_pct","courses_included","issued_at","pdf_url","json_url"],"title":"CertificateOut"},"ChangePasswordReq":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordReq"},"ClearNoteReq":{"properties":{"paragraph_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Text"}},"type":"object","title":"ClearNoteReq"},"CloseAccountReq":{"properties":{"password":{"type":"string","title":"Password"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["password"],"title":"CloseAccountReq"},"CloseCycleCloseResp":{"properties":{"cycle":{"$ref":"#/components/schemas/CloseCycleResp"},"snapshot_id":{"type":"string","title":"Snapshot Id"},"snapshot_label":{"type":"string","title":"Snapshot Label"},"snapshot_hash_prefix":{"type":"string","title":"Snapshot Hash Prefix"},"frozen_at":{"type":"string","title":"Frozen At"}},"type":"object","required":["cycle","snapshot_id","snapshot_label","snapshot_hash_prefix","frozen_at"],"title":"CloseCycleCloseResp"},"CloseCycleCreateReq":{"properties":{"cadence":{"type":"string","title":"Cadence","description":"One of monthly | quarterly | half_yearly | annual"},"current_period_label":{"type":"string","maxLength":32,"minLength":1,"title":"Current Period Label","description":"Label for the first period this cycle tracks — e.g. 'Q1 FY 2025-26', 'Apr 2025', 'FY 2025-26'"},"current_period_end":{"type":"string","format":"date","title":"Current Period End","description":"Period-end date for the first period."},"parent_engagement_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Parent Engagement Id","description":"Optional parent annual engagement this interim cycle folds up into."}},"type":"object","required":["cadence","current_period_label","current_period_end"],"title":"CloseCycleCreateReq"},"CloseCycleOpeningsPreviewResp":{"properties":{"cycle_id":{"type":"string","title":"Cycle Id"},"source_snapshot_id":{"type":"string","title":"Source Snapshot Id"},"openings_pack":{"additionalProperties":true,"type":"object","title":"Openings Pack"},"validation":{"additionalProperties":true,"type":"object","title":"Validation"}},"type":"object","required":["cycle_id","source_snapshot_id","openings_pack","validation"],"title":"CloseCycleOpeningsPreviewResp","description":"Dry-run response — computes openings from the last-close\nsnapshot without persisting anything."},"CloseCycleResp":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"cadence":{"type":"string","title":"Cadence"},"current_period_label":{"type":"string","title":"Current Period Label"},"current_period_end":{"type":"string","title":"Current Period End"},"parent_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Engagement Id"},"last_close_snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Close Snapshot Id"},"last_close_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Close At"},"created_at":{"type":"string","title":"Created At"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"}},"type":"object","required":["id","engagement_id","cadence","current_period_label","current_period_end","created_at"],"title":"CloseCycleResp"},"CloseCycleRollforwardReq":{"properties":{"next_period_label":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Next Period Label","description":"Override the server-derived next-period label."},"next_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Next Period End","description":"Override the server-derived next-period end date."}},"type":"object","title":"CloseCycleRollforwardReq","description":"Optional overrides for the derived next period.  Leave both\nNone to accept the server-derived label + end from the current\ncycle's cadence."},"CloseCycleRollforwardResp":{"properties":{"cycle":{"$ref":"#/components/schemas/CloseCycleResp"},"prior_period_label":{"type":"string","title":"Prior Period Label"},"prior_period_end":{"type":"string","title":"Prior Period End"},"prior_snapshot_id":{"type":"string","title":"Prior Snapshot Id"},"carry_forward_summary":{"additionalProperties":true,"type":"object","title":"Carry Forward Summary"}},"type":"object","required":["cycle","prior_period_label","prior_period_end","prior_snapshot_id","carry_forward_summary"],"title":"CloseCycleRollforwardResp"},"CoaRowsReq":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"CoaRowsReq"},"CommentCreateReq":{"properties":{"target_kind":{"type":"string","title":"Target Kind"},"target_ref":{"type":"string","title":"Target Ref","default":""},"content":{"type":"string","title":"Content"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"}},"type":"object","required":["target_kind","content"],"title":"CommentCreateReq"},"CommentResolveReq":{"properties":{"resolution_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Note"}},"type":"object","title":"CommentResolveReq"},"CompletionRow":{"properties":{"project":{"type":"string","title":"Project"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"}},"type":"object","required":["project"],"title":"CompletionRow"},"CopyOverridesReq":{"properties":{"source_engagement_id":{"type":"string","title":"Source Engagement Id"},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"overwrite":{"type":"boolean","title":"Overwrite","default":false}},"type":"object","required":["source_engagement_id"],"title":"CopyOverridesReq","description":"Sprint 71 (B): source engagement to copy mappings from."},"CopyOverridesResp":{"properties":{"copied":{"type":"integer","title":"Copied"},"skipped_existing":{"type":"integer","title":"Skipped Existing"},"skipped_no_account":{"type":"integer","title":"Skipped No Account"},"not_found":{"type":"integer","title":"Not Found"},"accounts_inspected":{"type":"integer","title":"Accounts Inspected"},"source_engagement_id":{"type":"string","title":"Source Engagement Id"}},"type":"object","required":["copied","skipped_existing","skipped_no_account","not_found","accounts_inspected","source_engagement_id"],"title":"CopyOverridesResp"},"CorrectionIn":{"properties":{"scope":{"type":"string","title":"Scope","default":"standalone"},"legs":{"items":{"$ref":"#/components/schemas/LegIn"},"type":"array","title":"Legs"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["legs","reason"],"title":"CorrectionIn"},"CountryAuditSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"CountryAuditSettingsReq"},"CountryExportSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"CountryExportSettingsReq"},"CourseDetailOut":{"properties":{"course_id":{"type":"string","title":"Course Id"},"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"tier":{"type":"string","title":"Tier"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"audience_tags":{"items":{"type":"string"},"type":"array","title":"Audience Tags"},"has_quiz":{"type":"boolean","title":"Has Quiz"},"objectives":{"items":{"type":"string"},"type":"array","title":"Objectives"},"reading_excerpts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reading Excerpts"},"body":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Body","default":[]}},"type":"object","required":["course_id","title","summary","tier","duration_minutes","audience_tags","has_quiz","objectives","reading_excerpts"],"title":"CourseDetailOut"},"CourseSummaryOut":{"properties":{"course_id":{"type":"string","title":"Course Id"},"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"tier":{"type":"string","title":"Tier"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"audience_tags":{"items":{"type":"string"},"type":"array","title":"Audience Tags"},"has_quiz":{"type":"boolean","title":"Has Quiz"}},"type":"object","required":["course_id","title","summary","tier","duration_minutes","audience_tags","has_quiz"],"title":"CourseSummaryOut"},"DataExportOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"requested_by":{"type":"string","title":"Requested By"},"requested_at":{"type":"string","title":"Requested At"},"status":{"type":"string","title":"Status"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"export_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Export Sha256"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Detail"}},"type":"object","required":["id","tenant_id","requested_by","requested_at","status"],"title":"DataExportOut"},"DeliverableJobOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"job_type":{"type":"string","title":"Job Type"},"status":{"type":"string","title":"Status"},"progress_percent":{"type":"integer","title":"Progress Percent","default":0},"progress_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Step"},"queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Queued At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"files":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Files","default":[]},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"has_download":{"type":"boolean","title":"Has Download","default":false},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","engagement_id","job_type","status"],"title":"DeliverableJobOut"},"DisclosureReq":{"properties":{"applicable":{"type":"boolean","title":"Applicable"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["applicable"],"title":"DisclosureReq"},"DocuSignSendReq":{"properties":{"fs_pack_filename":{"type":"string","title":"Fs Pack Filename"},"signer_email":{"type":"string","title":"Signer Email"},"signer_name":{"type":"string","title":"Signer Name"},"cc_emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc Emails"}},"type":"object","required":["fs_pack_filename","signer_email","signer_name"],"title":"DocuSignSendReq"},"DqsCategoryOut":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"weight":{"type":"integer","title":"Weight"},"score_pct":{"type":"number","title":"Score Pct"},"weighted_score":{"type":"number","title":"Weighted Score"},"items_total":{"type":"integer","title":"Items Total"},"items_passed":{"type":"integer","title":"Items Passed"},"missing_items":{"items":{"type":"string"},"type":"array","title":"Missing Items"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["code","name","weight","score_pct","weighted_score","items_total","items_passed","missing_items","detail"],"title":"DqsCategoryOut"},"DqsReportOut":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"overall_score":{"type":"number","title":"Overall Score"},"band":{"type":"string","title":"Band"},"categories":{"items":{"$ref":"#/components/schemas/DqsCategoryOut"},"type":"array","title":"Categories"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["engagement_id","overall_score","band","categories","generated_at"],"title":"DqsReportOut"},"EclInputsPayload":{"properties":{"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","title":"EclInputsPayload"},"EditReq":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"for_organisation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"For Organisation"},"for_entity":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"For Entity"},"parent_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Code"},"aliases":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Aliases"},"archetype_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archetype Hint"},"nic_2008":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nic 2008"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"base_version":{"type":"integer","title":"Base Version"}},"type":"object","required":["base_version"],"title":"EditReq"},"EmailVerifyReq":{"properties":{"token":{"type":"string","maxLength":128,"minLength":20,"title":"Token"}},"type":"object","required":["token"],"title":"EmailVerifyReq"},"EnablePreviewResp":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"previous_tier":{"type":"string","title":"Previous Tier"},"new_tier":{"type":"string","title":"New Tier"},"was_already_preview":{"type":"boolean","title":"Was Already Preview"}},"type":"object","required":["tenant_id","tenant_name","previous_tier","new_tier","was_already_preview"],"title":"EnablePreviewResp"},"EngagementAccessGrantOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"user_id":{"type":"string","title":"User Id"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Full Name"},"role":{"type":"string","title":"Role"},"granted_by_user_id":{"type":"string","title":"Granted By User Id"},"granted_at":{"type":"string","format":"date-time","title":"Granted At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","engagement_id","user_id","role","granted_by_user_id","granted_at"],"title":"EngagementAccessGrantOut"},"EngagementCommentOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"target_kind":{"type":"string","title":"Target Kind"},"target_ref":{"type":"string","title":"Target Ref"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"author_user_id":{"type":"string","title":"Author User Id"},"author_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Email"},"author_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Full Name"},"author_role":{"type":"string","title":"Author Role"},"content":{"type":"string","title":"Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"resolved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By User Id"},"resolution_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Note"}},"type":"object","required":["id","engagement_id","target_kind","target_ref","author_user_id","author_role","content","created_at"],"title":"EngagementCommentOut"},"EngagementCreateReq":{"properties":{"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"legal_name":{"type":"string","title":"Legal Name"},"client_id":{"type":"string","title":"Client Id"},"industry":{"type":"string","title":"Industry"},"sub_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Industry"},"framework":{"type":"string","title":"Framework","default":"Both"},"jurisdictions":{"items":{"type":"string"},"type":"array","title":"Jurisdictions","default":["IN"]},"revenue_inr_cr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Revenue Inr Cr"},"is_listed":{"type":"boolean","title":"Is Listed","default":false},"is_bank_nbfc_insurer":{"type":"boolean","title":"Is Bank Nbfc Insurer","default":false},"holds_investment_property":{"type":"boolean","title":"Holds Investment Property","default":false},"has_financing_to_customers":{"type":"boolean","title":"Has Financing To Customers","default":false},"multi_segment":{"type":"boolean","title":"Multi Segment","default":false},"it_landscape":{"items":{"type":"string"},"type":"array","title":"It Landscape","default":[]},"first_ifrs18_year_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Ifrs18 Year End"},"classification_documented":{"type":"boolean","title":"Classification Documented","default":false},"has_new_subtotals":{"type":"boolean","title":"Has New Subtotals","default":false},"has_category_mapping":{"type":"boolean","title":"Has Category Mapping","default":false},"mpm_inventory":{"type":"boolean","title":"Mpm Inventory","default":false},"client_master_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Master Id"},"presentation_currency":{"type":"string","title":"Presentation Currency","default":"INR"},"default_scale":{"type":"string","title":"Default Scale","default":"Crores"},"display_decimals":{"type":"integer","title":"Display Decimals","default":2},"structural_changes_this_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structural Changes This Period"},"schedule_iii_division_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Iii Division Override"},"reporting_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reporting Basis"},"period_under_review_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Under Review Start"},"period_under_review_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Under Review End"},"fs_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period Start"},"fs_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period End"},"pnl_close_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pnl Close Column"},"oci_tax_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oci Tax Basis"},"rounding_difference_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rounding Difference Label"},"comparative_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Comparative Period Start"},"group_or_standalone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Or Standalone"},"scope_modules":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scope Modules"}},"type":"object","required":["code","name","legal_name","client_id","industry"],"title":"EngagementCreateReq"},"EngagementOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"legal_name":{"type":"string","title":"Legal Name"},"industry":{"type":"string","title":"Industry"},"sub_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Industry"},"framework":{"type":"string","title":"Framework"},"status":{"type":"string","title":"Status"},"revenue_inr_cr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Revenue Inr Cr"},"is_listed":{"type":"boolean","title":"Is Listed"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"upload_count":{"type":"integer","title":"Upload Count"},"run_count":{"type":"integer","title":"Run Count"},"schedule_iii_division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Iii Division"},"presentation_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Presentation Currency","default":"INR"},"default_scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Scale","default":"Crores"},"display_decimals":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Display Decimals","default":2},"structural_changes_this_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structural Changes This Period"},"schedule_iii_division_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Iii Division Override"},"reporting_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reporting Basis"},"resolved_reporting_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Reporting Basis"},"it_landscape":{"items":{"type":"string"},"type":"array","title":"It Landscape"},"first_ifrs18_year_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Ifrs18 Year End"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_master_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Master Id"},"jurisdictions":{"items":{"type":"string"},"type":"array","title":"Jurisdictions"},"is_bank_nbfc_insurer":{"type":"boolean","title":"Is Bank Nbfc Insurer","default":false},"holds_investment_property":{"type":"boolean","title":"Holds Investment Property","default":false},"has_financing_to_customers":{"type":"boolean","title":"Has Financing To Customers","default":false},"multi_segment":{"type":"boolean","title":"Multi Segment","default":false},"classification_documented":{"type":"boolean","title":"Classification Documented","default":false},"has_new_subtotals":{"type":"boolean","title":"Has New Subtotals","default":false},"has_category_mapping":{"type":"boolean","title":"Has Category Mapping","default":false},"mpm_inventory":{"type":"boolean","title":"Mpm Inventory","default":false},"period_under_review_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Under Review Start"},"period_under_review_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Under Review End"},"fs_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period Start"},"fs_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period End"},"pnl_close_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pnl Close Column"},"oci_tax_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oci Tax Basis"},"rounding_difference_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rounding Difference Label"},"comparative_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Comparative Period Start"},"group_or_standalone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Or Standalone"},"resolved_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Period Start"},"resolved_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Period End"},"resolved_period_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resolved Period Months"},"resolved_period_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Period Source"},"resolved_period_prior_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Resolved Period Prior End"},"resolved_period_caption_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Period Caption Kind"},"tenant_entitlements":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tenant Entitlements"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"scope_modules":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scope Modules"},"effective_modules":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Effective Modules"}},"type":"object","required":["id","tenant_id","code","name","legal_name","industry","framework","status","revenue_inr_cr","is_listed","created_at","last_run_at","upload_count","run_count"],"title":"EngagementOut"},"EntitlementUpdateReq":{"properties":{"entitlements":{"items":{"type":"string"},"type":"array","title":"Entitlements"}},"type":"object","required":["entitlements"],"title":"EntitlementUpdateReq"},"EpsInputsPayload":{"properties":{"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","title":"EpsInputsPayload"},"EquityMethodLine":{"properties":{"investee_id":{"type":"string","title":"Investee Id"},"investee_name":{"type":"string","title":"Investee Name"},"nature":{"type":"string","title":"Nature"},"ownership_percent":{"type":"number","title":"Ownership Percent"},"opening_carrying":{"type":"number","title":"Opening Carrying"},"share_of_pat":{"type":"number","title":"Share Of Pat"},"share_of_oci":{"type":"number","title":"Share Of Oci"},"dividends_received":{"type":"number","title":"Dividends Received"},"additions":{"type":"number","title":"Additions"},"disposals":{"type":"number","title":"Disposals"},"impairment":{"type":"number","title":"Impairment"},"current_period_movement":{"type":"number","title":"Current Period Movement"},"closing_carrying":{"type":"number","title":"Closing Carrying"},"has_data":{"type":"boolean","title":"Has Data"}},"type":"object","required":["investee_id","investee_name","nature","ownership_percent","opening_carrying","share_of_pat","share_of_oci","dividends_received","additions","disposals","impairment","current_period_movement","closing_carrying","has_data"],"title":"EquityMethodLine"},"ErpConnectorOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"connector_kind":{"type":"string","title":"Connector Kind"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"settings":{"additionalProperties":true,"type":"object","title":"Settings","default":{}},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync Status"},"last_sync_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync Notes"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","engagement_id","connector_kind","is_active","created_at"],"title":"ErpConnectorOut"},"ErpConnectorUpsertReq":{"properties":{"connector_kind":{"type":"string","title":"Connector Kind"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"settings":{"additionalProperties":true,"type":"object","title":"Settings","default":{}},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},"type":"object","required":["connector_kind"],"title":"ErpConnectorUpsertReq"},"ExportSettingsOut":{"properties":{"platform_default_days":{"type":"integer","title":"Platform Default Days"},"country_defaults":{"additionalProperties":{"type":"integer"},"type":"object","title":"Country Defaults","default":{}}},"type":"object","required":["platform_default_days"],"title":"ExportSettingsOut"},"ExportSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"ExportSettingsReq"},"ExtendReq":{"properties":{"until":{"type":"string","format":"date","title":"Until"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason"}},"type":"object","required":["until","reason"],"title":"ExtendReq"},"FaceHeadConstituent":{"properties":{"account_name":{"type":"string","title":"Account Name"},"current_raw":{"type":"number","title":"Current Raw","default":0.0},"prior_raw":{"type":"number","title":"Prior Raw","default":0.0}},"type":"object","required":["account_name"],"title":"FaceHeadConstituent"},"FaceHeadOut":{"properties":{"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"statement":{"type":"string","title":"Statement"},"total_current":{"type":"number","title":"Total Current"},"total_prior":{"type":"number","title":"Total Prior"},"constituents":{"items":{"$ref":"#/components/schemas/FaceHeadConstituent"},"type":"array","title":"Constituents"}},"type":"object","required":["code","label","statement","total_current","total_prior","constituents"],"title":"FaceHeadOut"},"FaceHeadsResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"presentation_currency":{"type":"string","title":"Presentation Currency"},"default_scale":{"type":"string","title":"Default Scale"},"has_prior":{"type":"boolean","title":"Has Prior"},"face_heads":{"items":{"$ref":"#/components/schemas/FaceHeadOut"},"type":"array","title":"Face Heads"},"unclassified_count":{"type":"integer","title":"Unclassified Count"}},"type":"object","required":["engagement_id","presentation_currency","default_scale","has_prior","face_heads","unclassified_count"],"title":"FaceHeadsResp"},"FctrComputationLine":{"properties":{"subsidiary_id":{"type":"string","title":"Subsidiary Id"},"subsidiary_name":{"type":"string","title":"Subsidiary Name"},"functional_currency":{"type":"string","title":"Functional Currency"},"closing_assets_fc":{"type":"number","title":"Closing Assets Fc"},"closing_liab_fc":{"type":"number","title":"Closing Liab Fc"},"closing_net_fc":{"type":"number","title":"Closing Net Fc"},"closing_rate":{"type":"number","title":"Closing Rate"},"opening_net_fc":{"type":"number","title":"Opening Net Fc"},"opening_rate":{"type":"number","title":"Opening Rate"},"pnl_fc":{"type":"number","title":"Pnl Fc"},"average_rate":{"type":"number","title":"Average Rate"},"pnl_inr":{"type":"number","title":"Pnl Inr"},"opening_translated_inr":{"type":"number","title":"Opening Translated Inr"},"closing_translated_inr":{"type":"number","title":"Closing Translated Inr"},"pnl_presentation":{"type":"number","title":"Pnl Presentation","default":0.0},"opening_translated_presentation":{"type":"number","title":"Opening Translated Presentation","default":0.0},"closing_translated_presentation":{"type":"number","title":"Closing Translated Presentation","default":0.0},"fctr_current_period":{"type":"number","title":"Fctr Current Period"},"fctr_opening":{"type":"number","title":"Fctr Opening"},"fctr_closing":{"type":"number","title":"Fctr Closing"},"missing_rates":{"items":{"type":"string"},"type":"array","title":"Missing Rates"}},"type":"object","required":["subsidiary_id","subsidiary_name","functional_currency","closing_assets_fc","closing_liab_fc","closing_net_fc","closing_rate","opening_net_fc","opening_rate","pnl_fc","average_rate","pnl_inr","opening_translated_inr","closing_translated_inr","fctr_current_period","fctr_opening","fctr_closing","missing_rates"],"title":"FctrComputationLine"},"FctrPreviewResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"presentation_currency":{"type":"string","title":"Presentation Currency"},"period_label":{"type":"string","title":"Period Label"},"lines":{"items":{"$ref":"#/components/schemas/FctrComputationLine"},"type":"array","title":"Lines"},"fctr_total":{"type":"number","title":"Fctr Total"},"fctr_opening_total":{"type":"number","title":"Fctr Opening Total"},"fctr_closing_total":{"type":"number","title":"Fctr Closing Total"}},"type":"object","required":["engagement_id","presentation_currency","period_label","lines","fctr_total","fctr_opening_total","fctr_closing_total"],"title":"FctrPreviewResp"},"FreezeReq":{"properties":{"snapshot_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Label"}},"type":"object","title":"FreezeReq"},"FsAdjustmentIn":{"properties":{"statement":{"type":"string","title":"Statement"},"section":{"type":"string","title":"Section"},"label":{"type":"string","title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["statement","section","label","amount"],"title":"FsAdjustmentIn"},"FsAdjustmentOut":{"properties":{"id":{"type":"string","title":"Id"},"statement":{"type":"string","title":"Statement"},"section":{"type":"string","title":"Section"},"label":{"type":"string","title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by_user_id":{"type":"string","title":"Created By User Id"}},"type":"object","required":["id","statement","section","label","amount","created_at","created_by_user_id"],"title":"FsAdjustmentOut"},"FsAdjustmentPatch":{"properties":{"amount":{"type":"number","title":"Amount"}},"type":"object","required":["amount"],"title":"FsAdjustmentPatch"},"FsCaptionOut":{"properties":{"line_key":{"type":"string","title":"Line Key"},"caption":{"type":"string","title":"Caption"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["line_key","caption"],"title":"FsCaptionOut"},"FsCaptionPutReq":{"properties":{"line_key":{"type":"string","maxLength":240,"minLength":1,"title":"Line Key"},"caption":{"type":"string","maxLength":240,"title":"Caption","default":""}},"type":"object","required":["line_key"],"title":"FsCaptionPutReq"},"FsInsightApprovalReq":{"properties":{"accepted":{"type":"boolean","title":"Accepted"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["accepted"],"title":"FsInsightApprovalReq"},"FsInsightBullet":{"properties":{"text":{"type":"string","title":"Text"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"citation":{"type":"string","maxLength":255,"minLength":1,"title":"Citation"},"kb_source_id":{"type":"string","maxLength":64,"minLength":1,"title":"Kb Source Id"},"cited_span":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Cited Span"},"disclosure_trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disclosure Trigger"},"comparative_anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparative Anchor"}},"type":"object","required":["text","confidence","citation","kb_source_id"],"title":"FsInsightBullet","description":"One narrative bullet.  Schema mirrors AiGroupingProposal so the\nUI can reuse the KB chunk modal + cited_span highlight from Sprint 1."},"FsInsightResp":{"properties":{"statement_code":{"type":"string","title":"Statement Code"},"bullets":{"items":{"$ref":"#/components/schemas/FsInsightBullet"},"type":"array","title":"Bullets"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"model_version":{"type":"string","title":"Model Version"},"prompt_hash":{"type":"string","title":"Prompt Hash"},"input_hash":{"type":"string","title":"Input Hash"},"stale":{"type":"boolean","title":"Stale","default":false},"accepted_by_partner":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Accepted By Partner"}},"type":"object","required":["statement_code","bullets","generated_at","model_version","prompt_hash","input_hash"],"title":"FsInsightResp"},"FsPackFileOut":{"properties":{"filename":{"type":"string","title":"Filename"},"download_url":{"type":"string","title":"Download Url"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"},"size_bytes":{"type":"integer","title":"Size Bytes"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Framework"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scale"},"include_ppy":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Ppy"}},"type":"object","required":["filename","download_url","size_bytes"],"title":"FsPackFileOut"},"FsPackGenerateReq":{"properties":{"framework":{"anyOf":[{"type":"string","enum":["IFRS","IndAS"]},{"type":"null"}],"title":"Framework"},"scope":{"anyOf":[{"type":"string","enum":["standalone","consolidated"]},{"type":"null"}],"title":"Scope"},"scale":{"anyOf":[{"type":"string","enum":["Actuals","Hundreds","Thousands","Lakhs","Millions","Crores","Billions"]},{"type":"null"}],"title":"Scale"},"include_ppy":{"type":"boolean","title":"Include Ppy","default":false},"lead_schedule_granularity":{"type":"string","enum":["face_head","disclosure","both"],"title":"Lead Schedule Granularity","default":"face_head"},"delete_inapplicable_notes":{"type":"boolean","title":"Delete Inapplicable Notes","default":false}},"type":"object","title":"FsPackGenerateReq"},"FsPackSyncResp":{"properties":{"synced_at":{"type":"string","title":"Synced At"},"engagement_id":{"type":"string","title":"Engagement Id"},"summary":{"$ref":"#/components/schemas/FsPackSyncSummary"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]}},"type":"object","required":["synced_at","engagement_id","summary"],"title":"FsPackSyncResp","description":"X-58 Sprint 6: response of POST /fs/pack/sync.\n\n``warnings`` captures soft conditions (e.g. JE_Log sheet missing\nin the uploaded workbook) so the caller can surface them in the\nUI without treating the upload as a failure."},"FsPackSyncSummary":{"properties":{"je_log_rows_synced":{"type":"integer","title":"Je Log Rows Synced","default":0},"reclass_log_rows_synced":{"type":"integer","title":"Reclass Log Rows Synced","default":0},"conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conflicts","default":[]}},"type":"object","title":"FsPackSyncSummary","description":"X-58 Sprint 6: counts surfaced by the round-trip sync endpoint."},"FsPeriodConfirmReq":{"properties":{"fs_period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period Start"},"fs_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Fs Period End"}},"type":"object","title":"FsPeriodConfirmReq","description":"The dates a preparer is adopting as the FS period."},"GlobalLLMConfigOut":{"properties":{"global_provider":{"type":"string","title":"Global Provider"},"global_model":{"type":"string","title":"Global Model"},"bedrock_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Region"},"bedrock_guardrail_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Guardrail Id"},"bedrock_guardrail_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Guardrail Version"}},"type":"object","required":["global_provider","global_model"],"title":"GlobalLLMConfigOut"},"GlobalLLMConfigReq":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"bedrock_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Region"},"bedrock_guardrail_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Guardrail Id"},"bedrock_guardrail_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedrock Guardrail Version"}},"type":"object","title":"GlobalLLMConfigReq"},"GroupStructureResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"entities":{"items":{"$ref":"#/components/schemas/SubsidiaryOut"},"type":"array","title":"Entities"},"parent_income_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Parent Income Tax Rate"}},"type":"object","required":["engagement_id","entities"],"title":"GroupStructureResp"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HomeLineIn":{"properties":{"scope":{"type":"string","title":"Scope","default":"standalone"},"caption_key":{"type":"string","title":"Caption Key"},"line_section":{"type":"string","title":"Line Section"},"line_label":{"type":"string","title":"Line Label"},"note":{"type":"string","title":"Note"}},"type":"object","required":["caption_key","line_section","line_label","note"],"title":"HomeLineIn"},"IntercompanyCreateReq":{"properties":{"from_subsidiary":{"type":"string","title":"From Subsidiary"},"to_subsidiary":{"type":"string","title":"To Subsidiary"},"relation_type":{"type":"string","title":"Relation Type"},"amount_inr":{"type":"number","title":"Amount Inr","default":0.0},"period_label":{"type":"string","title":"Period Label","default":"current"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"eliminate":{"type":"boolean","title":"Eliminate","default":true}},"type":"object","required":["from_subsidiary","to_subsidiary","relation_type"],"title":"IntercompanyCreateReq"},"IntercompanyOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"from_subsidiary":{"type":"string","title":"From Subsidiary"},"to_subsidiary":{"type":"string","title":"To Subsidiary"},"relation_type":{"type":"string","title":"Relation Type"},"amount_inr":{"type":"number","title":"Amount Inr"},"period_label":{"type":"string","title":"Period Label"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"eliminate":{"type":"boolean","title":"Eliminate","default":true}},"type":"object","required":["id","engagement_id","from_subsidiary","to_subsidiary","relation_type","amount_inr","period_label"],"title":"IntercompanyOut"},"IntercompanyUpdateReq":{"properties":{"from_subsidiary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Subsidiary"},"to_subsidiary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Subsidiary"},"relation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relation Type"},"amount_inr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Inr"},"period_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"eliminate":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Eliminate"}},"type":"object","title":"IntercompanyUpdateReq"},"InvitationExpiryUpdateReq":{"properties":{"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days"}},"type":"object","title":"InvitationExpiryUpdateReq","description":"14 Jun 2026: owner-driven expiry edit on an existing PENDING\ninvitation.  Same accept-either-form rule as on create.  An\naccepted / revoked invitation can NOT be re-aged — the owner\nhas to revoke + re-invite instead."},"InvitationIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","title":"Role"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["email","role"],"title":"InvitationIn"},"InvitationLinkOut":{"properties":{"accept_path":{"type":"string","title":"Accept Path"},"accept_url":{"type":"string","title":"Accept Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["accept_path","accept_url","expires_at"],"title":"InvitationLinkOut"},"InvitationOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"invited_by_user_id":{"type":"string","title":"Invited By User Id"},"invited_at":{"type":"string","format":"date-time","title":"Invited At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"accept_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accept Token"},"accept_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accept Url"}},"type":"object","required":["id","tenant_id","email","role","invited_by_user_id","invited_at","expires_at"],"title":"InvitationOut"},"InvitationPreview":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"invited_by_email":{"type":"string","title":"Invited By Email"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"is_expired":{"type":"boolean","title":"Is Expired"}},"type":"object","required":["tenant_id","tenant_name","email","role","invited_by_email","expires_at","is_expired"],"title":"InvitationPreview","description":"Public preview of an invitation (no auth required)."},"InvoicePoRequest":{"properties":{"plan_code":{"type":"string","title":"Plan Code"},"po_reference":{"type":"string","title":"Po Reference"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["plan_code","po_reference"],"title":"InvoicePoRequest"},"IssueCertificateReq":{"properties":{"learner_name":{"type":"string","title":"Learner Name"},"tier":{"type":"string","title":"Tier"}},"type":"object","required":["learner_name","tier"],"title":"IssueCertificateReq"},"JeCreateReq":{"properties":{"entry_date":{"type":"string","format":"date","title":"Entry Date"},"period_label":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Period Label"},"narration":{"type":"string","maxLength":2000,"minLength":1,"title":"Narration"},"entry_type":{"type":"string","maxLength":32,"title":"Entry Type","default":"topside"},"lines":{"items":{"$ref":"#/components/schemas/JeLineReq"},"type":"array","minItems":2,"title":"Lines"},"post_now":{"type":"boolean","title":"Post Now","default":false}},"type":"object","required":["entry_date","narration","lines"],"title":"JeCreateReq"},"JeImportResult":{"properties":{"created":{"type":"integer","title":"Created"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"je_ids":{"items":{"type":"string"},"type":"array","title":"Je Ids","default":[]},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["created","skipped","errors","summary"],"title":"JeImportResult"},"JeLineOut":{"properties":{"id":{"type":"string","title":"Id"},"line_no":{"type":"integer","title":"Line No"},"account_name":{"type":"string","title":"Account Name"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"debit":{"type":"number","title":"Debit"},"credit":{"type":"number","title":"Credit"},"line_narration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line Narration"}},"type":"object","required":["id","line_no","account_name","account_code","debit","credit","line_narration"],"title":"JeLineOut"},"JeLineReq":{"properties":{"account_name":{"type":"string","maxLength":255,"minLength":1,"title":"Account Name"},"account_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Account Code"},"debit":{"type":"number","minimum":0.0,"title":"Debit","default":0.0},"credit":{"type":"number","minimum":0.0,"title":"Credit","default":0.0},"line_narration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line Narration"}},"type":"object","required":["account_name"],"title":"JeLineReq"},"JeOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"entry_no":{"type":"integer","title":"Entry No"},"entry_date":{"type":"string","title":"Entry Date"},"period_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"},"narration":{"type":"string","title":"Narration"},"entry_type":{"type":"string","title":"Entry Type"},"posted":{"type":"boolean","title":"Posted"},"posted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted At"},"posted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","title":"Created At"},"total_debit":{"type":"number","title":"Total Debit"},"total_credit":{"type":"number","title":"Total Credit"},"balanced":{"type":"boolean","title":"Balanced"},"lines":{"items":{"$ref":"#/components/schemas/JeLineOut"},"type":"array","title":"Lines"}},"type":"object","required":["id","engagement_id","entry_no","entry_date","period_label","narration","entry_type","posted","posted_at","posted_by","created_by","created_at","total_debit","total_credit","balanced","lines"],"title":"JeOut"},"JournalApprovalCreateReq":{"properties":{"subject_kind":{"type":"string","title":"Subject Kind","description":"One of PnlAdjustment | FsAdjustment"},"pnl_payload":{"anyOf":[{"$ref":"#/components/schemas/JournalApprovalPnlPayload"},{"type":"null"}]},"fs_payload":{"anyOf":[{"$ref":"#/components/schemas/JournalApprovalFsPayload"},{"type":"null"}]}},"type":"object","required":["subject_kind"],"title":"JournalApprovalCreateReq"},"JournalApprovalFsPayload":{"properties":{"statement":{"type":"string","maxLength":16,"minLength":1,"title":"Statement"},"section":{"type":"string","maxLength":64,"minLength":1,"title":"Section"},"label":{"type":"string","maxLength":300,"minLength":1,"title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","required":["statement","section","label","amount"],"title":"JournalApprovalFsPayload"},"JournalApprovalPnlPayload":{"properties":{"category":{"type":"string","maxLength":32,"minLength":1,"title":"Category"},"label":{"type":"string","maxLength":300,"minLength":1,"title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","required":["category","label","amount"],"title":"JournalApprovalPnlPayload"},"JournalApprovalRejectReq":{"properties":{"note":{"type":"string","maxLength":2000,"minLength":1,"title":"Note","description":"Reason for rejection (mandatory)."}},"type":"object","required":["note"],"title":"JournalApprovalRejectReq"},"JournalApprovalReviewReq":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","title":"JournalApprovalReviewReq"},"KBChunkOut":{"properties":{"id":{"type":"string","title":"Id"},"paragraph_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Ref"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"},"heading":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heading"},"text":{"type":"string","title":"Text"},"content_hash":{"type":"string","title":"Content Hash"},"topic_tags":{"items":{"type":"string"},"type":"array","title":"Topic Tags"},"jurisdiction":{"type":"string","title":"Jurisdiction"},"chunk_type":{"type":"string","title":"Chunk Type"},"publisher":{"type":"string","title":"Publisher"},"source_title":{"type":"string","title":"Source Title"},"publication_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Date"},"further_reading_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Further Reading Title"},"further_reading_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Further Reading Url"}},"type":"object","required":["id","paragraph_ref","page","heading","text","content_hash","topic_tags","jurisdiction","chunk_type","publisher","source_title","publication_date"],"title":"KBChunkOut"},"KBReingestResp":{"properties":{"ok":{"type":"boolean","title":"Ok"},"kb_version":{"type":"string","title":"Kb Version"},"verbatim_sources":{"type":"integer","title":"Verbatim Sources"},"verbatim_chunks":{"type":"integer","title":"Verbatim Chunks"},"summary_sources":{"type":"integer","title":"Summary Sources"},"summary_chunks":{"type":"integer","title":"Summary Chunks"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["ok","kb_version","verbatim_sources","verbatim_chunks","summary_sources","summary_chunks","detail"],"title":"KBReingestResp"},"KBSourceOut":{"properties":{"id":{"type":"string","title":"Id"},"publisher":{"type":"string","title":"Publisher"},"title":{"type":"string","title":"Title"},"publication_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publication Date"},"jurisdiction":{"type":"string","title":"Jurisdiction"},"page_count":{"type":"integer","title":"Page Count"},"ingest_mode":{"type":"string","title":"Ingest Mode"},"chunk_count":{"type":"integer","title":"Chunk Count"},"license_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Note"},"kb_version":{"type":"string","title":"Kb Version"},"ingested_at":{"type":"string","title":"Ingested At"}},"type":"object","required":["id","publisher","title","publication_date","jurisdiction","page_count","ingest_mode","chunk_count","license_note","kb_version","ingested_at"],"title":"KBSourceOut"},"LeadCreateReq":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"audience":{"type":"string","enum":["corporate","advisory","unspecified"],"title":"Audience","default":"unspecified"},"module_key":{"type":"string","maxLength":64,"title":"Module Key","default":"ifrs18_assessment"},"message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Message"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source"}},"type":"object","required":["name","email"],"title":"LeadCreateReq"},"LeadCreateResp":{"properties":{"id":{"type":"string","title":"Id"},"received":{"type":"boolean","title":"Received","default":true},"notified":{"type":"boolean","title":"Notified"}},"type":"object","required":["id","notified"],"title":"LeadCreateResp"},"LeaseInputsPayload":{"properties":{"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","title":"LeaseInputsPayload"},"LedgerCorrectionReq":{"properties":{"original_label":{"type":"string","maxLength":255,"minLength":1,"title":"Original Label"},"corrected_name":{"type":"string","maxLength":255,"minLength":1,"title":"Corrected Name"},"corrected_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Corrected Code"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","required":["original_label","corrected_name"],"title":"LedgerCorrectionReq"},"LegIn":{"properties":{"caption_key":{"type":"string","title":"Caption Key"},"line_section":{"type":"string","title":"Line Section"},"line_label":{"type":"string","title":"Line Label"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["caption_key","line_section","line_label","amount"],"title":"LegIn"},"LineOrderItem":{"properties":{"line_key":{"type":"string","title":"Line Key"},"position":{"type":"integer","title":"Position"}},"type":"object","required":["line_key","position"],"title":"LineOrderItem"},"LineOrderPutReq":{"properties":{"ordered_line_keys":{"items":{"type":"string"},"type":"array","title":"Ordered Line Keys"}},"type":"object","title":"LineOrderPutReq"},"LiquidityTableReq":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"LiquidityTableReq"},"LoginReq":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["email","password"],"title":"LoginReq"},"ManualTbRowReq":{"properties":{"account_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Account Code"},"account_name":{"type":"string","maxLength":255,"minLength":1,"title":"Account Name"},"debit":{"type":"number","minimum":0.0,"title":"Debit","default":0.0},"credit":{"type":"number","minimum":0.0,"title":"Credit","default":0.0},"prior_debit":{"type":"number","minimum":0.0,"title":"Prior Debit","default":0.0},"prior_credit":{"type":"number","minimum":0.0,"title":"Prior Credit","default":0.0}},"type":"object","required":["account_name"],"title":"ManualTbRowReq"},"MappingFlagAcceptReq":{"properties":{"accepted":{"type":"boolean","title":"Accepted","default":true},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation"}},"type":"object","title":"MappingFlagAcceptReq"},"MappingReviewCounts":{"properties":{"all":{"type":"integer","title":"All"},"ai_accepted":{"type":"integer","title":"Ai Accepted"},"ai_abstained":{"type":"integer","title":"Ai Abstained"},"manual":{"type":"integer","title":"Manual"},"review_required":{"type":"integer","title":"Review Required","default":0}},"type":"object","required":["all","ai_accepted","ai_abstained","manual"],"title":"MappingReviewCounts"},"MappingReviewResp":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/MappingReviewRow"},"type":"array","title":"Rows"},"counts":{"$ref":"#/components/schemas/MappingReviewCounts"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["rows","counts","page","page_size","total"],"title":"MappingReviewResp"},"MappingReviewRow":{"properties":{"override_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Id"},"account_name":{"type":"string","title":"Account Name"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"override_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Category"},"nli_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nli Code"},"resolution_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Status"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"citation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Citation"},"kb_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Source Id"},"cited_span":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Cited Span"},"accepted_by_ai":{"type":"boolean","title":"Accepted By Ai","default":false},"set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Set At"},"set_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set By User Id"},"model_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Version"},"prompt_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Hash"},"kind":{"type":"string","title":"Kind"}},"type":"object","required":["account_name","kind"],"title":"MappingReviewRow"},"MaterialityReq":{"properties":{"overall_materiality_inr_cr":{"type":"number","exclusiveMinimum":0.0,"title":"Overall Materiality Inr Cr"},"performance_materiality_inr_cr":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Performance Materiality Inr Cr"},"clearly_trivial_threshold_inr_cr":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Clearly Trivial Threshold Inr Cr"},"basis_of_materiality":{"type":"string","maxLength":2000,"title":"Basis Of Materiality","default":""},"benchmark":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Benchmark"},"benchmark_amount_inr_cr":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Benchmark Amount Inr Cr"},"benchmark_percentage":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Benchmark Percentage"},"performance_percentage_of_overall":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Performance Percentage Of Overall"},"clearly_trivial_percentage_of_performance":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Clearly Trivial Percentage Of Performance"}},"type":"object","required":["overall_materiality_inr_cr"],"title":"MaterialityReq"},"MemoBodyOut":{"properties":{"record":{"$ref":"#/components/schemas/MemoRecordOut"},"body":{"additionalProperties":true,"type":"object","title":"Body"},"notes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Notes"}},"type":"object","required":["record","body","notes"],"title":"MemoBodyOut"},"MemoFinalizeReq":{"properties":{"filename":{"type":"string","title":"Filename"}},"type":"object","required":["filename"],"title":"MemoFinalizeReq"},"MemoFinalizeResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"run_id":{"type":"string","title":"Run Id"},"final_filename":{"type":"string","title":"Final Filename"},"final_download_url":{"type":"string","title":"Final Download Url"},"archived_count":{"type":"integer","title":"Archived Count"},"pending_track_changes_before":{"type":"boolean","title":"Pending Track Changes Before"}},"type":"object","required":["engagement_id","run_id","final_filename","final_download_url","archived_count","pending_track_changes_before"],"title":"MemoFinalizeResp"},"MemoRecordOut":{"properties":{"id":{"type":"string","title":"Id"},"run_id":{"type":"string","title":"Run Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"engagement_legal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Legal Name"},"memo_id":{"type":"string","title":"Memo Id"},"template":{"type":"string","title":"Template"},"topic":{"type":"string","title":"Topic"},"drafter_version":{"type":"string","title":"Drafter Version"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"review_required":{"type":"boolean","title":"Review Required"},"content_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Hash"},"workflow_status":{"type":"string","title":"Workflow Status"},"assigned_reviewer_tc_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Reviewer Tc Id"},"assigned_reviewer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Reviewer Name"},"drafted_at":{"type":"string","format":"date-time","title":"Drafted At"},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Assigned At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"open_notes":{"type":"integer","title":"Open Notes","default":0}},"type":"object","required":["id","run_id","engagement_id","memo_id","template","topic","drafter_version","review_required","workflow_status","drafted_at"],"title":"MemoRecordOut"},"MemoSectionPatchReq":{"properties":{"sections":{"additionalProperties":{"type":"string"},"type":"object","title":"Sections"},"edit_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Edit Note"}},"type":"object","required":["sections"],"title":"MemoSectionPatchReq"},"MfaConfirmReq":{"properties":{"code":{"type":"string","maxLength":10,"minLength":4,"title":"Code"}},"type":"object","required":["code"],"title":"MfaConfirmReq"},"MfaDisableReq":{"properties":{"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"MfaDisableReq"},"MfaEnrolStartReq":{"properties":{"password":{"type":"string","title":"Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["password"],"title":"MfaEnrolStartReq","description":"X-19 audit fix: require password re-prove on enrol/start so a\nstolen bearer token cannot silently re-key MFA (which would\notherwise let an attacker bypass step-up MFA on memo approval\nby clearing totp_enrolled_at)."},"MfaEnrolStartResp":{"properties":{"secret":{"type":"string","title":"Secret"},"provisioning_uri":{"type":"string","title":"Provisioning Uri"}},"type":"object","required":["secret","provisioning_uri"],"title":"MfaEnrolStartResp"},"MpmAdjustmentRule":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"account_keywords":{"items":{"type":"string"},"type":"array","title":"Account Keywords","default":[]},"sign":{"type":"string","title":"Sign","default":"+1"},"tax_deductible":{"type":"boolean","title":"Tax Deductible","default":true},"nci_eligible":{"type":"boolean","title":"Nci Eligible","default":true},"row_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Row Tax Rate"}},"type":"object","required":["label"],"title":"MpmAdjustmentRule"},"MpmClassifyReq":{"properties":{"label":{"type":"string","title":"Label"},"is_subtotal_of_income_and_expenses":{"type":"boolean","title":"Is Subtotal Of Income And Expenses","default":false},"is_required_by_other_ifrs_standard":{"type":"boolean","title":"Is Required By Other Ifrs Standard","default":false},"used_in_public_communications":{"type":"boolean","title":"Used In Public Communications","default":false},"rebutted_by_evidence":{"type":"boolean","title":"Rebutted By Evidence","default":false}},"type":"object","required":["label"],"title":"MpmClassifyReq","description":"Inputs for the MPM Decision Wizard.  See engines/m_mpm.py for\nthe full 5-step decision tree.\n\n14 Jun 2026 (bug-fix): is_subtotal_of_income_and_expenses +\nused_in_public_communications now default to FALSE.  When the UI\nsends a candidate label without the user having explicitly\nticked these prongs, the decision tree must NOT auto-pass.  The\nuser reported \"cash flow\" producing an IS-an-MPM verdict because\nProng 1 + Prong 2 were pre-ticked AND the catalogue missed the\nbare {cash, flow} token group.  Catalogue gap is closed in\nengines/m_mpm.py; the conservative defaults here are defence in\ndepth for any future catalogue miss."},"MpmCreateReq":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"comparable_ifrs_subtotal":{"type":"string","maxLength":80,"minLength":1,"title":"Comparable Ifrs Subtotal"},"definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition"},"external_use_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Use Basis"},"effective_tax_rate":{"type":"number","title":"Effective Tax Rate","default":0.2517},"nci_share_pct":{"type":"number","title":"Nci Share Pct","default":0.0},"currency":{"type":"string","title":"Currency","default":"INR"},"adjustments":{"items":{"$ref":"#/components/schemas/MpmAdjustmentRule"},"type":"array","title":"Adjustments","default":[]},"tax_method":{"anyOf":[{"type":"string","pattern":"^[AB]$"},{"type":"null"}],"title":"Tax Method","default":"B"}},"type":"object","required":["name","comparable_ifrs_subtotal"],"title":"MpmCreateReq"},"MpmDetectResp":{"properties":{"detected":{"items":{"$ref":"#/components/schemas/MpmProposal"},"type":"array","title":"Detected"},"used_llm":{"type":"boolean","title":"Used Llm"},"pages_scanned":{"type":"integer","title":"Pages Scanned"},"llm_unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Unavailable Reason"}},"type":"object","required":["detected","used_llm","pages_scanned"],"title":"MpmDetectResp"},"MpmOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"name":{"type":"string","title":"Name"},"comparable_ifrs_subtotal":{"type":"string","title":"Comparable Ifrs Subtotal"},"definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition"},"external_use_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Use Basis"},"effective_tax_rate":{"type":"number","title":"Effective Tax Rate"},"nci_share_pct":{"type":"number","title":"Nci Share Pct"},"currency":{"type":"string","title":"Currency"},"adjustments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Adjustments","default":[]},"tax_method":{"type":"string","title":"Tax Method","default":"B"},"evidence_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Quote"},"evidence_source_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Source Label"},"evidence_upload_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Upload Id"},"wizard_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wizard Verdict"},"wizard_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wizard Reason"},"wizard_paragraph":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wizard Paragraph"},"status":{"type":"string","title":"Status","default":"active"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","engagement_id","name","comparable_ifrs_subtotal","effective_tax_rate","nci_share_pct","currency","created_at","updated_at"],"title":"MpmOut"},"MpmProposal":{"properties":{"name":{"type":"string","title":"Name"},"comparable_ifrs_subtotal":{"type":"string","title":"Comparable Ifrs Subtotal"},"definition_paraphrase":{"type":"string","title":"Definition Paraphrase"},"ar_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ar Page"},"quote_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote Excerpt"},"confidence":{"type":"number","title":"Confidence","default":0.0},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"}},"type":"object","required":["name","comparable_ifrs_subtotal","definition_paraphrase"],"title":"MpmProposal"},"MpmRescanResp":{"properties":{"cleared":{"type":"integer","title":"Cleared"},"seeded":{"type":"integer","title":"Seeded"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["cleared","seeded","summary"],"title":"MpmRescanResp"},"MpmUpdateReq":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"comparable_ifrs_subtotal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparable Ifrs Subtotal"},"definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition"},"external_use_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Use Basis"},"effective_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Tax Rate"},"nci_share_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nci Share Pct"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"adjustments":{"anyOf":[{"items":{"$ref":"#/components/schemas/MpmAdjustmentRule"},"type":"array"},{"type":"null"}],"title":"Adjustments"},"tax_method":{"anyOf":[{"type":"string","pattern":"^[AB]$"},{"type":"null"}],"title":"Tax Method"}},"type":"object","title":"MpmUpdateReq"},"MyInvitationOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"role":{"type":"string","title":"Role"},"invited_by_email":{"type":"string","title":"Invited By Email"},"invited_at":{"type":"string","format":"date-time","title":"Invited At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"accept_token":{"type":"string","title":"Accept Token"},"accept_url":{"type":"string","title":"Accept Url"}},"type":"object","required":["id","tenant_id","tenant_name","role","invited_by_email","invited_at","expires_at","accept_token","accept_url"],"title":"MyInvitationOut","description":"Invitee-facing view of a pending invitation.\n\nReturned by ``GET /api/me/invitations``.  Carries everything the\ninvitee needs to one-click accept from the empty-state of\nTenantsPage — including the accept token + URL (scoped strictly\nto invitations matching the signed-in user's email, so this\ncannot be used to enumerate other users' pending tokens)."},"NciPreviewLine":{"properties":{"subsidiary_id":{"type":"string","title":"Subsidiary Id"},"subsidiary_name":{"type":"string","title":"Subsidiary Name"},"nci_percent":{"type":"number","title":"Nci Percent"},"opening_nci":{"type":"number","title":"Opening Nci"},"nci_share_of_pat":{"type":"number","title":"Nci Share Of Pat"},"nci_share_of_oci":{"type":"number","title":"Nci Share Of Oci"},"nci_dividends":{"type":"number","title":"Nci Dividends"},"ownership_change":{"type":"number","title":"Ownership Change"},"acquired_nci":{"type":"number","title":"Acquired Nci"},"disposed_nci":{"type":"number","title":"Disposed Nci"},"current_period_movement":{"type":"number","title":"Current Period Movement"},"closing_nci":{"type":"number","title":"Closing Nci"},"has_pl_data":{"type":"boolean","title":"Has Pl Data"}},"type":"object","required":["subsidiary_id","subsidiary_name","nci_percent","opening_nci","nci_share_of_pat","nci_share_of_oci","nci_dividends","ownership_change","acquired_nci","disposed_nci","current_period_movement","closing_nci","has_pl_data"],"title":"NciPreviewLine"},"NciPreviewResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"presentation_currency":{"type":"string","title":"Presentation Currency"},"period_label":{"type":"string","title":"Period Label"},"nci_lines":{"items":{"$ref":"#/components/schemas/NciPreviewLine"},"type":"array","title":"Nci Lines"},"nci_group_opening":{"type":"number","title":"Nci Group Opening"},"nci_group_movement":{"type":"number","title":"Nci Group Movement"},"nci_group_closing":{"type":"number","title":"Nci Group Closing"},"nci_count_with_nci":{"type":"integer","title":"Nci Count With Nci"},"nci_coverage":{"type":"string","title":"Nci Coverage"},"equity_method_lines":{"items":{"$ref":"#/components/schemas/EquityMethodLine"},"type":"array","title":"Equity Method Lines"},"equity_method_group_opening_carrying":{"type":"number","title":"Equity Method Group Opening Carrying"},"equity_method_group_movement":{"type":"number","title":"Equity Method Group Movement"},"equity_method_group_closing_carrying":{"type":"number","title":"Equity Method Group Closing Carrying"},"equity_method_count":{"type":"integer","title":"Equity Method Count"},"equity_method_coverage":{"type":"string","title":"Equity Method Coverage"}},"type":"object","required":["engagement_id","presentation_currency","period_label","nci_lines","nci_group_opening","nci_group_movement","nci_group_closing","nci_count_with_nci","nci_coverage","equity_method_lines","equity_method_group_opening_carrying","equity_method_group_movement","equity_method_group_closing_carrying","equity_method_count","equity_method_coverage"],"title":"NciPreviewResp"},"NliOrderItem":{"properties":{"nli_head":{"type":"string","title":"Nli Head"},"position":{"type":"integer","title":"Position"}},"type":"object","required":["nli_head","position"],"title":"NliOrderItem"},"NliOrderPutReq":{"properties":{"ordered_nli_heads":{"items":{"type":"string"},"type":"array","title":"Ordered Nli Heads"}},"type":"object","title":"NliOrderPutReq"},"NoteFootnoteOut":{"properties":{"note_key":{"type":"string","title":"Note Key"},"footnote_html":{"type":"string","title":"Footnote Html"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["note_key","footnote_html"],"title":"NoteFootnoteOut"},"NoteFootnotePutReq":{"properties":{"footnote_html":{"type":"string","title":"Footnote Html","default":""}},"type":"object","title":"NoteFootnotePutReq"},"NotesArExtractReq":{"properties":{"custom_instructions":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Custom Instructions"},"persist":{"type":"boolean","title":"Persist","default":true}},"type":"object","title":"NotesArExtractReq","description":"6 Jul 2026 — optional body for the extract-ar endpoint.\n\nPreparer supplies per-topic instructions to steer the LLM\nextraction; when omitted, the extractor uses instructions\npersisted from a prior PUT to /extract-ar/instructions (if any),\notherwise runs the bare default queries.\n\n``custom_instructions`` keys are topic slugs (see\n``NOTE_BODY_TOPIC_KEYS`` in the extractor module) or the reserved\n``__all__`` for engagement-wide guidance.  Values are free-text."},"NotesArExtractResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"extracted":{"additionalProperties":true,"type":"object","title":"Extracted"},"model_version":{"type":"string","title":"Model Version"},"input_hash":{"type":"string","title":"Input Hash"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["engagement_id","extracted","model_version","input_hash","generated_at"],"title":"NotesArExtractResp"},"NotesArInstructionsReq":{"properties":{"instructions":{"additionalProperties":{"type":"string"},"type":"object","title":"Instructions"}},"type":"object","required":["instructions"],"title":"NotesArInstructionsReq"},"NotesArInstructionsResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"instructions":{"additionalProperties":{"type":"string"},"type":"object","title":"Instructions"},"topic_keys":{"items":{"type":"string"},"type":"array","title":"Topic Keys"}},"type":"object","required":["engagement_id","instructions","topic_keys"],"title":"NotesArInstructionsResp"},"OrganisationOnboardOut":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"owner_email":{"type":"string","title":"Owner Email"},"invitation_id":{"type":"string","title":"Invitation Id"},"accept_url":{"type":"string","title":"Accept Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"email_sent":{"type":"boolean","title":"Email Sent"}},"type":"object","required":["tenant_id","name","kind","owner_email","invitation_id","accept_url","expires_at","email_sent"],"title":"OrganisationOnboardOut"},"OrganisationOnboardReq":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"kind":{"type":"string","enum":["organisation","advisory_firm"],"title":"Kind"},"industry":{"type":"string","title":"Industry","default":"Other"},"country":{"type":"string","title":"Country","default":"IN"},"owner_email":{"type":"string","format":"email","title":"Owner Email"},"owner_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Owner Name"},"entitlements":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entitlements"},"trial_days":{"type":"integer","maximum":90.0,"minimum":0.0,"title":"Trial Days","default":14}},"type":"object","required":["name","kind","owner_email"],"title":"OrganisationOnboardReq"},"ParentTaxRateReq":{"properties":{"income_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Income Tax Rate"}},"type":"object","title":"ParentTaxRateReq"},"PasswordResetConfirmReq":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"PasswordResetConfirmReq"},"PasswordResetRequestReq":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"PasswordResetRequestReq"},"PaymentReq":{"properties":{"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"method":{"type":"string","enum":["bank_transfer","upi","cheque","cash","other"],"title":"Method"},"reference":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reference"},"received_on":{"type":"string","format":"date","title":"Received On"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["amount","method","received_on"],"title":"PaymentReq"},"PeriodSnapshotResp":{"properties":{"id":{"type":"string","title":"Id"},"period_end":{"type":"string","title":"Period End"},"snapshot_label":{"type":"string","title":"Snapshot Label"},"snapshot_at":{"type":"string","title":"Snapshot At"},"frozen_by_user_id":{"type":"string","title":"Frozen By User Id"},"frozen_by_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frozen By User Name"},"preparer_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparer User Id"},"preparer_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparer Signed At"},"reviewer_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer User Id"},"reviewer_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Signed At"},"partner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner User Id"},"partner_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Signed At"},"payload_hash":{"type":"string","title":"Payload Hash"}},"type":"object","required":["id","period_end","snapshot_label","snapshot_at","frozen_by_user_id","payload_hash"],"title":"PeriodSnapshotResp"},"PlanUpdateReq":{"properties":{"action":{"type":"string","title":"Action","description":"'extend_days' | 'activate'"},"days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Days","description":"Days to add to trial_until (required for extend_days)"}},"type":"object","required":["action"],"title":"PlanUpdateReq"},"PnlAdjustmentIn":{"properties":{"category":{"type":"string","title":"Category"},"label":{"type":"string","title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["category","label","amount"],"title":"PnlAdjustmentIn"},"PnlAdjustmentOut":{"properties":{"id":{"type":"string","title":"Id"},"category":{"type":"string","title":"Category"},"label":{"type":"string","title":"Label"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by_user_id":{"type":"string","title":"Created By User Id"}},"type":"object","required":["id","category","label","amount","created_at","created_by_user_id"],"title":"PnlAdjustmentOut"},"ProgressOut":{"properties":{"passed_courses":{"items":{"type":"string"},"type":"array","title":"Passed Courses"},"eligible_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eligible Tier"},"attempts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Attempts"}},"type":"object","required":["passed_courses","eligible_tier","attempts"],"title":"ProgressOut"},"PublishReq":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"base_version":{"type":"integer","title":"Base Version"},"source":{"type":"string","enum":["import","edit"],"title":"Source","default":"import"}},"type":"object","required":["rows","base_version"],"title":"PublishReq"},"QuizOut":{"properties":{"quiz_id":{"type":"string","title":"Quiz Id"},"course_id":{"type":"string","title":"Course Id"},"pass_mark_pct":{"type":"number","title":"Pass Mark Pct"},"time_limit_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time Limit Minutes"},"questions":{"items":{"$ref":"#/components/schemas/QuizQuestionPublicOut"},"type":"array","title":"Questions"}},"type":"object","required":["quiz_id","course_id","pass_mark_pct","questions"],"title":"QuizOut"},"QuizQuestionPublicOut":{"properties":{"qid":{"type":"string","title":"Qid"},"type":{"type":"string","title":"Type"},"case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case"},"stem":{"type":"string","title":"Stem"},"options":{"items":{"type":"string"},"type":"array","title":"Options"}},"type":"object","required":["qid","type","stem","options"],"title":"QuizQuestionPublicOut"},"QuizQuestionResultOut":{"properties":{"qid":{"type":"string","title":"Qid"},"selected":{"items":{"type":"integer"},"type":"array","title":"Selected"},"correct":{"items":{"type":"integer"},"type":"array","title":"Correct"},"is_correct":{"type":"boolean","title":"Is Correct"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["qid","selected","correct","is_correct","rationale"],"title":"QuizQuestionResultOut"},"QuizResultOut":{"properties":{"attempt_id":{"type":"string","title":"Attempt Id"},"course_id":{"type":"string","title":"Course Id"},"quiz_id":{"type":"string","title":"Quiz Id"},"score_pct":{"type":"number","title":"Score Pct"},"passed":{"type":"boolean","title":"Passed"},"pass_mark_pct":{"type":"number","title":"Pass Mark Pct"},"questions":{"items":{"$ref":"#/components/schemas/QuizQuestionResultOut"},"type":"array","title":"Questions"}},"type":"object","required":["attempt_id","course_id","quiz_id","score_pct","passed","pass_mark_pct","questions"],"title":"QuizResultOut"},"QuizSubmitReq":{"properties":{"answers":{"additionalProperties":{"items":{"type":"integer"},"type":"array"},"type":"object","title":"Answers"}},"type":"object","required":["answers"],"title":"QuizSubmitReq"},"RaiseNoteReq":{"properties":{"note":{"type":"string","title":"Note"},"paragraph_anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Anchor"},"paragraph_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Text"}},"type":"object","required":["note"],"title":"RaiseNoteReq"},"RatioInputsReq":{"properties":{"extras":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Extras"},"explanations":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Explanations"}},"type":"object","title":"RatioInputsReq"},"ReadinessComponent":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"weight":{"type":"integer","title":"Weight"},"complete":{"type":"boolean","title":"Complete"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["key","label","weight","complete","detail"],"title":"ReadinessComponent"},"ReadinessResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"percent":{"type":"integer","title":"Percent"},"steps_left":{"type":"integer","title":"Steps Left"},"components":{"items":{"$ref":"#/components/schemas/ReadinessComponent"},"type":"array","title":"Components"},"computed_at":{"type":"string","title":"Computed At"}},"type":"object","required":["engagement_id","percent","steps_left","components","computed_at"],"title":"ReadinessResp"},"ReasonReq":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"ReasonReq"},"RegisterReq":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"full_name":{"type":"string","maxLength":255,"minLength":1,"title":"Full Name"},"module":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Module"},"audience":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Audience"},"invitation_token":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["email","password","full_name"],"title":"RegisterReq"},"RejectReq":{"properties":{"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"RejectReq"},"RetentionReq":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"years":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Years"}},"type":"object","required":["enabled"],"title":"RetentionReq"},"ReviewIn":{"properties":{"scope":{"type":"string","title":"Scope","default":"standalone"},"caption_key":{"type":"string","title":"Caption Key"},"note":{"type":"string","title":"Note"}},"type":"object","required":["caption_key","note"],"title":"ReviewIn"},"RoleChangeReq":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleChangeReq"},"RollForwardReq":{"properties":{"new_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Code"},"new_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Name"},"new_first_ifrs18_year_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New First Ifrs18 Year End"},"copy_mpms":{"type":"boolean","title":"Copy Mpms","default":true},"copy_erp_connectors":{"type":"boolean","title":"Copy Erp Connectors","default":true}},"type":"object","title":"RollForwardReq"},"RollForwardResp":{"properties":{"old_engagement_id":{"type":"string","title":"Old Engagement Id"},"new_engagement_id":{"type":"string","title":"New Engagement Id"},"new_code":{"type":"string","title":"New Code"},"new_first_ifrs18_year_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New First Ifrs18 Year End"},"summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Summary"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]}},"type":"object","required":["old_engagement_id","new_engagement_id","new_code","summary"],"title":"RollForwardResp"},"RunOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status","default":"queued"},"progress_percent":{"type":"integer","title":"Progress Percent","default":0},"progress_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Step"},"queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Queued At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"archetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archetype"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"gap_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gap Count"},"risk_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Risk Count"},"task_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Count"},"memo_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memo Count"},"audit_chain_valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Audit Chain Valid"},"files":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Files","default":[]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"m1_llm_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"M1 Llm Detail"}},"type":"object","required":["id"],"title":"RunOut"},"SignOffReq":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"SignOffReq"},"SignOffStateResp":{"properties":{"preparer_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparer User Id"},"preparer_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparer User Name"},"preparer_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preparer Signed At"},"reviewer_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer User Id"},"reviewer_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer User Name"},"reviewer_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Signed At"},"partner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner User Id"},"partner_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner User Name"},"partner_signed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Signed At"},"can_freeze":{"type":"boolean","title":"Can Freeze","default":false},"snapshot_count":{"type":"integer","title":"Snapshot Count","default":0},"reporting_period_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reporting Period Source"},"reporting_period_blocks_signoff":{"type":"boolean","title":"Reporting Period Blocks Signoff","default":false}},"type":"object","title":"SignOffStateResp"},"SignoffReadinessResp":{"properties":{"ready":{"type":"boolean","title":"Ready"},"blocker_count":{"type":"integer","title":"Blocker Count"},"blockers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Blockers"},"gates":{"items":{"type":"string"},"type":"array","title":"Gates"},"checked_at":{"type":"string","title":"Checked At"}},"type":"object","required":["ready","blocker_count","blockers","gates","checked_at"],"title":"SignoffReadinessResp"},"SsoConfigIn":{"properties":{"display_name":{"type":"string","maxLength":255,"minLength":1,"title":"Display Name"},"idp_metadata_xml":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idp Metadata Xml"},"idp_entity_id":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Idp Entity Id"},"idp_sso_url":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Idp Sso Url"},"idp_slo_url":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Idp Slo Url"},"idp_x509_cert":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idp X509 Cert"},"email_domains":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Email Domains"},"attribute_map":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attribute Map"},"group_role_map":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Group Role Map"},"status":{"type":"string","pattern":"^(draft|active|disabled)$","title":"Status","default":"draft"}},"type":"object","required":["display_name"],"title":"SsoConfigIn"},"SsoConfigOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"display_name":{"type":"string","title":"Display Name"},"idp_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idp Entity Id"},"idp_sso_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idp Sso Url"},"idp_slo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idp Slo Url"},"idp_x509_cert_present":{"type":"boolean","title":"Idp X509 Cert Present"},"idp_metadata_xml_present":{"type":"boolean","title":"Idp Metadata Xml Present"},"email_domains":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Domains"},"attribute_map":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attribute Map"},"group_role_map":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Group Role Map"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","display_name","idp_entity_id","idp_sso_url","idp_slo_url","idp_x509_cert_present","idp_metadata_xml_present","email_domains","attribute_map","group_role_map","status","created_at","updated_at"],"title":"SsoConfigOut"},"StandardSourceOut":{"properties":{"id":{"type":"string","title":"Id"},"publisher":{"type":"string","title":"Publisher"},"title":{"type":"string","title":"Title"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"chunk_count":{"type":"integer","title":"Chunk Count"},"kb_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Version"},"ingest_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingest Mode"}},"type":"object","required":["id","publisher","title","chunk_count"],"title":"StandardSourceOut"},"StandardsSourcesResp":{"properties":{"publishers":{"items":{"type":"string"},"type":"array","title":"Publishers"},"jurisdictions":{"items":{"type":"string"},"type":"array","title":"Jurisdictions"},"sources":{"items":{"$ref":"#/components/schemas/StandardSourceOut"},"type":"array","title":"Sources"},"kb_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Version"}},"type":"object","required":["publishers","jurisdictions","sources"],"title":"StandardsSourcesResp"},"SubscriptionCreateReq":{"properties":{"term_months":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Term Months"},"amount":{"type":"number","exclusiveMinimum":0.0,"title":"Amount"},"currency":{"type":"string","maxLength":8,"title":"Currency","default":"INR"},"invoice_number":{"type":"string","maxLength":64,"minLength":1,"title":"Invoice Number"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["term_months","amount","invoice_number"],"title":"SubscriptionCreateReq"},"SubscriptionOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"provider":{"type":"string","title":"Provider"},"provider_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Customer Id"},"provider_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Subscription Id"},"plan_code":{"type":"string","title":"Plan Code"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"status":{"type":"string","title":"Status"},"cancel_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel At"},"po_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Reference"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","tenant_id","provider","plan_code","status","created_at"],"title":"SubscriptionOut"},"SubsidiaryCreateReq":{"properties":{"subsidiary_code":{"type":"string","title":"Subsidiary Code"},"subsidiary_name":{"type":"string","title":"Subsidiary Name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"subsidiary_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Engagement Id"},"nci_percent":{"type":"number","title":"Nci Percent","default":0.0},"acquisition_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Acquisition Date"},"disposal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Disposal Date"},"nature":{"type":"string","title":"Nature","default":"subsidiary"},"functional_currency":{"type":"string","title":"Functional Currency","default":"INR"},"tier_treatment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier Treatment"},"cost_of_investment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Of Investment"},"fv_net_assets_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fv Net Assets At Acquisition"},"nci_measurement_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nci Measurement Basis"},"nci_fair_value_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nci Fair Value At Acquisition"},"income_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Income Tax Rate"}},"type":"object","required":["subsidiary_code","subsidiary_name"],"title":"SubsidiaryCreateReq"},"SubsidiaryOut":{"properties":{"id":{"type":"string","title":"Id"},"subsidiary_code":{"type":"string","title":"Subsidiary Code"},"subsidiary_name":{"type":"string","title":"Subsidiary Name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"subsidiary_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Engagement Id"},"nci_percent":{"type":"number","title":"Nci Percent"},"acquisition_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Acquisition Date"},"disposal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Disposal Date"},"nature":{"type":"string","title":"Nature"},"functional_currency":{"type":"string","title":"Functional Currency"},"tier_treatment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier Treatment"},"effective_ownership_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Ownership Percent"},"effective_nci_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Nci Percent"},"tier_depth":{"type":"integer","title":"Tier Depth","default":0},"cost_of_investment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Of Investment"},"fv_net_assets_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fv Net Assets At Acquisition"},"nci_measurement_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nci Measurement Basis"},"nci_fair_value_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nci Fair Value At Acquisition"},"acquisition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Acquisition"},"income_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Income Tax Rate"},"children":{"items":{"$ref":"#/components/schemas/SubsidiaryOut"},"type":"array","title":"Children","default":[]}},"type":"object","required":["id","subsidiary_code","subsidiary_name","nci_percent","nature","functional_currency"],"title":"SubsidiaryOut"},"SubsidiaryUpdateReq":{"properties":{"subsidiary_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Code"},"subsidiary_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"subsidiary_engagement_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Engagement Id"},"nci_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nci Percent"},"acquisition_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Acquisition Date"},"disposal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Disposal Date"},"nature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nature"},"functional_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Functional Currency"},"tier_treatment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier Treatment"},"cost_of_investment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Of Investment"},"fv_net_assets_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fv Net Assets At Acquisition"},"nci_measurement_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nci Measurement Basis"},"nci_fair_value_at_acquisition":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nci Fair Value At Acquisition"},"income_tax_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Income Tax Rate"}},"type":"object","title":"SubsidiaryUpdateReq"},"TCMemberOut":{"properties":{"id":{"type":"string","title":"Id"},"full_name":{"type":"string","title":"Full Name"},"email":{"type":"string","title":"Email"},"affiliation":{"type":"string","title":"Affiliation"},"expertise":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expertise"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","full_name","email","affiliation","is_active"],"title":"TCMemberOut"},"TenantAuditSettingsOut":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"country":{"type":"string","title":"Country"},"override_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Override Days"},"country_default_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Country Default Days"},"platform_default_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Platform Default Days"},"effective_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Effective Days"},"effective_source":{"type":"string","title":"Effective Source"}},"type":"object","required":["tenant_id","country","effective_source"],"title":"TenantAuditSettingsOut"},"TenantAuditSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"TenantAuditSettingsReq"},"TenantBillingOut":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"plan_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Status"},"trial_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial Until"},"active_subscription":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionOut"},{"type":"null"}]},"recent_events":{"items":{"$ref":"#/components/schemas/BillingEventOut"},"type":"array","title":"Recent Events"}},"type":"object","required":["tenant_id","recent_events"],"title":"TenantBillingOut"},"TenantCreateReq":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"industry":{"type":"string","title":"Industry","default":"Other"},"country":{"type":"string","title":"Country","default":"IN"},"tenant_mode":{"anyOf":[{"type":"string","enum":["advisory","corporate"]},{"type":"null"}],"title":"Tenant Mode"},"entitlements":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entitlements"}},"type":"object","required":["name"],"title":"TenantCreateReq"},"TenantExportSettingsOut":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"country":{"type":"string","title":"Country"},"override_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Override Days"},"country_default_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Country Default Days"},"platform_default_days":{"type":"integer","title":"Platform Default Days"},"effective_days":{"type":"integer","title":"Effective Days"},"effective_source":{"type":"string","title":"Effective Source"}},"type":"object","required":["tenant_id","country","platform_default_days","effective_days","effective_source"],"title":"TenantExportSettingsOut"},"TenantExportSettingsReq":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","title":"TenantExportSettingsReq"},"TenantFsliOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"fsli_code":{"type":"string","title":"Fsli Code"},"fsli_name":{"type":"string","title":"Fsli Name"},"statement":{"type":"string","title":"Statement"},"section":{"type":"string","title":"Section"},"position_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position After"},"normal_balance":{"type":"string","title":"Normal Balance"},"framework":{"type":"string","title":"Framework"},"division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Division"},"mapping_value":{"type":"string","title":"Mapping Value"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","tenant_id","fsli_code","fsli_name","statement","section","position_after","normal_balance","framework","division","mapping_value","created_by","created_at"],"title":"TenantFsliOut"},"TenantFsliReq":{"properties":{"fsli_name":{"type":"string","title":"Fsli Name"},"statement":{"type":"string","title":"Statement"},"section":{"type":"string","title":"Section"},"position_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position After"},"normal_balance":{"type":"string","title":"Normal Balance"},"framework":{"type":"string","title":"Framework"},"division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Division"}},"type":"object","required":["fsli_name","statement","section","normal_balance","framework"],"title":"TenantFsliReq"},"TenantLLMConfigOut":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"has_api_key":{"type":"boolean","title":"Has Api Key","default":false},"has_config":{"type":"boolean","title":"Has Config","default":false},"config_preview":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Preview"}},"type":"object","title":"TenantLLMConfigOut"},"TenantLLMConfigReq":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","title":"TenantLLMConfigReq"},"TenantLLMCredentialsReq":{"properties":{"api_key":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Api Key"},"bedrock_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bedrock Config"}},"type":"object","title":"TenantLLMCredentialsReq"},"TenantMemberOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"role":{"type":"string","title":"Role"},"is_admin":{"type":"boolean","title":"Is Admin"},"joined_at":{"type":"string","format":"date-time","title":"Joined At"},"is_self":{"type":"boolean","title":"Is Self"}},"type":"object","required":["user_id","email","full_name","role","is_admin","joined_at","is_self"],"title":"TenantMemberOut"},"TenantNliOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"nli_code":{"type":"string","title":"Nli Code"},"nli_name":{"type":"string","title":"Nli Name"},"parent_fsli_code":{"type":"string","title":"Parent Fsli Code"},"parent_fsli_name":{"type":"string","title":"Parent Fsli Name"},"element":{"type":"string","title":"Element"},"statement":{"type":"string","title":"Statement"},"section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section"},"note_grouping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note Grouping"},"framework":{"type":"string","title":"Framework"},"division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Division"},"industries":{"items":{"type":"string"},"type":"array","title":"Industries"},"normal_balance":{"type":"string","title":"Normal Balance"},"guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidance"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","title":"Created At"},"promoted_to_global_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promoted To Global At"}},"type":"object","required":["id","tenant_id","nli_code","nli_name","parent_fsli_code","parent_fsli_name","element","statement","section","note_grouping","framework","division","industries","normal_balance","guidance","created_by","created_at","promoted_to_global_at"],"title":"TenantNliOut"},"TenantNliReq":{"properties":{"nli_name":{"type":"string","title":"Nli Name"},"parent_fsli_code":{"type":"string","title":"Parent Fsli Code"},"parent_fsli_name":{"type":"string","title":"Parent Fsli Name"},"element":{"type":"string","title":"Element"},"statement":{"type":"string","title":"Statement"},"section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section"},"note_grouping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note Grouping"},"framework":{"type":"string","title":"Framework"},"division":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Division"},"industries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Industries"},"normal_balance":{"type":"string","title":"Normal Balance"},"guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidance"}},"type":"object","required":["nli_name","parent_fsli_code","parent_fsli_name","element","statement","framework","normal_balance"],"title":"TenantNliReq"},"TenantOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"industry":{"type":"string","title":"Industry"},"country":{"type":"string","title":"Country"},"role":{"type":"string","title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"engagement_count":{"type":"integer","title":"Engagement Count"},"data_processing_consent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data Processing Consent At"},"data_processing_consent_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Processing Consent By"},"consent_memo_drafting_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Consent Memo Drafting At"},"consent_mba_testing_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Consent Mba Testing At"},"consent_evidence_augmentation_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Consent Evidence Augmentation At"},"tenant_mode":{"type":"string","title":"Tenant Mode","default":"advisory"},"entitlements":{"items":{"type":"string"},"type":"array","title":"Entitlements"},"retention_years":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Years"},"retention_years_effective":{"type":"integer","title":"Retention Years Effective","default":7},"retention_years_floor":{"type":"integer","title":"Retention Years Floor","default":7},"retention_years_ceiling":{"type":"integer","title":"Retention Years Ceiling","default":30}},"type":"object","required":["id","name","industry","country","role","created_at","engagement_count"],"title":"TenantOut"},"TenantUpdateReq":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"industry":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Industry"},"country":{"anyOf":[{"type":"string","maxLength":8,"minLength":2},{"type":"null"}],"title":"Country"},"retention_years":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Years"}},"type":"object","title":"TenantUpdateReq","description":"7 Jun 2026 — review v2 #1 follow-up.  Workspace rename + light\nmetadata edit on the Org Settings page.  Every field is optional;\nonly those supplied are written.  Owner or OrgAdmin only\n(enforced via `tenant.update` capability)."},"TrainReq":{"properties":{"learner_name":{"type":"string","title":"Learner Name"},"user_id":{"type":"string","title":"User Id"},"tier":{"type":"string","title":"Tier","default":"Practitioner"}},"type":"object","required":["learner_name","user_id"],"title":"TrainReq"},"TransitionBridgeResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"period_used":{"type":"string","title":"Period Used"},"framework_new":{"type":"string","title":"Framework New"},"archetype_new":{"type":"string","title":"Archetype New"},"rows":{"items":{"$ref":"#/components/schemas/TransitionBridgeRowOut"},"type":"array","title":"Rows"},"by_old_bucket":{"additionalProperties":{"type":"number"},"type":"object","title":"By Old Bucket"},"by_new_bucket":{"additionalProperties":{"type":"number"},"type":"object","title":"By New Bucket"},"notable_reclassifications":{"items":{"type":"string"},"type":"array","title":"Notable Reclassifications"},"unknown_count":{"type":"integer","title":"Unknown Count"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["engagement_id","period_used","framework_new","archetype_new","rows","by_old_bucket","by_new_bucket","notable_reclassifications","unknown_count","summary"],"title":"TransitionBridgeResp"},"TransitionBridgeRowOut":{"properties":{"account_name":{"type":"string","title":"Account Name"},"amount":{"type":"number","title":"Amount"},"old_bucket":{"type":"string","title":"Old Bucket"},"new_bucket":{"type":"string","title":"New Bucket"},"new_face_line":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Face Line"},"reclassified":{"type":"boolean","title":"Reclassified"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["account_name","amount","old_bucket","new_bucket","new_face_line","reclassified","rationale"],"title":"TransitionBridgeRowOut"},"TranslationRateOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"subsidiary_id":{"type":"string","title":"Subsidiary Id"},"subsidiary_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subsidiary Name"},"currency_from":{"type":"string","title":"Currency From"},"currency_to":{"type":"string","title":"Currency To"},"period_label":{"type":"string","title":"Period Label"},"rate_kind":{"type":"string","title":"Rate Kind"},"rate":{"type":"number","title":"Rate"},"rate_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Rate Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","engagement_id","subsidiary_id","currency_from","currency_to","period_label","rate_kind","rate","created_at"],"title":"TranslationRateOut"},"TranslationRatePatchReq":{"properties":{"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate"},"rate_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Rate Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"TranslationRatePatchReq"},"TranslationRateUpsertReq":{"properties":{"subsidiary_id":{"type":"string","title":"Subsidiary Id"},"currency_from":{"type":"string","title":"Currency From"},"currency_to":{"type":"string","title":"Currency To","default":"INR"},"period_label":{"type":"string","title":"Period Label","default":"current"},"rate_kind":{"type":"string","title":"Rate Kind"},"rate":{"type":"number","title":"Rate"},"rate_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Rate Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["subsidiary_id","currency_from","rate_kind","rate"],"title":"TranslationRateUpsertReq"},"UploadActivityOut":{"properties":{"id":{"type":"string","title":"Id"},"action":{"type":"string","title":"Action"},"created_at":{"title":"Created At"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"}},"type":"object","required":["id","action","created_at"],"title":"UploadActivityOut"},"UploadOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"filename":{"type":"string","title":"Filename"},"size_bytes":{"type":"integer","title":"Size Bytes"},"sha256":{"type":"string","title":"Sha256"},"uploaded_at":{"type":"string","format":"date-time","title":"Uploaded At"},"extracted":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted"},"period_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"},"tb_imbalance_warning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tb Imbalance Warning"},"tb_scale_warning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tb Scale Warning"},"tb_duplicate_ledger_warning":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tb Duplicate Ledger Warning"}},"type":"object","required":["id","kind","filename","size_bytes","sha256","uploaded_at"],"title":"UploadOut"},"ValidationCheck":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"group":{"type":"string","title":"Group"}},"type":"object","required":["key","label","status","detail","group"],"title":"ValidationCheck"},"ValidationDashboardResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"overall":{"type":"string","title":"Overall"},"pass_count":{"type":"integer","title":"Pass Count"},"warn_count":{"type":"integer","title":"Warn Count"},"fail_count":{"type":"integer","title":"Fail Count"},"na_count":{"type":"integer","title":"Na Count"},"checks":{"items":{"$ref":"#/components/schemas/ValidationCheck"},"type":"array","title":"Checks"},"last_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run Id"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At"}},"type":"object","required":["engagement_id","overall","pass_count","warn_count","fail_count","na_count","checks"],"title":"ValidationDashboardResp"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ZohoConnectionOut":{"properties":{"id":{"type":"string","title":"Id"},"engagement_id":{"type":"string","title":"Engagement Id"},"provider":{"type":"string","title":"Provider"},"organisation_id":{"type":"string","title":"Organisation Id"},"region":{"type":"string","title":"Region"},"has_token":{"type":"boolean","title":"Has Token"},"last_sync_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync At"},"last_sync_rows":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Sync Rows"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["id","engagement_id","provider","organisation_id","region","has_token"],"title":"ZohoConnectionOut"},"ZohoConnectionReq":{"properties":{"organisation_id":{"type":"string","maxLength":64,"minLength":1,"title":"Organisation Id"},"auth_token":{"type":"string","maxLength":2048,"minLength":10,"title":"Auth Token"},"region":{"type":"string","maxLength":8,"title":"Region","default":"in"}},"type":"object","required":["organisation_id","auth_token"],"title":"ZohoConnectionReq"},"ZohoPullReq":{"properties":{"from_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Date"},"to_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Date"},"period_label":{"type":"string","maxLength":32,"title":"Period Label","default":"current"}},"type":"object","title":"ZohoPullReq"},"_ApplyVariantReq":{"properties":{"variant_id":{"type":"string","title":"Variant Id"}},"type":"object","required":["variant_id"],"title":"_ApplyVariantReq"},"_AskReq":{"properties":{"entry_key":{"type":"string","maxLength":160,"minLength":1,"title":"Entry Key"}},"type":"object","required":["entry_key"],"title":"_AskReq"},"_BatchEntry":{"properties":{"entry_key":{"type":"string","maxLength":160,"minLength":1,"title":"Entry Key"},"title":{"type":"string","maxLength":400,"title":"Title","default":""}},"type":"object","required":["entry_key"],"title":"_BatchEntry"},"_ClientUpsertReq":{"properties":{"legal_name":{"type":"string","title":"Legal Name"},"brand_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Name"},"cin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cin"},"pan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pan"},"gstin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gstin"},"lei":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lei"},"incorporation_country":{"type":"string","title":"Incorporation Country","default":"IN"},"registered_office":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registered Office"},"nic_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nic Code"},"industry":{"type":"string","title":"Industry"},"sub_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Industry"},"is_listed":{"type":"boolean","title":"Is Listed","default":false},"stock_exchanges":{"items":{"type":"string"},"type":"array","title":"Stock Exchanges","default":[]},"parent_entity_legal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Entity Legal Name"},"ultimate_parent_legal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ultimate Parent Legal Name"},"group_or_standalone":{"type":"string","title":"Group Or Standalone","default":"standalone"},"is_subsidiary":{"type":"boolean","title":"Is Subsidiary","default":false},"it_landscape":{"items":{"type":"string"},"type":"array","title":"It Landscape","default":[]},"pep_status":{"type":"string","title":"Pep Status","default":"Unknown"},"conflict_check_completed":{"type":"boolean","title":"Conflict Check Completed","default":false},"conflict_check_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conflict Check Notes"},"beneficial_owners":{"items":{"type":"string"},"type":"array","title":"Beneficial Owners","default":[]},"last_audited_revenue_inr_cr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Audited Revenue Inr Cr"},"last_audited_revenue_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Audited Revenue Currency"},"last_audited_revenue_scale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Audited Revenue Scale"},"last_audited_pat_inr_cr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Audited Pat Inr Cr"},"last_audited_equity_inr_cr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Audited Equity Inr Cr"},"last_audited_period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Audited Period End"},"auditor_of_record":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auditor Of Record"},"acceptance_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acceptance Notes"}},"type":"object","required":["legal_name","industry"],"title":"_ClientUpsertReq","description":"Request body for create / update.  Mirrors ClientMaster but\npares it down to the fields a tenant admin actually fills."},"_CreateVariantReq":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"note_key":{"type":"string","maxLength":64,"minLength":1,"title":"Note Key"},"framework":{"type":"string","title":"Framework"},"industry":{"type":"string","title":"Industry","default":"general"},"variant_name":{"type":"string","maxLength":200,"minLength":1,"title":"Variant Name"},"variant_slug":{"type":"string","maxLength":64,"minLength":1,"title":"Variant Slug"},"body_markdown":{"type":"string","maxLength":20000,"minLength":1,"title":"Body Markdown"}},"type":"object","required":["tenant_id","note_key","framework","variant_name","variant_slug","body_markdown"],"title":"_CreateVariantReq"},"_CustomNotePatch":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"after_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Key"},"content_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Kind"}},"type":"object","title":"_CustomNotePatch"},"_CustomNoteReq":{"properties":{"title":{"type":"string","title":"Title"},"after_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Key"},"content_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Kind","default":"narrative"}},"type":"object","required":["title"],"title":"_CustomNoteReq"},"_DisclosureFormPrefillResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"sheet_code":{"type":"string","title":"Sheet Code"},"period_label":{"type":"string","title":"Period Label"},"engine":{"type":"string","title":"Engine"},"form":{"additionalProperties":true,"type":"object","title":"Form"}},"type":"object","required":["engagement_id","sheet_code","period_label","engine","form"],"title":"_DisclosureFormPrefillResp"},"_DisclosureFormPutResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"sheet_code":{"type":"string","title":"Sheet Code"},"period_label":{"type":"string","title":"Period Label"},"saved_at":{"type":"string","title":"Saved At"},"row_count":{"type":"integer","title":"Row Count"}},"type":"object","required":["engagement_id","sheet_code","period_label","saved_at","row_count"],"title":"_DisclosureFormPutResp"},"_EQCRBody":{"properties":{"eqcr_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eqcr Notes"}},"type":"object","title":"_EQCRBody"},"_KYCActionBody":{"properties":{"action":{"type":"string","title":"Action"},"sanctions_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sanctions Status"},"refresh_due_in_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Refresh Due In Months","default":12},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["action"],"title":"_KYCActionBody"},"_LifecycleTransitionBody":{"properties":{"target":{"type":"string","title":"Target"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["target"],"title":"_LifecycleTransitionBody"},"_MatrixBatchReq":{"properties":{"note_keys":{"items":{"type":"string"},"type":"array","title":"Note Keys","default":[]}},"type":"object","title":"_MatrixBatchReq"},"_MatrixSeedReq":{"properties":{"template":{"type":"string","title":"Template","default":"matrix"}},"type":"object","title":"_MatrixSeedReq"},"_MemoDeleteReq":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"_MemoDeleteReq"},"_NarrativePutReq":{"properties":{"body":{"type":"string","title":"Body"}},"type":"object","required":["body"],"title":"_NarrativePutReq"},"_NarrativeSourceReq":{"properties":{"use_ar":{"type":"boolean","title":"Use Ar"}},"type":"object","required":["use_ar"],"title":"_NarrativeSourceReq"},"_NoteDecisionReq":{"properties":{"item_key":{"type":"string","title":"Item Key"},"decision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"placement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placement"}},"type":"object","required":["item_key"],"title":"_NoteDecisionReq"},"_NoteLinkReq":{"properties":{"statement":{"type":"string","title":"Statement"},"section":{"type":"string","title":"Section","default":""},"line":{"type":"string","title":"Line"},"target_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Key"}},"type":"object","required":["statement","line"],"title":"_NoteLinkReq"},"_NoteSettingsPutReq":{"properties":{"settings":{"additionalProperties":{"type":"string"},"type":"object","title":"Settings"}},"type":"object","required":["settings"],"title":"_NoteSettingsPutReq"},"_NoteSettingsResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"framework":{"type":"string","title":"Framework"},"settings":{"additionalProperties":{"type":"string"},"type":"object","title":"Settings"},"defaults":{"additionalProperties":{"type":"string"},"type":"object","title":"Defaults"},"saved":{"type":"boolean","title":"Saved"},"locked":{"type":"boolean","title":"Locked"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["engagement_id","framework","settings","defaults","saved","locked"],"title":"_NoteSettingsResp"},"_NoteTextReq":{"properties":{"item_key":{"type":"string","title":"Item Key"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"}},"type":"object","required":["item_key"],"title":"_NoteTextReq"},"_NotesStructurePutReq":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/_NotesStructureRowIn"},"type":"array","title":"Rows"},"template_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Key"}},"type":"object","required":["rows"],"title":"_NotesStructurePutReq"},"_NotesStructureResp":{"properties":{"engagement_id":{"type":"string","title":"Engagement Id"},"rows":{"items":{"$ref":"#/components/schemas/_NotesStructureRow"},"type":"array","title":"Rows"},"is_seeded":{"type":"boolean","title":"Is Seeded"}},"type":"object","required":["engagement_id","rows","is_seeded"],"title":"_NotesStructureResp"},"_NotesStructureRow":{"properties":{"ordinal":{"type":"integer","title":"Ordinal"},"row_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Row Id"},"note_num":{"type":"string","title":"Note Num"},"parent_ordinal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Ordinal"},"title":{"type":"string","title":"Title"},"kind":{"type":"string","title":"Kind"},"face_lines":{"items":{"type":"string"},"type":"array","title":"Face Lines"},"policy_inline":{"type":"boolean","title":"Policy Inline"},"memo_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo Key"},"workpaper":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper"},"standard_refs":{"items":{"type":"string"},"type":"array","title":"Standard Refs"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"},"template_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Key"}},"type":"object","required":["ordinal","note_num","title","kind","face_lines","policy_inline","standard_refs"],"title":"_NotesStructureRow"},"_NotesStructureRowIn":{"properties":{"ordinal":{"type":"integer","title":"Ordinal"},"row_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Row Id"},"note_num":{"type":"string","title":"Note Num"},"parent_ordinal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Ordinal"},"title":{"type":"string","title":"Title"},"kind":{"type":"string","title":"Kind"},"face_lines":{"items":{"type":"string"},"type":"array","title":"Face Lines","default":[]},"policy_inline":{"type":"boolean","title":"Policy Inline","default":false},"memo_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo Key"},"workpaper":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper"},"standard_refs":{"items":{"type":"string"},"type":"array","title":"Standard Refs","default":[]},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"}},"type":"object","required":["ordinal","note_num","title","kind"],"title":"_NotesStructureRowIn","description":"Input row for PUT — same shape as the response row minus\ntemplate_key (server-managed) and with sensible defaults for\noptional fields."},"_PreviewReq":{"properties":{"document":{"additionalProperties":true,"type":"object","title":"Document"}},"type":"object","required":["document"],"title":"_PreviewReq"},"_PrintFormatPutReq":{"properties":{"format":{"additionalProperties":true,"type":"object","title":"Format"}},"type":"object","required":["format"],"title":"_PrintFormatPutReq"},"_ProposeReq":{"properties":{"document":{"additionalProperties":true,"type":"object","title":"Document"}},"type":"object","required":["document"],"title":"_ProposeReq"},"_ReopenBody":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"_ReopenBody"},"_ResolveBody":{"properties":{"resolution_action":{"type":"string","title":"Resolution Action"},"resolution_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Reason"}},"type":"object","required":["resolution_action"],"title":"_ResolveBody"},"_SaveReq":{"properties":{"entry_key":{"type":"string","maxLength":160,"minLength":1,"title":"Entry Key"},"title":{"type":"string","maxLength":400,"title":"Title","default":""},"blocks":{"items":{"anyOf":[{"$ref":"#/components/schemas/_Table"},{"$ref":"#/components/schemas/_Text"}]},"type":"array","maxItems":200,"title":"Blocks"}},"type":"object","required":["entry_key"],"title":"_SaveReq"},"_Table":{"properties":{"kind":{"type":"string","const":"table","title":"Kind"},"title":{"type":"string","maxLength":400,"title":"Title","default":""},"columns":{"type":"string","maxLength":2000,"title":"Columns","default":""},"headers":{"items":{"type":"string"},"type":"array","maxItems":40,"title":"Headers"},"rows":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","maxItems":500,"title":"Rows"}},"type":"object","required":["kind"],"title":"_Table"},"_Text":{"properties":{"kind":{"type":"string","const":"text","title":"Kind"},"paras":{"items":{"type":"string"},"type":"array","maxItems":200,"title":"Paras"}},"type":"object","required":["kind"],"title":"_Text"},"api__routers__fs_preview_changes___ChangeCreateReq":{"properties":{"note_key":{"type":"string","maxLength":64,"minLength":1,"title":"Note Key"},"para_id":{"type":"string","maxLength":128,"minLength":1,"title":"Para Id"},"before_text":{"type":"string","maxLength":100000,"minLength":0,"title":"Before Text"},"after_text":{"type":"string","maxLength":100000,"minLength":0,"title":"After Text"}},"type":"object","required":["note_key","para_id","before_text","after_text"],"title":"_ChangeCreateReq","description":"Payload for POST — create a pending change."},"api__routers__fs_preview_changes___ChangeReviewReq":{"properties":{"review_note":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Review Note"}},"type":"object","title":"_ChangeReviewReq","description":"Payload for accept / reject — optional review note."},"api__routers__note_ar_content___BatchReq":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/_BatchEntry"},"type":"array","maxItems":400,"title":"Entries"}},"type":"object","title":"_BatchReq"},"api__routers__note_blocks___BatchReq":{"properties":{"keys":{"items":{"type":"string"},"type":"array","maxItems":400,"title":"Keys"}},"type":"object","title":"_BatchReq"},"api__routers__note_blocks___ReviewReq":{"properties":{"review_note":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Review Note"}},"type":"object","title":"_ReviewReq"},"api__routers__note_deletions___ReviewReq":{"properties":{"review_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Review Note"}},"type":"object","title":"_ReviewReq"},"api__routers__notes_narrative_changes___ChangeCreateReq":{"properties":{"note_key":{"type":"string","maxLength":64,"minLength":1,"title":"Note Key"},"after_text":{"type":"string","maxLength":20000,"minLength":0,"title":"After Text"}},"type":"object","required":["note_key","after_text"],"title":"_ChangeCreateReq"},"api__routers__notes_narrative_changes___ChangeReviewReq":{"properties":{"review_note":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Review Note"}},"type":"object","title":"_ChangeReviewReq"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/login"}}}}}}