{"openapi":"3.1.0","info":{"title":"Zato 2.0 Backend","description":"The Zato 2.0 orchestrator API — the sole HTTP edge for the browser (`/api/v1/...`)\nand for partner integrations (`/api/v1/partner`, API-key authed).\n\n**Auth** — browser routes authenticate via httpOnly access-token cookies set by\n`/auth` (send requests with credentials). Partner routes use `Authorization`\nAPI keys with per-key scopes. Most routes are additionally RBAC-gated per\npermission (`module.action`); object-level access is enforced on top.\n\n**Authenticating in this Swagger UI (\"Try it out\")** — there is no *Authorize*\nbutton because auth is a **httpOnly cookie**, not a Bearer header (the browser\ncan't read or set httpOnly cookies from JS). Instead, this docs page is served\nfrom the **same origin** as the API, so once the `access_token` cookie exists the\nbrowser attaches it to every *Try it out* request automatically. To get the\ncookie, run the two-step login right here in Swagger — both endpoints are public:\n\n1. **`POST /api/v1/auth/login`** with your credentials → sets a short-lived\n   `pre_session` cookie and (in dev) triggers the OTP.\n2. **`POST /api/v1/auth/verify-otp`** with `{\"code\": \"<otp>\"}` → sets the\n   `access_token` cookie.\n3. Every other endpoint's *Try it out* now works — the cookie rides along.\n\nAlternatively, log in through the app (`http://localhost:5273`) in the **same\nbrowser**, then open `/docs`: cookies are host-scoped (`localhost`), so the\ncookie set on `:5273` is also sent to the API on `:8002`.\n\n*Local dev:* the seeded admin is `admin@zatohq.com` / `ZatoTest@2026` and the OTP\nis a fixed dev code. If a request 401s even after login, the cookie was dropped —\nover plain `http://` you need `INSECURE_COOKIES=true` in the local env, otherwise\nthe `Secure` cookie is silently discarded.\n\n**Response envelope** — every successful response is\n`{\"data\": ..., \"meta\": {...}, \"errors\": []}`; `meta` may carry `message`\n(user-facing success line) and always echoes `request_id`. Errors return\n`{\"data\": null, \"meta\": {...}, \"errors\": [{code, message, detail, field,\nseverity}]}` with an appropriate HTTP status (401 unauthenticated,\n403 `PERMISSION_DENIED` / `OBJECT_FORBIDDEN`, 422 validation).\n\n**Async work** — long-running operations return `202 {run_id}` and stream\nprogress over the single WebSocket at `/api/v1/ws`.\n","version":"0.1.0"},"paths":{"/api/v1/auth/login":{"post":{"tags":["auth"],"summary":"Begin login and pick identity provider","description":"Step 1: ask which IdP to use (or signal that password is needed).","operationId":"login_begin_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginBeginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LoginBeginResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/login/password":{"post":{"tags":["auth"],"summary":"Log in with email and password","description":"Manual (email + password) flow — validated against the app DB only.\n\nReturns mode=otp_staged: sets the pre_session cookie, frontend goes to the\nOTP page. Manual auth never touches Cognito (that's the SSO buttons only).","operationId":"login_password_api_v1_auth_login_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LoginOtpStagedResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/set-new-password":{"post":{"tags":["auth"],"summary":"Complete forced new-password challenge","description":"Complete the Cognito NEW_PASSWORD_REQUIRED challenge.\n\nUsed by first-time CS Admin (bootstrap-emailed temp password) and by any\nuser Cognito has flagged for forced password reset.","operationId":"set_new_password_api_v1_auth_set_new_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetNewPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LoginOtpStagedResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/callback":{"get":{"tags":["auth"],"summary":"Handle federated IdP OAuth callback","description":"OAuth2 redirect target for federated IdPs (Google/Microsoft/Apple/...).\n\nFederated users have already completed strong auth at the IdP, so we skip\nthe OTP step and open the session directly. Cookies are set on the redirect\nresponse and the browser lands on the frontend's PersonaDispatcher, which\nroutes them to their portal-specific landing route.\n\nResilience: any failure here (Cognito JWKS unreachable, IdP token exchange\nfailed, user not provisioned, firm disabled) is redirected back to the\nlogin page with an `?sso_error=...` query so the user sees a friendly\nmessage instead of a bare \"Internal Server Error\" page from the proxy.","operationId":"callback_api_v1_auth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"Required. The OAuth2 authorization code returned by the federated IdP on redirect; exchanged for Cognito tokens.","examples":["4/0Adeu5BXexampleAuthCode"],"title":"Code"},"description":"Required. The OAuth2 authorization code returned by the federated IdP on redirect; exchanged for Cognito tokens."},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. Opaque state/CSRF value echoed back by the IdP; not required by the handler.","title":"State"},"description":"Optional. Opaque state/CSRF value echoed back by the IdP; not required by the handler."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-otp":{"post":{"tags":["auth"],"summary":"Verify OTP and open session","description":"Step 2: exchange OTP + pre_session cookie for the full session.","operationId":"verify_otp_api_v1_auth_verify_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__auth__schemas__VerifyOtpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SessionResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh session with rotated tokens","description":"Silent renewal: validates the refresh cookie, mints a new access + refresh\npair (the old refresh token is revoked), re-sets both httpOnly cookies, and\nreturns the re-hydrated persona / permissions / landing-route context.","operationId":"refresh_api_v1_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RefreshSessionResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/extend":{"post":{"tags":["auth"],"summary":"Extend session after idle warning","description":"User clicked 'Continue session' on the 15-min idle warning popup.","operationId":"extend_api_v1_auth_extend_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/switch-persona":{"post":{"tags":["auth"],"summary":"Switch to another persona or firm","description":"Switch the session into another portal/firm this account is eligible for\n(its primary or a user_portal_memberships row). `firm_uuid` picks a specific\nfirm when one persona spans several (e.g. a practice user in two firms).\nRe-mints the access cookie; eligibility is enforced in the service (403).","operationId":"switch_persona_api_v1_auth_switch_persona_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchPersonaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SwitchPersonaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Log out and clear session cookies","description":"Revoke the current access token's jti (idempotent — a bad/expired token\nis ignored) and clear the httpOnly auth cookies. Requires a valid session.","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Send password reset code","description":"Triggers a Cognito-emailed reset code to the user (no-op in local dev).","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["auth"],"summary":"Confirm password reset with code","description":"Complete the forgot-password flow: confirm the emailed Cognito code, set\nthe new password, and clear any login lockout for that email. Public.","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/accept-invite":{"post":{"tags":["auth"],"summary":"Redeem an invitation token","description":"Redeem an invitation token. Public — no session cookie required.\n\nNative users: must supply `new_password`; we promote their temp Cognito\npassword and stage the OTP step (sets pre_session cookie).\nFederated users: we mark the invitation accepted and return a redirect to\n/auth/login so the user can click their IdP.","operationId":"accept_invite_api_v1_auth_accept_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AcceptInviteResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Get current session and user context","description":"Return the authenticated user's session context — identity, firm, persona,\npermissions, avatar, setup_complete, and session-lifetime settings. Requires\na valid access cookie (get_user_context).","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/config":{"get":{"tags":["config"],"summary":"Get the public bootstrap config","description":"Return the deployment's active locale + the portal country profile slice.\n\nThe `country` block (currency, formatting, identifier labels/regexes, tax,\nfeature flags) lets the frontend drive country-specific UI from config instead\nof hardcoded `isAU`/`isNZ` branches. Non-fatal if the profile fails to load —\nthe locale still ships so the login page renders.","operationId":"get_bootstrap_config_api_v1_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BootstrapConfig_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/health/services":{"get":{"tags":["health"],"summary":"Check all services' health","description":"Fan out to every service's /healthz and return combined status.","operationId":"services_health_api_v1_health_services_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServicesHealthResponse"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/health/services/reverse-check":{"get":{"tags":["health"],"summary":"Check services can reach the backend","description":"Ask each Lambda service to call back to the backend /healthz.\nProves the services → backend network path (Lambda outbound via NAT).","operationId":"reverse_check_api_v1_health_services_reverse_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseCheckResponse"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/health/infrastructure":{"get":{"tags":["health"],"summary":"Get AWS infrastructure health","description":"Live status of the stack's AWS infrastructure (ECS, RDS, Redis, ALB,\nLambda) via the task role's read-only describe permissions. Non-sensitive.","operationId":"infrastructure_api_v1_health_infrastructure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfrastructureHealthResponse"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/health/services/{name}":{"get":{"tags":["health"],"summary":"Check one service's health","description":"Ping a single service by name.","operationId":"service_health_by_name_api_v1_health_services__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServicePing"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/personas/me":{"get":{"tags":["personas"],"summary":"Get my active persona bundle","description":"The caller's active persona: slug, eligible personas, navigation\nmanifest, nav items, theme tokens and permissions — drives the frontend's\npersona-based nav + RBAC gating.","operationId":"me_api_v1_personas_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PersonaMeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/accounts":{"get":{"tags":["coa","coa"],"summary":"List client COA accounts","description":"All client COA accounts + mapping (+ sync meta). CLIENT-level — no job\ndependency. TB balances are fetched separately via GET .../tb-balances so the\ngrid never blocks on the (possibly live) TB fetch.","operationId":"list_client_accounts_api_v1_coa_clients__client_uuid__accounts_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"review","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional exact filter on an account's review_status; omit to return all accounts.","examples":["ok"],"title":"Review"},"description":"Optional exact filter on an account's review_status; omit to return all accounts."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientAccountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/tb-balances":{"get":{"tags":["coa","coa"],"summary":"Get account TB balances","description":"`account_uuid -> TB balance` map (stored TB, else a live Xero pull, no\npersistence). Called by the grid AFTER it renders so the balances stream in\nwithout blocking the chart load.","operationId":"client_tb_balances_api_v1_coa_clients__client_uuid__tb_balances_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbBalancesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/account-types":{"get":{"tags":["coa","coa"],"summary":"List Zato account types","description":"Zato type taxonomy for the resolve dropdown: [{account_type_id, type_name, class_name}].","operationId":"list_account_types_api_v1_coa_account_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AccountTypesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/accounts/{account_uuid}/account-type":{"put":{"tags":["coa","coa"],"summary":"Resolve an account's Zato type","description":"HITL: set an account's Zato type; ``apply_to_token`` (default on) teaches the token→type map + re-resolves siblings; clearing the last unmapped type auto-runs parent mapping.","operationId":"resolve_account_type_api_v1_coa_clients__client_uuid__accounts__account_uuid__account_type_put","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Account Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveAccountTypeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResolveAccountTypeOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/automap":{"post":{"tags":["coa","coa"],"summary":"Auto-map client chart via agent","description":"Auto-map via Bedrock agent — type-scoped chart (static JSON) + type-filtered\nprior so the agent only sees parents valid for each account's HITL type.","operationId":"automap_client_api_v1_coa_clients__client_uuid__automap_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientAutomapOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/automap-status":{"get":{"tags":["coa","coa"],"summary":"Check client automap status","description":"Is the client-level auto-map agent running right now? Polled by the CoA page\nso the in-progress loader + Upload/Delete lock survive a refresh or tab switch\n(the request's client-side pending state does not). Redis-only — no DB hit.","operationId":"get_client_automap_status_api_v1_coa_clients__client_uuid__automap_status_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AutomapStatusOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/mappings/{account_uuid}":{"put":{"tags":["coa","coa"],"summary":"Override an account's parent mapping","description":"Manual override of one account's parent — or of the whole multi-select\n(``payload.account_uuids``) in one atomic doc write.","operationId":"update_client_mapping_api_v1_coa_clients__client_uuid__mappings__account_uuid__put","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Account Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMappingIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientUpdateMappingOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/parents":{"get":{"tags":["coa","coa"],"summary":"List client's effective parents","description":"The client's effective parents (master template + any section instances) —\ndrives the mapping grid's parent dropdown, the multiparent ``+``, and the\nSection column.","operationId":"list_client_parents_api_v1_coa_clients__client_uuid__parents_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_str__ClientParentOut__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/parents/add":{"post":{"tags":["coa","coa"],"summary":"Add a numbered section instance","description":"Multi-parent ``+``: create the next numbered section instance of a base\n(e.g. ``Term Loan`` → ``Term Loan 1``) in THIS client's mapping.","operationId":"add_client_section_api_v1_coa_clients__client_uuid__parents_add_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__coa__schemas__AddSectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AddSectionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/parents/{parent_key}":{"delete":{"tags":["coa","coa"],"summary":"Remove a numbered section instance","description":"Multi-parent ``−``: tail-only delete of the highest numbered instance.","operationId":"remove_client_section_api_v1_coa_clients__client_uuid__parents__parent_key__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"parent_key","in":"path","required":true,"schema":{"type":"string","title":"Parent Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemoveSectionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/pending-mappings":{"get":{"tags":["coa","coa"],"summary":"List pending mapping reviews","description":"Per-account mapping items for the review grid.\n\nReads the single client HITL row (context.predictions) and overlays live\nis_approved state from chart_of_accounts.\n\nstatus=None (default) → pending row only.\nstatus=all → include applied/rejected historical rows.","operationId":"get_pending_mappings_api_v1_coa_clients__client_uuid__pending_mappings_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Omit (default) for the pending row only; pass 'all' to also include applied/rejected historical rows.","examples":["all"],"title":"Status"},"description":"Omit (default) for the pending row only; pass 'all' to also include applied/rejected historical rows."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PendingMappingsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/accounts/{account_uuid}/approve":{"post":{"tags":["coa","coa"],"summary":"Approve one account mapping","description":"Accept the AI suggestion for ONE account as-is (is_approved=true, parent\nunchanged). Closes the client's coa_name_mapping HITL row when it's the last\naccount left to approve.","operationId":"approve_account_mapping_api_v1_coa_clients__client_uuid__accounts__account_uuid__approve_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Account Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ApproveAccountOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/mapping-readiness":{"get":{"tags":["coa","coa"],"summary":"Check client mapping readiness","description":"COA-mapping readiness counts for the workpaper-run gate:\n{needs_type, unmapped, unapproved, blocking}.","operationId":"client_mapping_readiness_api_v1_coa_clients__client_uuid__mapping_readiness_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MappingReadinessOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/approve-all":{"post":{"tags":["coa","coa"],"summary":"Approve all client mappings","description":"Confirm every mapped account + seed the Tier-1 cache (keyed on name).","operationId":"approve_client_api_v1_coa_clients__client_uuid__approve_all_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientApproveAllOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/coa":{"post":{"tags":["coa","coa"],"summary":"Upload client chart of accounts","description":"Ingest the client's full CoA (.csv/.xlsx) into chart_of_accounts — the\nauthoritative chart (mints account_uuid); distinct from a job TB upload.","operationId":"upload_client_coa_api_v1_coa_clients__client_uuid__coa_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_client_coa_api_v1_coa_clients__client_uuid__coa_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaIngestOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/coa-file":{"delete":{"tags":["coa","coa"],"summary":"Reset manually uploaded chart","description":"Reset the client's manually uploaded CoA: clear the file marker, delete the\nmanual chart rows, and remove their mapping entries. Xero-synced charts are not\nreset by this endpoint. Because the CoA is client-level and drives every\ndownstream artefact, a successful reset also cascades the existing per-job reset\nto each of the client's jobs — wiping their workpapers + manual journals and\nrewinding GL run-state (scrutiny recomputes empty) — while keeping each job's\ntrial balance and uploaded source files intact.","operationId":"delete_client_coa_file_api_v1_coa_clients__client_uuid__coa_file_delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResetCoaFileOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["coa","coa"],"summary":"Get client chart file","description":"Return the CoA for one client (legacy jobs_bp order): 1. uploaded file on\ndisk → download URL; 2. chart rows → synthesised inline CSV; 3. neither → 404.","operationId":"get_client_coa_file_api_v1_coa_clients__client_uuid__coa_file_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaFileOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/coa/sync-xero":{"post":{"tags":["coa","coa"],"summary":"Sync client chart from Xero","description":"Pull the client's full CoA from Xero (GET /Accounts) and store it like a\nmanual upload — same ingest path, no job needed. Notifies on completion.","operationId":"sync_client_coa_from_xero_api_v1_coa_clients__client_uuid__coa_sync_xero_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaIngestOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/reset-mappings":{"post":{"tags":["coa","coa"],"summary":"Reset all client mappings","description":"Validation reset — wipe all pending + confirmed mappings for this client.\n\nClears ``parent_id`` and ``is_approved`` on every chart_of_accounts row so the\nfull pipeline (T0 → T4) runs from scratch. HITL account-type assignments are\npreserved (``account_type_id_ref`` is untouched).","operationId":"reset_client_mappings_api_v1_coa_clients__client_uuid__reset_mappings_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResetClientMappingsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/knowledge-base/seed":{"post":{"tags":["coa","coa-knowledge-base"],"summary":"Seed COA embedding knowledge base from a historical mapping CSV upload","description":"Upload a CSV and populate the vector knowledge base with embeddings.\n\nRequired columns:\n  coa_account_name          — the account name as it appears in Xero/COA\n  zato_parent_account_code  — Zato parent display name (e.g. \"Sales\", \"Bank\")\n\nOptional columns (leave blank for global/wildcard):\n  entity_type   — company | trust | partnership | sole_trader | individual\n  is_farming    — true | false  (blank = applies to both)\n\nEmbeddings are generated immediately via ai_gateway (Bedrock Titan v2).\nRows whose zato_parent_account_code doesn't match the master config are skipped.","operationId":"seed_knowledge_base_api_v1_coa_knowledge_base_seed_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_seed_knowledge_base_api_v1_coa_knowledge_base_seed_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_KbSeedOut_","additionalProperties":true,"type":"object","title":"Response Seed Knowledge Base Api V1 Coa Knowledge Base Seed Post"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/knowledge-base/stats":{"get":{"tags":["coa","coa-knowledge-base"],"summary":"Knowledge base statistics","description":"Row counts for the parent-centric KB tables (wp_parent_kb / wp_parent_kb_firm).","operationId":"knowledge_base_stats_api_v1_coa_knowledge_base_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_KbStatsOut_","additionalProperties":true,"type":"object","title":"Response Knowledge Base Stats Api V1 Coa Knowledge Base Stats Get"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/master-config":{"get":{"tags":["coa"],"summary":"Get active COA master config","description":"Return the active COA master_config doc.","operationId":"get_master_config_api_v1_coa_master_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterConfigOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/mapping-readiness":{"get":{"tags":["coa"],"summary":"Check job mapping readiness","description":"COA-mapping readiness for a job's client — drives the workpaper-run preflight\ngate ({needs_type, unmapped, unapproved, blocking}). CoA is client-scoped, so\nthis resolves the client from the job then reuses the client-level check.","operationId":"job_mapping_readiness_api_v1_coa_jobs__job_uuid__mapping_readiness_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobMappingReadinessOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients":{"get":{"tags":["coa"],"summary":"List firm clients","description":"List clients in the caller's firm.","operationId":"list_clients_api_v1_coa_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ClientListResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/clients/{client_uuid}/jobs":{"get":{"tags":["coa"],"summary":"List COA jobs for client","description":"List COA jobs for the given client.","operationId":"list_jobs_for_client_api_v1_coa_clients__client_uuid__jobs_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobListResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs":{"post":{"tags":["coa"],"summary":"Create a COA mapping job","description":"Create a new COA mapping job — inserts both a `jobs` row and the\n`coa_mapping_job` extension, and ensures the per-client COA document\n(deep copy of the master `parents`) in `coa_mapping_document`.","operationId":"create_job_api_v1_coa_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb/preview":{"post":{"tags":["coa"],"summary":"Preview a trial balance against the Chart of Accounts","description":"DRY RUN — classify each trial-balance account against the client's Chart of\nAccounts: matched, needs-confirmation (a leading-zero variant such as `020` vs `20`),\nor blocked. Writes NOTHING; drives the review drawer so nothing is imported until the\nuser confirms each suggestion.","operationId":"preview_tb_api_v1_coa_jobs__job_uuid__tb_preview_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_tb_api_v1_coa_jobs__job_uuid__tb_preview_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbPreviewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb/promote-blocked":{"post":{"tags":["coa"],"summary":"Create Chart-of-Accounts accounts from blocked trial-balance rows","description":"Create a Chart-of-Accounts account for each selected blocked trial-balance row.\nThe file is re-parsed and re-classified server-side, so only rows still blocked and\ncreatable (a missing account with a code and a name) are written; each lands with the\ncaller's chosen Zato type, so it never enters the needs-type HITL that blocks automap.\nWrites nothing to `trial_balance` — re-run the preview, then import.","operationId":"promote_blocked_tb_api_v1_coa_jobs__job_uuid__tb_promote_blocked_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_promote_blocked_tb_api_v1_coa_jobs__job_uuid__tb_promote_blocked_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbPromoteOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb/upload":{"post":{"tags":["coa"],"summary":"Upload trial balance file","description":"Upload a CSV or XLSX trial balance into `trial_balance` AND register the\nspreadsheet as the job's Trial-Balance ledger-slot file so it surfaces in the\n\"By File\" files-mapping list — the same single-source-of-truth model the By-File\nslot, the DELETE, and the RESET paths already rely on (a job's TB ⟺ its linked\nTB-slot file).","operationId":"upload_tb_api_v1_coa_jobs__job_uuid__tb_upload_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_tb_api_v1_coa_jobs__job_uuid__tb_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbUploadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb":{"delete":{"tags":["coa"],"summary":"Delete job trial balance","description":"Remove the job's trial balance entirely — UNTAG the linked TB file from the\njob AND delete the job's `trial_balance` rows. The TB-slot link is the source of\ntruth, so the two stay coupled: no TB file linked ⟺ no TB entries. Reuses the\nzbox delink path (the same `delink_from_job` the Sources screen + Job-Ledgers slot\nuse), so every removal route behaves identically; falls back to a direct row-delete\nfor a TB with no linked file (legacy coa-direct upload / orphaned rows).","operationId":"delete_tb_api_v1_coa_jobs__job_uuid__tb_delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeleteTbOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["coa"],"summary":"List job TB rows","description":"List TB rows for the job joined with the current mapping projection.","operationId":"list_tb_for_job_api_v1_coa_jobs__job_uuid__tb_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb/reset":{"post":{"tags":["coa"],"summary":"Hard-reset job trial balance","description":"HARD reset the job's trial balance — permanently DELETE all `trial_balance`\nrows for the job, clear the file reference + zero the TB rollups, and untag any\nlinked TB ledger-slot file so the slot is freed. Job-specific: the client Chart\nof Accounts and its account mappings are UNTOUCHED. Cannot be undone — a new\nupload / Xero sync can be done any time. (A stronger, guaranteed sibling of the\nDELETE /tb file-removal flow; this never depends on a linked file existing.)","operationId":"reset_tb_api_v1_coa_jobs__job_uuid__tb_reset_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResetTbOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/tb/sync-xero":{"post":{"tags":["coa"],"summary":"Sync trial balance from Xero","description":"Live Xero TB sync — fetch the client's trial balance into this job.","operationId":"sync_tb_from_xero_api_v1_coa_jobs__job_uuid__tb_sync_xero_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TbUploadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/automap":{"post":{"tags":["coa"],"summary":"Dispatch COA automap run","description":"Dispatch the 5-tier auto-mapping pipeline and return immediately (202).\n\nThe edge does NOT run the pipeline (that would hold the request open 35-135s\nand starve the orchestrator). It writes a durable dispatch record and returns\n``{run_id, status: 'dispatched'}``; the agent tier claims + runs it, and the\nclient watches live progress over the ``run:<run_id>`` WS topic.","operationId":"automap_job_api_v1_coa_jobs__job_uuid__automap_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DispatchAutomapOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/document":{"get":{"tags":["coa"],"summary":"Get job COA document","description":"Return the per-job COA document (deep copy of parents + mapping[]). With\n``wp_code``, narrows ``parents`` to those mapped to that workpaper — the filter\nZiffy uses to pull just one workpaper's COA parents.","operationId":"get_job_document_api_v1_coa_jobs__job_uuid__document_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Optional workpaper code — when set, narrows the returned parents to those mapped to that workpaper.","examples":["FIA"],"title":"Wp Code"},"description":"Optional workpaper code — when set, narrows the returned parents to those mapped to that workpaper."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobDocumentOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/mappings/{coa_tb_id}":{"put":{"tags":["coa"],"summary":"Re-map one TB account","description":"Manually move one TB row (coa_tb_id) to a new parent/section in the job's\nCOA document, recording the change in the audit trail.","operationId":"update_mapping_api_v1_coa_jobs__job_uuid__mappings__coa_tb_id__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"coa_tb_id","in":"path","required":true,"schema":{"type":"integer","title":"Coa Tb Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMappingIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UpdateMappingOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/parents/add":{"post":{"tags":["coa"],"summary":"Add a numbered parent section","description":"Multi-parent +: create a numbered sibling pair under the given base.","operationId":"add_section_api_v1_coa_jobs__job_uuid__parents_add_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__coa__schemas__AddSectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AddSectionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/parents/{parent_key}":{"delete":{"tags":["coa"],"summary":"Remove a numbered parent section","description":"Multi-parent −: tail-only delete of the highest numbered instance.","operationId":"remove_section_api_v1_coa_jobs__job_uuid__parents__parent_key__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"parent_key","in":"path","required":true,"schema":{"type":"string","title":"Parent Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemoveSectionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/approve-all":{"post":{"tags":["coa"],"summary":"Approve all job mappings","description":"Commit every non-null mapping to `client_account_memory` and freeze the job.","operationId":"approve_all_api_v1_coa_jobs__job_uuid__approve_all_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ApproveAllOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}/findings/{event_uuid}/confirm":{"post":{"tags":["coa"],"summary":"Confirm or reject AI finding","description":"Human-in-the-loop gate: confirm (or reject with ``?reject=true``) a draft AI\nmapping decision. AI events are captured as ``draft``; only a permitted human\ntransitions them — 'AI proposes, humans approve'.","operationId":"confirm_finding_api_v1_coa_jobs__job_uuid__findings__event_uuid__confirm_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"event_uuid","in":"path","required":true,"schema":{"type":"string","title":"Event Uuid"}},{"name":"reject","in":"query","required":false,"schema":{"type":"boolean","description":"Set true to REJECT the draft AI finding; false (default) confirms it.","examples":[false],"default":false,"title":"Reject"},"description":"Set true to REJECT the draft AI finding; false (default) confirms it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConfirmFindingOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/jobs/{job_uuid}":{"delete":{"tags":["coa"],"summary":"Soft-delete a COA job","description":"Soft-delete the COA job (PG `coa_mapping_job` row; the client-level COA\ndocument is shared across the client's jobs and left untouched).","operationId":"delete_job_api_v1_coa_jobs__job_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeleteJobOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/coa/audit":{"get":{"tags":["coa"],"summary":"Query COA audit trail","description":"Query the append-only audit trail by client / job / source.","operationId":"query_audit_api_v1_coa_audit_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional client UUID filter.","examples":["3f2b1c9a-7d84-4e2f-9a1b-2c3d4e5f6a7b"],"title":"Client Uuid"},"description":"Optional client UUID filter."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional job UUID filter.","examples":["8a7b6c5d-4e3f-2a1b-0c9d-8e7f6a5b4c3d"],"title":"Job Uuid"},"description":"Optional job UUID filter."},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional source filter (e.g. 'manual', 'agent').","examples":["manual"],"title":"Source"},"description":"Optional source filter (e.g. 'manual', 'agent')."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max rows to return (defaults to 500).","examples":[500],"default":500,"title":"Limit"},"description":"Max rows to return (defaults to 500)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuditQueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/firm-profile":{"get":{"tags":["messaging"],"summary":"Get the firm email profile","description":"The firm's email profile (tier, sender identity, DNS/BIMI status); a firm\nwith no row reads as the platform-default safe tier.","operationId":"get_firm_profile_api_v1_messaging_firm_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmEmailProfileOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["messaging"],"summary":"Update the firm email profile","description":"Patch the firm's email profile (tier, sender identity, branding); returns the\nupdated profile.","operationId":"update_firm_profile_api_v1_messaging_firm_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmEmailProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmEmailProfileOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/firm-profile/regenerate-integration-token":{"post":{"tags":["messaging"],"summary":"Regenerate the integrated-tier bearer token","description":"Mint a new per-firm bearer token for the integrated stream/status endpoints;\nthe plaintext is returned ONCE (only its hash is stored).","operationId":"regenerate_integration_token_api_v1_messaging_firm_profile_regenerate_integration_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RegenerateTokenOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/firm-profile/verify-dns":{"post":{"tags":["messaging"],"summary":"Verify sending-domain DNS status","description":"Report the firm's DKIM/DMARC/MAIL-FROM status (persisted pending state until\nSES is provisioned in P1).","operationId":"verify_dns_api_v1_messaging_firm_profile_verify_dns_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VerifyDnsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/messages":{"get":{"tags":["messaging"],"summary":"List delivery-log messages","description":"A page of the firm's outbound-email delivery log, optionally filtered by\nstatus/tier, with the count in this page.","operationId":"list_messages_api_v1_messaging_messages_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Page size (1–200). Optional; defaults to 50.","default":50,"title":"Limit"},"description":"Page size (1–200). Optional; defaults to 50."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip for paging. Optional; defaults to 0.","default":0,"title":"Offset"},"description":"Rows to skip for paging. Optional; defaults to 0."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional delivery-status filter (e.g. queued, suppressed, sent, delivered, bounced).","examples":["queued"],"title":"Status"},"description":"Optional delivery-status filter (e.g. queued, suppressed, sent, delivered, bounced)."},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional tier filter: hosted, branded, or integrated.","examples":["hosted"],"title":"Tier"},"description":"Optional tier filter: hosted, branded, or integrated."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MessageListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/messages/{message_uuid}":{"get":{"tags":["messaging"],"summary":"Get one delivery-log message","description":"One delivery-log message with its provider delivery events; 404 when the\nmessage isn't in the caller's firm.","operationId":"get_message_api_v1_messaging_messages__message_uuid__get","parameters":[{"name":"message_uuid","in":"path","required":true,"schema":{"type":"string","title":"Message Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MessageDetailOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/clients/{client_uuid}/send":{"post":{"tags":["messaging"],"summary":"Send a client email","description":"Queue an email to a client (object-scoped to {client_uuid}); returns the new\nmessage UUID and its queued/suppressed status. Never sends inline.","operationId":"send_client_email_api_v1_messaging_clients__client_uuid__send_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__messaging__schemas__SendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SendResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/send-test":{"post":{"tags":["messaging"],"summary":"Send an in-portal test email","description":"In-portal demo send for the current firm's active tier (ORG-scoped).","operationId":"send_test_email_api_v1_messaging_send_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SendResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/webhooks/ses-events":{"post":{"tags":["messaging-webhooks"],"summary":"Ingest SES/SNS delivery events","description":"Ingest SES delivery/bounce/complaint events (SNS-signature verified in P1);\ncurrently a stub that accepts and no-ops.","operationId":"ses_events_api_v1_messaging_webhooks_ses_events_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SesEventAck_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/messaging/integrated/{firm}/stream":{"get":{"tags":["messaging-integrated"],"summary":"Integrated-tier SSE stream","description":"SSE stream the firm's server holds open; Zato pushes queued emails down it.","operationId":"integrated_stream_api_v1_messaging_integrated__firm__stream_get","parameters":[{"name":"firm","in":"path","required":true,"schema":{"type":"string","title":"Firm"}}],"responses":{"200":{"description":"SSE stream (text/event-stream) of queued emails for the firm.","content":{"application/json":{"schema":{}},"text/event-stream":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/messaging/integrated/{firm}/status":{"post":{"tags":["messaging-integrated"],"summary":"Integrated-tier delivery-status callback","description":"Firm posts a delivery receipt (delivered/bounced) for a message.","operationId":"integrated_status_api_v1_messaging_integrated__firm__status_post","parameters":[{"name":"firm","in":"path","required":true,"schema":{"type":"string","title":"Firm"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegratedStatusAck_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/catalog":{"get":{"tags":["wp-mapping"],"summary":"Get the account-mapping catalog","description":"Every (workpaper, section, parent) row + its required files — the table's render contract.","operationId":"get_catalog_api_v1_wp_mapping_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CatalogListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/mappings":{"get":{"tags":["wp-mapping"],"summary":"Get a job's account mappings","description":"The job's mappings + the client COA account options + uploaded categories.","operationId":"get_job_mappings_api_v1_wp_mapping_jobs__job_uuid__mappings_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobMappings_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/config":{"get":{"tags":["wp-mapping"],"summary":"Get every workpaper's per-job config","description":"The full per-job workpaper-view doc (every workpaper) — the grid's source of truth.","operationId":"get_job_config_all_api_v1_wp_mapping_jobs__job_uuid__config_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobConfigAllResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/config":{"get":{"tags":["wp-mapping"],"summary":"Get one workpaper's per-job config","description":"The per-job config doc for one workpaper (wp-level categories + sections + base files).","operationId":"get_job_workpaper_config_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__config_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WpConfigWorkpaper_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/files/{file_uuid}/section":{"put":{"tags":["wp-mapping"],"summary":"Move a file into a section","description":"Lift-and-shift a file into a workpaper section (null section_key = back to base).","operationId":"move_file_section_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__files__file_uuid__section_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveFileSectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/section-accounts":{"put":{"tags":["wp-mapping"],"summary":"Set the accounts a section owns","description":"Set the accounts a section owns (attach / swap) — enforces account → exactly one section per workpaper.","operationId":"set_section_accounts_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__section_accounts_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSectionAccountsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/parents/{parent_key}":{"put":{"tags":["wp-mapping"],"summary":"Save one parent's account mapping","description":"Auto-save one parent's mapped accounts (replace set).","operationId":"save_parent_mapping_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__parents__parent_key__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"parent_key","in":"path","required":true,"schema":{"type":"string","title":"Parent Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveParentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/sections":{"post":{"tags":["wp-mapping"],"summary":"Add a workpaper section instance","description":"Add a section instance to a template workpaper (Bank / Current Account / …).","operationId":"add_section_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__sections_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__wp_mapping__schemas__AddSectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobSection_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-mapping/jobs/{job_uuid}/workpapers/{wp_code}/sections/{section_index}":{"patch":{"tags":["wp-mapping"],"summary":"Rename a workpaper section","description":"Rename a section — display name only; identity, placements and mappings are preserved. Pass\n`section_key` in the body to rename a derived per-account/per-parent heading; omit it for the legacy\n`section_index` (manual `inst:`) path.","operationId":"rename_section_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__sections__section_index__patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"section_index","in":"path","required":true,"schema":{"type":"integer","title":"Section Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameSectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobSection_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-mapping"],"summary":"Remove a workpaper section","description":"Remove an added section instance + its mappings. Pass `section_key` for an authored `par:`/`acc:` section\n(it lives only in wp_view_doc, no legacy row); `inst:`/omitted uses the legacy `section_index` path.","operationId":"remove_section_api_v1_wp_mapping_jobs__job_uuid__workpapers__wp_code__sections__section_index__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"section_index","in":"path","required":true,"schema":{"type":"integer","title":"Section Index"}},{"name":"section_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms":{"post":{"tags":["cs"],"summary":"Onboard a new practice firm","description":"Create a firm with its branches and partner users, sending each partner\nan invitation email. Requires `cs.orgs.create`. Returns the new firm plus\nper-partner invitation results.","operationId":"create_firm_api_v1_cs_firms_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmCreateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["cs"],"summary":"List practice firms","description":"Return a paginated, searchable, sortable list of firms with users/jobs\ncounts and days-since-invite per row. Requires `cs.orgs.list`.","operationId":"list_firms_api_v1_cs_firms_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Optional case-insensitive substring match on firm name.","examples":["Acme"],"title":"Search"},"description":"Optional case-insensitive substring match on firm name."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}":{"get":{"tags":["cs"],"summary":"Get a single firm","description":"Return one firm's details (contact info, agreement flags, job count)\nby its external UUID. Requires `cs.orgs.view`.","operationId":"get_firm_api_v1_cs_firms__firm_uuid__get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["cs"],"summary":"Update a practice firm","description":"Partially update a firm's details; may cascade changes to its users\n(returned as `updated_users`). Requires `cs.orgs.create`.","operationId":"update_firm_api_v1_cs_firms__firm_uuid__patch","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmUpdateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/suspend":{"post":{"tags":["cs"],"summary":"Suspend a practice firm","description":"Deactivate a firm (sets `is_active = False`) and return its updated\ndetails. Requires `cs.orgs.suspend`.","operationId":"suspend_firm_api_v1_cs_firms__firm_uuid__suspend_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/users":{"post":{"tags":["cs"],"summary":"Add a partner to a firm","description":"Create a partner user in the firm and send them an invitation email.\n409 if the email already exists. Requires `cs.orgs.create`.","operationId":"add_partner_api_v1_cs_firms__firm_uuid__users_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAddRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerAddResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["cs"],"summary":"List users in a firm","description":"Return all users belonging to the firm with a total count.\nRequires `cs.orgs.view`.","operationId":"list_firm_users_api_v1_cs_firms__firm_uuid__users_get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_FirmUsersResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/branches":{"get":{"tags":["cs"],"summary":"List branches of a firm","description":"Return all branches of the firm with a total count.\nRequires `cs.orgs.view`.","operationId":"list_firm_branches_api_v1_cs_firms__firm_uuid__branches_get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_BranchListResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["cs"],"summary":"Add a branch to a firm","description":"Create a new branch under the firm and return the created row.\nRequires `cs.orgs.create`.","operationId":"add_branch_api_v1_cs_firms__firm_uuid__branches_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BranchRow_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/branches/{branch_uuid}":{"patch":{"tags":["cs"],"summary":"Update a firm branch","description":"Partially update a branch of the firm and return the updated row.\nRequires `cs.orgs.create`.","operationId":"update_branch_api_v1_cs_firms__firm_uuid__branches__branch_uuid__patch","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}},{"name":"branch_uuid","in":"path","required":true,"schema":{"type":"string","title":"Branch Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__organization__org_schemas__BranchUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BranchRow_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/resend-invite/{user_uuid}":{"post":{"tags":["cs"],"summary":"Re-send a user invitation","description":"Rotate (or synthesise) the user's invitation token and re-send the\ninvite email; 400 if already accepted. Requires `cs.users.invite`.","operationId":"resend_invite_api_v1_cs_firms__firm_uuid__resend_invite__user_uuid__post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}},{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ResendInviteResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/cs-team-users":{"get":{"tags":["cs"],"summary":"List CS team users","description":"Return the CS-team directory (all customer-success users).\nRequires `cs.orgs.list`.","operationId":"list_cs_team_users_api_v1_cs_cs_team_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CsTeamUsersResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["cs"],"summary":"Create a CS team user","description":"Create a CS-team directory row plus an auth identity, and email the new\nmember a CS-portal invitation. 409 on duplicate email.\nRequires `cs.orgs.create`.","operationId":"create_cs_team_user_api_v1_cs_cs_team_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsUserCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CsTeamUserRow_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/cs-team-users/{cs_user_uuid}":{"patch":{"tags":["cs"],"summary":"Update a CS team user","description":"Partially update a CS-team user and return the updated row.\nRequires `cs.orgs.create`.","operationId":"update_cs_team_user_api_v1_cs_cs_team_users__cs_user_uuid__patch","parameters":[{"name":"cs_user_uuid","in":"path","required":true,"schema":{"type":"string","title":"Cs User Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsUserUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CsTeamUserRow_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["cs"],"summary":"Remove a CS team user","description":"Hard-delete the CS-team directory row, disable the linked auth identity\nand revoke its invitation. Requires `cs.orgs.create`.","operationId":"delete_cs_team_user_api_v1_cs_cs_team_users__cs_user_uuid__delete","parameters":[{"name":"cs_user_uuid","in":"path","required":true,"schema":{"type":"string","title":"Cs User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeletedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/jobs":{"get":{"tags":["cs"],"summary":"List jobs for a firm","description":"Return a paginated list of the firm's jobs. Requires `cs.orgs.view`.","operationId":"list_firm_jobs_api_v1_cs_firms__firm_uuid__jobs_get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max jobs to return (1-200). Defaults to 50.","examples":[50],"default":50,"title":"Limit"},"description":"Max jobs to return (1-200). Defaults to 50."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip for pagination. Defaults to 0.","examples":[0],"default":0,"title":"Offset"},"description":"Rows to skip for pagination. Defaults to 0."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CsFirmJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/clients":{"get":{"tags":["cs"],"summary":"List clients for a firm","description":"Return a paginated list of the firm's clients. Requires `cs.orgs.view`.","operationId":"list_firm_clients_api_v1_cs_firms__firm_uuid__clients_get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Max clients to return (1-1000). Defaults to 200.","examples":[200],"default":200,"title":"Limit"},"description":"Max clients to return (1-1000). Defaults to 200."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip for pagination. Defaults to 0.","examples":[0],"default":0,"title":"Offset"},"description":"Rows to skip for pagination. Defaults to 0."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CsFirmClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/grant-support":{"post":{"tags":["cs"],"summary":"Grant support access to a firm","description":"Grant a CS user support access to the firm under the given role\n(legacy endpoint). Requires `cs.orgs.grant_support`.","operationId":"grant_support_api_v1_cs_firms__firm_uuid__grant_support_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantSupportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GrantSupportResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/users/{user_uuid}/reset-password":{"post":{"tags":["cs"],"summary":"Force a user password reset","description":"Trigger a forced password reset for the user; sends the reset email.","operationId":"reset_password_api_v1_cs_users__user_uuid__reset_password_post","parameters":[{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResetPasswordResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms-login-status":{"get":{"tags":["cs"],"summary":"List per-firm login status","description":"Return each firm's user-login status rows for the CS practice dashboard.","operationId":"firms_login_status_api_v1_cs_firms_login_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmLoginStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/firms/{firm_uuid}/login-reminder":{"post":{"tags":["cs"],"summary":"Send login reminder emails to a firm","description":"Email a login reminder to the given recipients of the firm; returns the sent count.","operationId":"send_login_reminder_api_v1_cs_firms__firm_uuid__login_reminder_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginReminderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LoginReminderResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/requests":{"get":{"tags":["domain-support"],"summary":"List support requests","description":"List support requests with filters + pagination. Admins\n(SUPPORT__VIEW_ALL_REQUESTS) see the full queue; others only their own\nassignments; users with neither permission get an empty list.","operationId":"list_requests_api_v1_domain_support_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional filter — return only requests with this status (e.g. 'open', 'in_progress', 'resolved').","examples":["open"],"title":"Status"},"description":"Optional filter — return only requests with this status (e.g. 'open', 'in_progress', 'resolved')."},{"name":"request_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional filter — return only requests of this type ('organization' or 'job').","examples":["organization"],"title":"Request Type"},"description":"Optional filter — return only requests of this type ('organization' or 'job')."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SupportRequestListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/my-orgs":{"get":{"tags":["domain-support"],"summary":"List the support user's organizations","description":"Orgs the support user can work on — the post-login picker.","operationId":"list_my_orgs_api_v1_domain_support_my_orgs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MyOrgListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/assignees":{"get":{"tags":["domain-support"],"summary":"List eligible support assignees","description":"List support users eligible for the assignment dropdown, filtered by\nrole keys for the given scope (\"org\" or \"job\"). Needs SUPPORT__ASSIGN_JOBS.","operationId":"list_assignees_api_v1_domain_support_assignees_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"Which assignment dropdown to populate — \"org\" (support managers only) or \"job\" (support admins/managers/account owners). Optional; any value other than \"org\" is treated as \"job\".","examples":["job"],"default":"job","title":"Scope"},"description":"Which assignment dropdown to populate — \"org\" (support managers only) or \"job\" (support admins/managers/account owners). Optional; any value other than \"org\" is treated as \"job\"."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_AssigneeListResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/requests/{request_uuid}":{"get":{"tags":["domain-support"],"summary":"Get support request detail","description":"Return one support request's full detail (body, firm, assignee,\ncreator, timestamps). 404 if the UUID is unknown.","operationId":"get_request_api_v1_domain_support_requests__request_uuid__get","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SupportRequestDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/requests/{request_uuid}/assign":{"post":{"tags":["domain-support"],"summary":"Assign a support request","description":"Assign the request to a support user (role-validated per request type).\nJob requests also grant the assignee job access via team_member_mappings.\nNeeds SUPPORT__ASSIGN_JOBS.","operationId":"assign_request_api_v1_domain_support_requests__request_uuid__assign_post","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRequestPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/requests/{request_uuid}/resolve":{"post":{"tags":["domain-support"],"summary":"Mark a support request resolved","description":"Set the request's status to 'resolved' and record the acting user.\n404 if the UUID is unknown.","operationId":"resolve_request_api_v1_domain_support_requests__request_uuid__resolve_post","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequestPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SetStatusAck_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/requests/{request_uuid}/reopen":{"post":{"tags":["domain-support"],"summary":"Reopen a resolved support request","description":"Set the request's status back to 'open' and record the acting user.\nNeeds SUPPORT__RESOLVE_REQUESTS. 404 if the UUID is unknown.","operationId":"reopen_request_api_v1_domain_support_requests__request_uuid__reopen_post","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SetStatusAck_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/orgs/{firm_uuid}":{"get":{"tags":["domain-support"],"summary":"Get organization support detail","description":"Return a firm's support view: owner contact, its organization-type\nrequest (status, assignee, event history) and whether the viewer can\nmodify it (admin or assigned). 404 if the firm is unknown.","operationId":"get_org_detail_api_v1_domain_support_orgs__firm_uuid__get","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OrgSupportDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/orgs/{firm_uuid}/enter":{"post":{"tags":["domain-support"],"summary":"Enter an assigned organization","description":"Switch the support session's current-org context to `firm_uuid` so the\nuser can do real Practice-Portal setup. Allowed only if the user is the\nassignee of an active request for that firm (or a support admin).","operationId":"enter_org_api_v1_domain_support_orgs__firm_uuid__enter_post","parameters":[{"name":"firm_uuid","in":"path","required":true,"schema":{"type":"string","title":"Firm Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EnterOrgResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/orgs/exit":{"post":{"tags":["domain-support"],"summary":"Exit the entered organization","description":"Drop the entered-org context: re-mint with no firm so the support user\nreturns to the Support Dashboard.","operationId":"exit_org_api_v1_domain_support_orgs_exit_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExitOrgResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/users":{"get":{"tags":["domain-support"],"summary":"List support users","description":"List all support users (uuid, email, name, role). Needs\nSUPPORT__VIEW_ALL_REQUESTS.","operationId":"list_support_users_api_v1_domain_support_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SupportUserListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["domain-support"],"summary":"Create a support user","description":"Create a support-portal user with the given role. Needs SUPPORT__CREATE_USERS.","operationId":"create_support_user_api_v1_domain_support_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportUserPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CreateSupportUserResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/support/requests":{"post":{"tags":["support"],"summary":"Create a support request","description":"Create an organization-type support ticket for the caller's firm; it\nlands in Domain Support's queue as 'open'. Any authenticated user\n(auth.read_self). Returns the new request_uuid + status.","operationId":"create_support_request_api_v1_support_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequestPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CreateRequestResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me":{"get":{"tags":["practice"],"summary":"Get the caller's firm details","description":"Return the caller's firm (contact info, logo/ToE pointers, agreement-signed\nflags). Read-only; gated by `auth.read_self`.","operationId":"get_my_firm_api_v1_practice_firm_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmDetailsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/details":{"put":{"tags":["practice"],"summary":"Update firm details, logo, and terms","description":"Save firm details plus optional logo image and Client Terms Word doc in one\nmultipart PUT (atomic). Gated by `ORG.FIRM_DETAILS__UPDATE_DETAILS`.","operationId":"update_firm_details_api_v1_practice_firm_me_details_put","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_firm_details_api_v1_practice_firm_me_details_put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmDetailsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/accept-terms":{"post":{"tags":["practice"],"summary":"Sign the firm's Terms of Use","description":"Sign the firm's Terms of Use — backs the mandatory first-login ToU gate.\n\nGated on `auth.read_self` (the same universal permission as `GET /firm/me`)\nrather than `ORG.FIRM_DETAILS__UPDATE_DETAILS`: the blocking modal must be\nsubmittable by whichever practice user first lands with an unsigned firm.\nSigning is one-time / idempotent (`set_signed` never downgrades a signed ToU),\nso this is safe for any authenticated firm member to call.","operationId":"accept_terms_api_v1_practice_firm_me_accept_terms_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmDetailsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/complete-onboarding":{"post":{"tags":["practice"],"summary":"Mark Ziffy onboarding complete","description":"Stamp the firm's Ziffy-onboarding guide as complete so it stops auto-showing.\n\nFirm-level and idempotent (never overwrites an existing timestamp). Gated on\n`auth.read_self` (like `accept-terms`) so whichever practice user finishes the\nfirst setup loop can submit it.","operationId":"complete_onboarding_api_v1_practice_firm_me_complete_onboarding_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/prior-year-settings":{"get":{"tags":["practice"],"summary":"Get firm prior-year settings","description":"The firm's Prior Year config: draft auto-link on/off + threshold, and the\n(Phase 4) sign-off-on-comparatives gate.","operationId":"get_prior_year_settings_api_v1_practice_firm_me_prior_year_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PriorYearSettingsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["practice"],"summary":"Update firm prior-year settings","description":"Update the firm's Prior Year config. Set `auto_link_enabled=false` for\nstrict suggest-only (no draft auto-linking).","operationId":"update_prior_year_settings_api_v1_practice_firm_me_prior_year_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmPriorYearSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PriorYearSettingsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/logo":{"delete":{"tags":["practice"],"summary":"Remove the firm logo","description":"Detach the firm's logo document and return the updated firm details.\nGated by `ORG.FIRM_SETUP__FIRM_DETAILS`.","operationId":"delete_firm_logo_api_v1_practice_firm_me_logo_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmDetailsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/branches":{"get":{"tags":["practice"],"summary":"List the firm's branches","description":"List firm branches. Callers without a view-all branch permission only see\nbranches they are assigned to; `include_inactive` keeps deactivated ones.","operationId":"list_branches_api_v1_practice_firm_me_branches_get","parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Include deactivated branches (management view).","default":false,"title":"Include Inactive"},"description":"Include deactivated branches (management view)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_BranchListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["practice"],"summary":"Add a branch","description":"Create a branch (optionally primary, with a manager assignment) and return\nit. Gated by `ORG.BRANCH_MANAGEMENT__ADD_BRANCH`.","operationId":"add_branch_api_v1_practice_firm_me_branches_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BranchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/branches/{branch_uuid}":{"patch":{"tags":["practice"],"summary":"Update a branch","description":"Partially update a branch (name, code, contact fields, primary/active flags,\nmanager) and return the updated branch. Gated by `ORG.BRANCH_MANAGEMENT__UPDATE_BRANCH`.","operationId":"update_branch_api_v1_practice_firm_me_branches__branch_uuid__patch","parameters":[{"name":"branch_uuid","in":"path","required":true,"schema":{"type":"string","title":"Branch Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__practice__schemas__BranchUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BranchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["practice"],"summary":"Delete a branch","description":"Soft-delete a branch (404 if not found in the caller's firm).\nGated by `ORG.BRANCH_MANAGEMENT__DELETE_BRANCH`.","operationId":"delete_branch_api_v1_practice_firm_me_branches__branch_uuid__delete","parameters":[{"name":"branch_uuid","in":"path","required":true,"schema":{"type":"string","title":"Branch Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/documents":{"get":{"tags":["practice"],"summary":"List firm documents","description":"List the firm's typed documents (logo, Terms of Engagement, …). Read-only;\nuploads happen via the firm-details PUT.","operationId":"list_documents_api_v1_practice_firm_me_documents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DocumentListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/documents/{document_uuid}/download":{"get":{"tags":["practice"],"summary":"Download a firm document","description":"Stream a typed firm document's bytes inline (404 for anything that isn't a\nfirm document of the caller's firm).","operationId":"download_document_api_v1_practice_firm_me_documents__document_uuid__download_get","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","title":"Document Uuid"}}],"responses":{"200":{"description":"Raw firm-document bytes streamed inline.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/users":{"get":{"tags":["practice"],"summary":"List firm users","description":"List the firm's users, optionally scoped to staff assigned to one branch\n(`branch_uuid`) or narrowed to active accountant-tier users\n(`accountant_only`). Gated by `ORG.PERM_USERS_MANAGEMENT__ACCESS`.","operationId":"list_firm_users_api_v1_practice_firm_me_users_get","parameters":[{"name":"branch_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional: scope the list to staff assigned to this branch.","title":"Branch Uuid"},"description":"Optional: scope the list to staff assigned to this branch."},{"name":"accountant_only","in":"query","required":false,"schema":{"type":"boolean","description":"Optional: return only active accountant-tier (L2/L3/L4) users — powers the job 'Assign To Accountant' dropdown.","default":false,"title":"Accountant Only"},"description":"Optional: return only active accountant-tier (L2/L3/L4) users — powers the job 'Assign To Accountant' dropdown."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_FirmUsersResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["practice"],"summary":"Invite a teammate","description":"Create the teammate (Cognito + DB, optional branch assignment) and email an\ninvitation; if the email fails the raw token is returned instead. 409 on\nduplicate email. Gated by `ORG.PERM_USERS_MANAGEMENT__ADD_USER`.","operationId":"invite_teammate_api_v1_practice_firm_me_users_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeammateInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TeammateInviteResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/users/{user_uuid}":{"patch":{"tags":["practice"],"summary":"Update a firm user","description":"Partially update a teammate (name, phone, role level, active flag, auth\ntype, branch assignment). Gated by `ORG.PERM_USERS_MANAGEMENT__EDIT_USER`.","operationId":"patch_firm_user_api_v1_practice_firm_me_users__user_uuid__patch","parameters":[{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmUserPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FirmUserPatchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["practice"],"summary":"Remove a teammate from the firm","description":"Delete the user from the actor's firm (audited with the acting user id).","operationId":"delete_firm_user_api_v1_practice_firm_me_users__user_uuid__delete","parameters":[{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/users/{user_uuid}/unlock":{"post":{"tags":["practice"],"summary":"Unlock a locked user account","description":"Clear the teammate's login-lockout counter (idempotent, audited as a\ndecision event). Gated by `ORG.PERM_USERS_MANAGEMENT__EDIT_USER`.","operationId":"unlock_firm_user_api_v1_practice_firm_me_users__user_uuid__unlock_post","parameters":[{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/firm/me/users/{user_uuid}/resend-invite":{"post":{"tags":["practice"],"summary":"Re-send a teammate's invitation","description":"Re-issue the invite email for a not-yet-active teammate in the actor's firm.","operationId":"resend_invite_api_v1_practice_firm_me_users__user_uuid__resend_invite_post","parameters":[{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ResendInviteResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/practice/permissions-reference":{"get":{"tags":["practice"],"summary":"Get the permissions reference catalog","description":"Static lookup powering the Tab 2 right-side reference panel.","operationId":"permissions_reference_api_v1_practice_permissions_reference_get","parameters":[{"name":"_q","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Unused; kept for signature consistency.","default":0,"title":" Q"},"description":"Unused; kept for signature consistency."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PermissionsReferenceResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/profile/me":{"get":{"tags":["profile"],"summary":"Get my profile","description":"The caller's own profile — currently just the avatar URL (null if none).","operationId":"get_my_profile_api_v1_profile_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AvatarUrlResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/profile/me/avatar":{"post":{"tags":["profile"],"summary":"Upload my profile avatar","description":"Upload the caller's avatar image (validated: non-empty, image/*, size\ncap) and return its new URL.","operationId":"upload_avatar_api_v1_profile_me_avatar_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_avatar_api_v1_profile_me_avatar_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AvatarUrlResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["profile"],"summary":"Remove my profile avatar","description":"Delete the caller's stored avatar.","operationId":"remove_avatar_api_v1_profile_me_avatar_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AvatarRemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/profile/me/avatar/download":{"get":{"tags":["profile"],"summary":"Download my avatar image","description":"Stream the caller's avatar bytes inline with its stored mime type.","operationId":"download_avatar_api_v1_profile_me_avatar_download_get","responses":{"200":{"description":"The avatar image bytes.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients":{"get":{"tags":["clients"],"summary":"List clients for the caller's firm","description":"Paginated, searchable client list scoped to the caller's firm. Access is\ntiered: firm-wide bypass sees every client, others only assigned clients;\neach row carries can_view/can_edit capability flags and a jobs count.","operationId":"list_clients_api_v1_clients_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Search"}},{"name":"branch_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Uuid"}},{"name":"client_entity_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Entity Type Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ClientListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["clients"],"summary":"Create a client or bulk-import CSV","description":"Create one client from form fields, or bulk-import via a ``client_file`` CSV\n(per-row results; portal invites queued for opted-in rows). An uploaded CoA\nfile is saved and ingested best-effort; may also send a single portal invite.","operationId":"create_client_api_v1_clients_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_client_api_v1_clients_post","oneOf":[{"type":"object","title":"Single client create","properties":{"client_name":{"type":"string","description":"Client's legal/display name. REQUIRED for a single create.","examples":["Acme Farming Ltd"]},"contact_name":{"type":"string","description":"Primary contact / director name. REQUIRED for a single create.","examples":["Jane Director"]},"client_entity_type_id_ref":{"type":"integer","description":"Entity-type id (from GET /clients/entity-types). REQUIRED for a single create.","examples":[3]},"client_email":{"type":"string","description":"Contact email. Required only if send_portal_invite=true.","examples":["jane@acme.co.nz"]},"client_mobile_number":{"type":"string","description":"Contact mobile number.","examples":["+64211234567"]},"address":{"type":"string","description":"Postal / physical address."},"ird_number":{"type":"string","description":"IRD / tax number."},"balance_date":{"type":"string","description":"Annual balance date, ISO YYYY-MM-DD.","examples":["2024-03-31"]},"is_xero":{"type":"boolean","default":false},"is_farming":{"type":"boolean","default":false},"group_id_ref":{"type":"integer","description":"Client-group id (optional)."},"nzbn":{"type":"string","description":"NZ Business Number (Company entities)."},"send_portal_invite":{"type":"boolean","default":false,"description":"Provision + email a client-portal login (needs client_email)."},"branch_uuid":{"type":"string","description":"Firm branch for the client. Optional API-side (the UI marks it required)."},"assignee_uuids":{"type":"array","items":{"type":"string"},"description":"Extra firm users to assign (the creator is auto-assigned)."},"coa_file":{"type":"string","format":"binary","description":"Optional Chart-of-Accounts CSV to ingest for the new client."}},"required":["client_name","contact_name","client_entity_type_id_ref"]},{"type":"object","title":"CSV bulk import","properties":{"client_file":{"type":"string","format":"binary","description":"CSV of clients for BULK import (one per row). REQUIRED for the bulk path; omit for a single create."},"branch_uuid":{"type":"string","description":"Firm branch for the client. Optional API-side (the UI marks it required)."},"assignee_uuids":{"type":"array","items":{"type":"string"},"description":"Extra firm users to assign (the creator is auto-assigned)."},"send_portal_invite":{"type":"boolean","default":false,"description":"Provision + email a client-portal login (needs client_email)."}},"required":["client_file"]}]}}},"description":"Two modes on one endpoint — choose one variant below."},"responses":{"200":{"description":"Single client created (form fields). A `client_file` CSV upload instead returns `{records, created, errors}` in `data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientCreateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/jobs-grid":{"get":{"tags":["clients"],"summary":"List flattened clients-and-jobs grid rows","description":"Flattened, server-paginated clients+jobs grid for the clients list page.\n\nOne row per non-deleted job; a client with no jobs still gets one row (job\ncolumns null). Pages over the JOINED rows so the grid scrolls a single\ndataset — no client-side join, no in-memory job cap. Same three access tiers\n+ branch filter as ``GET /clients``.","operationId":"list_clients_jobs_grid_api_v1_clients_jobs_grid_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Search"}},{"name":"branch_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientJobsGridResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/entity-types":{"get":{"tags":["clients"],"summary":"List client entity type options","description":"Entity-type options for the Create/Edit Client dropdown (curated set).","operationId":"list_entity_types_api_v1_clients_entity_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EntityTypeListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}":{"get":{"tags":["clients"],"summary":"Get one client's detail","description":"Return a firm-scoped client's full detail, including capability flags,\nbranch brief, and whether a portal invite was already provisioned.","operationId":"get_client_api_v1_clients__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["clients"],"summary":"Update or soft-delete a client","description":"Partially update a firm-scoped client (or soft-delete via ``is_deleted``) from\nform fields; may send a portal invite and re-ingests a newly uploaded CoA file\nbest-effort. Returns the updated detail plus any invite result.","operationId":"patch_client_api_v1_clients__client_uuid__patch","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_patch_client_api_v1_clients__client_uuid__patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientPatchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}/nzbn":{"delete":{"tags":["clients"],"summary":"Disconnect a client from Company Office (NZBN)","description":"Disconnect this client from the NZ Companies Office register by clearing its\nsaved NZBN (``external_info.nzbn``). The connected badge flips off; previously\ngenerated Company Extract files stay as historical job artifacts. Idempotent.","operationId":"disconnect_client_nzbn_api_v1_clients__client_uuid__nzbn_delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}/coa/download":{"get":{"tags":["clients"],"summary":"Download the client's uploaded CoA file","description":"Download the CoA file previously uploaded for this client.","operationId":"download_client_coa_api_v1_clients__client_uuid__coa_download_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"The client's uploaded CoA file (binary).","content":{"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}/jobs":{"get":{"tags":["clients"],"summary":"List jobs for a client","description":"Paginated jobs for one firm-scoped client, delegated to the jobs service\nso the wire shape matches ``GET /jobs?client_uuid=...``.","operationId":"list_client_jobs_api_v1_clients__client_uuid__jobs_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client-groups":{"get":{"tags":["client-groups"],"summary":"List client groups for the firm","description":"Return all non-deleted client groups for the caller's firm.\nRequires ``ORG.GROUP_MANAGEMENT__VIEW_GROUPS``.","operationId":"list_groups_api_v1_client_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["client-groups"],"summary":"Create a client group","description":"Create a client group for the caller's firm, optionally assigning initial\nmember clients and a primary contact, and commit. Returns the new group.\nRequires ``ORG.GROUP_MANAGEMENT__CREATE_GROUP``.","operationId":"create_group_api_v1_client_groups_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupCreateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client-groups/{group_uuid}/clients":{"get":{"tags":["client-groups"],"summary":"List clients in a group","description":"List the clients belonging to a firm-scoped group (empty if the group is\nnot found). Requires ``ORG.GROUP_MANAGEMENT__VIEW_CLIENTS_BY_GROUP_ID``.","operationId":"list_group_clients_api_v1_client_groups__group_uuid__clients_get","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["client-groups"],"summary":"Add clients to a group","description":"Assign the given clients to a firm-scoped group and commit; returns the count\nupdated. Requires ``ORG.GROUP_MANAGEMENT__CLIENTS_ASSIGN_AND_REVOKE_TO_GROUP``.","operationId":"add_clients_to_group_api_v1_client_groups__group_uuid__clients_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddClientsToGroupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupClientsUpdatedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["client-groups"],"summary":"Remove clients from a group","description":"Remove the given clients from a firm-scoped group and commit; returns the count\nupdated. Requires ``ORG.GROUP_MANAGEMENT__CLIENTS_ASSIGN_AND_REVOKE_TO_GROUP``.","operationId":"remove_clients_from_group_api_v1_client_groups__group_uuid__clients_delete","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveClientsFromGroupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupClientsUpdatedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client-groups/{group_uuid}/primary-contact":{"patch":{"tags":["client-groups"],"summary":"Set the group's primary contact","description":"Set a group's primary contact to the given client, committing only when the\nupdate succeeded; returns ``{\"ok\": bool}``. Requires\n``ORG.GROUP_MANAGEMENT__EDIT_GROUP``.","operationId":"set_primary_contact_api_v1_client_groups__group_uuid__primary_contact_patch","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPrimaryContactRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"List the client's queries","description":"List client-visible queries for the caller's authorized clients, filterable by\nstatus (\"open\" | \"resolved\") and paginated. Requires CLIENT_QUERY_HUB__ACCESS.","operationId":"list_queries_api_v1_client_me_queries_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by client-facing status: \"open\" (awaiting the client) or \"resolved\" (closed). Any other value is ignored and all queries are returned.","examples":["open"],"title":"Status"},"description":"Filter by client-facing status: \"open\" (awaiting the client) or \"resolved\" (closed). Any other value is ignored and all queries are returned."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max number of queries to return (page size).","examples":[50],"default":50,"title":"Limit"},"description":"Max number of queries to return (page size)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"Number of queries to skip (pagination offset).","examples":[0],"default":0,"title":"Offset"},"description":"Number of queries to skip (pagination offset)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientQueryListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"Get one query's details","description":"Return one client-visible query's detail card; out-of-scope queries are 404 (no\nexistence leak). Requires CLIENT_QUERY_HUB__ACCESS.","operationId":"get_query_api_v1_client_me_queries__query_uuid__get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientQueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}/responses":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"List a query's message thread","description":"List the query's client-visible thread messages (internal comments never\ncross). Requires CLIENT_QUERY_HUB__ACCESS.","operationId":"list_responses_api_v1_client_me_queries__query_uuid__responses_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientThreadListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["client-portal","client-portal-queries"],"summary":"Post a reply to a query","description":"Post a client reply to an open query (rejected if resolved or already awaiting\nthe accountant); notifies the firm in realtime. Requires QUERY_HUB__POST_RESPONSE.","operationId":"add_response_api_v1_client_me_queries__query_uuid__responses_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientReplyIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientThreadMessageOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}/responses/with-attachments":{"post":{"tags":["client-portal","client-portal-queries"],"summary":"Post a reply with attachments","description":"Post a client reply plus file attachments transactionally — every file uploads\nand links, or the whole reply is rolled back. Requires QUERY_HUB__POST_RESPONSE.","operationId":"add_response_with_attachments_api_v1_client_me_queries__query_uuid__responses_with_attachments_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_response_with_attachments_api_v1_client_me_queries__query_uuid__responses_with_attachments_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientThreadMessageOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}/attachments":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"List a query's attachments","description":"List attachments on the query itself and on client-visible responses only —\ninternal-response attachments are filtered out. Requires CLIENT_QUERY_HUB__ACCESS.","operationId":"list_attachments_api_v1_client_me_queries__query_uuid__attachments_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientAttachmentListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}/attachments/{file_uuid}/view-url":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"Get an attachment view URL","description":"Return the client-portal download URL for a client-visible attachment (404 if\nout of scope or internal-only). Requires CLIENT_QUERY_HUB__ACCESS.","operationId":"attachment_view_url_api_v1_client_me_queries__query_uuid__attachments__file_uuid__view_url_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ViewUrlOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/queries/{query_uuid}/attachments/{file_uuid}/download":{"get":{"tags":["client-portal","client-portal-queries"],"summary":"Download a query attachment","description":"Serve a client-visible attachment to the client portal: local-disk blobs\nstream inline (so the in-app preview can render them); S3 blobs redirect to a\nshort-lived presigned URL. Scope/visibility is enforced in the service.","operationId":"attachment_download_api_v1_client_me_queries__query_uuid__attachments__file_uuid__download_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Attachment bytes served inline, or a redirect to a short-lived presigned URL.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/connect":{"post":{"tags":["client-portal","client-portal-akahu"],"summary":"Start an Akahu bank connection","description":"Client connects their own bank — returns the Consumer Information page URL\n(A2), which forwards to /start where the CSRF state nonce is minted (G6).","operationId":"connect_api_v1_client_me_akahu_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/connect-another-bank":{"post":{"tags":["client-portal","client-portal-akahu"],"summary":"Add another bank via Akahu","description":"Add another bank to the client's Akahu connection.\n\nAkahu uses ONE enduring-consent token covering every bank the user grants, so\n'add another bank' is simply re-opening the SAME hosted authorize URL: a user\nwho already consented is shown their existing connections and can add more,\nthen the OAuth callback re-syncs. (No separate add-only action like Basiq.)","operationId":"connect_another_bank_api_v1_client_me_akahu_connect_another_bank_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/status":{"get":{"tags":["client-portal","client-portal-akahu"],"summary":"Get Akahu connection status","description":"Connection status + the client's connected bank accounts.","operationId":"get_status_api_v1_client_me_akahu_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/sync":{"post":{"tags":["client-portal","client-portal-akahu"],"summary":"Sync Akahu bank accounts","description":"Re-pull the client's bank accounts from Akahu.\n\nAlso the path that surfaces an EXTERNAL revoke: syncing a token revoked at\nmy.akahu.nz hits a 401 → the service marks it REVOKED and soft-deletes its\naccounts, so the panel reflects the revoke. If nothing's connected (already\ncleaned up) we return clean status instead of erroring.","operationId":"sync_api_v1_client_me_akahu_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/accounts/{account_uuid}":{"delete":{"tags":["client-portal","client-portal-akahu"],"summary":"Remove one Akahu bank account","description":"Remove ONE connected account (CLASSIC connections only).\n\nOfficial open-banking accounts can't be removed via API — the service raises a\nclear message and the UI offers 'Manage accounts on Akahu' for those instead.","operationId":"remove_account_api_v1_client_me_akahu_accounts__account_uuid__delete","parameters":[{"name":"account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Account Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Remove Account Api V1 Client Me Akahu Accounts  Account Uuid  Delete","$ref":"#/components/schemas/StatusMessageResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/akahu/disconnect":{"delete":{"tags":["client-portal","client-portal-akahu"],"summary":"Disconnect the Akahu integration","description":"Client disconnects their Akahu integration.","operationId":"disconnect_api_v1_client_me_akahu_disconnect_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusMessageResponse","additionalProperties":{"type":"string"},"type":"object","title":"Response Disconnect Api V1 Client Me Akahu Disconnect Delete"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/connect":{"post":{"tags":["client-portal","client-portal-basiq"],"summary":"Start an Akahu bank connection","description":"Client connects their own bank — returns the hosted Consent UI URL.","operationId":"connect_api_v1_client_me_basiq_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasiqConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/connect-another-bank":{"post":{"tags":["client-portal","client-portal-basiq"],"summary":"Add another bank via Basiq","description":"Add another bank to the client's already-connected user (action=connect).","operationId":"connect_another_bank_api_v1_client_me_basiq_connect_another_bank_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasiqConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/manage":{"post":{"tags":["client-portal","client-portal-basiq"],"summary":"Open the Basiq manage screen","description":"Open Basiq's hosted MANAGE screen (action=manage) — the client views their\nconnected institutions and can delete/dismiss consent on Basiq's own UI.","operationId":"manage_api_v1_client_me_basiq_manage_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasiqConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/status":{"get":{"tags":["client-portal","client-portal-basiq"],"summary":"Get Basiq connection status","description":"Connection status + the client's connected bank accounts.","operationId":"get_status_api_v1_client_me_basiq_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasiqStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/sync":{"post":{"tags":["client-portal","client-portal-basiq"],"summary":"Sync Basiq bank accounts","description":"Re-pull the client's bank accounts from Basiq.\n\naccounts_only — keep the in-portal \"Sync now\" snappy; transactions sync via the\nconsent callback (handle_consent_callback), not on this button press.","operationId":"sync_api_v1_client_me_basiq_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasiqStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/basiq/connections/{connection_id}":{"delete":{"tags":["client-portal","client-portal-basiq"],"summary":"Remove a Basiq bank connection","description":"Client removes one of their connected banks.","operationId":"remove_connection_api_v1_client_me_basiq_connections__connection_id__delete","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Remove Connection Api V1 Client Me Basiq Connections  Connection Id  Delete","$ref":"#/components/schemas/StatusMessageResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/home":{"get":{"tags":["client-portal"],"summary":"Get client portal home overview","description":"Return the portal home payload — greeting, firm name, and pending items derived\nfrom open questionnaires and unanswered queries. Requires client.dashboard.view.","operationId":"get_home_api_v1_client_me_home_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientHomeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires":{"get":{"tags":["client-portal"],"summary":"List the client's questionnaires","description":"List every questionnaire invitation assigned to the caller's authorized\nclients. Requires client.questionnaire.view.","operationId":"list_questionnaires_api_v1_client_me_questionnaires_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientQuestionnaireListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}":{"get":{"tags":["client-portal"],"summary":"Get a questionnaire form","description":"Return the questionnaire form for an invitation, scoped to the caller's clients\n(out-of-scope is 404). May add the caller as a participant so their access is\ntracked. Requires client.questionnaire.view.","operationId":"get_questionnaire_form_api_v1_client_me_questionnaires__invitation_uuid__get","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecipientFormResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}/draft":{"put":{"tags":["client-portal"],"summary":"Save questionnaire draft answers","description":"Persist the caller's draft answers via the real questionnaire delivery engine.\nRequires client.questionnaire.submit.","operationId":"save_questionnaire_draft_api_v1_client_me_questionnaires__invitation_uuid__draft_put","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}/submit":{"post":{"tags":["client-portal"],"summary":"Submit a questionnaire","description":"Submit the questionnaire for this invitation (marks it submitted; further edits\nbecome read-only). Requires client.questionnaire.submit.","operationId":"submit_questionnaire_api_v1_client_me_questionnaires__invitation_uuid__submit_post","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}/files":{"post":{"tags":["client-portal"],"summary":"Upload a questionnaire answer file","description":"Upload a file answer for one question (size-capped by zbox_upload_max_mb; read\nin chunks off the event loop) and store it via the delivery engine.\nRequires client.questionnaire.submit.","operationId":"upload_questionnaire_file_api_v1_client_me_questionnaires__invitation_uuid__files_post","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}},{"name":"snapshot_question_uuid","in":"query","required":true,"schema":{"type":"string","description":"Snapshot UUID of the question this file answers.","examples":["c1a2b3d4-e5f6-7890-ab12-cd34ef567890"],"title":"Snapshot Question Uuid"},"description":"Snapshot UUID of the question this file answers."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_questionnaire_file_api_v1_client_me_questionnaires__invitation_uuid__files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QuestionnaireFileUploadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}/files/{file_uuid}":{"delete":{"tags":["client-portal"],"summary":"Delete a questionnaire answer file","description":"Delete one uploaded file answer for the caller's questionnaire invitation.\nRequires client.questionnaire.submit.","operationId":"delete_questionnaire_file_api_v1_client_me_questionnaires__invitation_uuid__files__file_uuid__delete","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/questionnaires/{invitation_uuid}/files/{file_uuid}/view-url":{"get":{"tags":["client-portal"],"summary":"Get a questionnaire file view URL","description":"Return a short-lived view URL (presigned S3 or a client-portal download path)\nfor an uploaded questionnaire file. Requires client.questionnaire.view.","operationId":"get_questionnaire_file_view_url_api_v1_client_me_questionnaires__invitation_uuid__files__file_uuid__view_url_get","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ViewUrlOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/clients":{"get":{"tags":["client-portal"],"summary":"List the client's authorized clients","description":"List every client the caller is authorized to act on, flagging the active\none. Requires client.clients.view.","operationId":"list_my_clients_api_v1_client_me_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ClientListResponse___3"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/clients/switch":{"post":{"tags":["client-portal"],"summary":"Switch the active client","description":"Re-mint the session scoped to a different authorized client — the\nclient-portal analog of `/auth/switch-persona`.","operationId":"switch_my_client_api_v1_client_me_clients_switch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSwitchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientSwitchResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/client/me/documents":{"get":{"tags":["client-portal"],"summary":"List the client's documents","description":"List the caller's client-scoped ZBox files, each flagged as uploaded-by-you or\nshared-with-you. Requires client.documents.view.","operationId":"list_documents_api_v1_client_me_documents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientDocumentsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["client-portal"],"summary":"Upload a client document","description":"Upload a file into ZBox tagged to the caller's own client (size-capped by\nzbox_upload_max_mb; read in chunks off the event loop); returns the new document\nid. Requires client.documents.upload.","operationId":"upload_document_api_v1_client_me_documents_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_api_v1_client_me_documents_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientDocumentUploadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/clients/{client_uuid}/gl-summary":{"get":{"tags":["autocoding"],"summary":"Get client stored GL summary","description":"How many general_ledger rows the client already has (for the 'N GL already\npresent' prompt when picking a client).","operationId":"client_gl_summary_api_v1_jobs_autocoding_clients__client_uuid__gl_summary_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientGlSummaryResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/clients/{client_uuid}/gl-rows":{"get":{"tags":["autocoding"],"summary":"Preview client stored GL rows","description":"Preview the client's stored general_ledger rows (the 'view' icon).","operationId":"client_gl_rows_api_v1_jobs_autocoding_clients__client_uuid__gl_rows_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"description":"Max stored GL rows to preview (1-5000).","default":500,"title":"Limit"},"description":"Max stored GL rows to preview (1-5000)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientGlRowsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/files":{"post":{"tags":["autocoding"],"summary":"Upload files and create run","description":"Upload an optional GL (Excel) + one or more bank statements, CREATE a run\n(status pending). The GL file is optional when use_stored_gl is set (the run then\nmatches against the client's stored general_ledger). Does NOT trigger matching —\nthe user starts it via the Run button. Returns {ac_job_uuid, ...}.","operationId":"create_run_api_v1_jobs_autocoding_files_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_run_api_v1_jobs_autocoding_files_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_StartResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/run":{"post":{"tags":["autocoding"],"summary":"Dispatch autocoding matching run","description":"Trigger the matching pipeline for an already-created run. Returns 202 {run_id};\nprogress streams over the run:<id> WS topic. Bank files are processed in sequence\nwith offset bs_index so result lines are globally unique across all statements.","operationId":"run_autocoding_api_v1_jobs_autocoding__ac_job_uuid__run_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_StartResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/bank-rows":{"post":{"tags":["autocoding"],"summary":"Ingest bank rows and start run","description":"Ingest a structured bank feed (Xero/API JSON — no PDF/CSV upload), create a run,\nand start it immediately (skips extraction → straight to the cascade). 202 {run_id}.","operationId":"ingest_bank_rows_api_v1_jobs_autocoding_bank_rows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankRowsIngestRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_StartResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/web-search":{"post":{"tags":["autocoding"],"summary":"Search the web for a merchant","description":"On-demand web search for one transaction's merchant (the v3 per-row search drawer).\nCalls SerpAPI directly through the sanctioned egress module (no agent needed).","operationId":"web_search_api_v1_jobs_autocoding_web_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_WebSearchResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/enrichment":{"get":{"tags":["autocoding"],"summary":"Get merchant enrichment review queue","description":"The Stage 3 review queue — distinct unknown merchants + their web candidates.","operationId":"get_enrichment_api_v1_jobs_autocoding__ac_job_uuid__enrichment_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EnrichmentResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["autocoding"],"summary":"Submit enrichment and resume run","description":"Submit per-merchant company selections and RESUME the run (202 {run_id}).","operationId":"submit_enrichment_api_v1_jobs_autocoding__ac_job_uuid__enrichment_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_StartResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding":{"get":{"tags":["autocoding"],"summary":"List autocoding runs","description":"List autocoding runs for the firm, newest first. Filterable by client (uuid), a server-side\nclient-name search, the date the run was started, and an optional ``limit`` (most recent N).","operationId":"list_jobs_api_v1_jobs_autocoding_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single client (uuid).","title":"Client Uuid"},"description":"Filter to a single client (uuid)."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Server-side search on the client name","title":"Q"},"description":"Server-side search on the client name"},{"name":"started_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Runs started on/after this date (YYYY-MM-DD)","title":"Started From"},"description":"Runs started on/after this date (YYYY-MM-DD)"},{"name":"started_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Runs started on/before this date (YYYY-MM-DD)","title":"Started To"},"description":"Runs started on/before this date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":200,"minimum":1},{"type":"null"}],"description":"Cap to the most recent N runs (history)","title":"Limit"},"description":"Cap to the most recent N runs (history)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_AcJobListItem__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/run-status":{"get":{"tags":["autocoding"],"summary":"Poll autocoding run status","description":"Poll the run status. Includes self-healing for orphaned runs (worker died mid-run).","operationId":"run_status_api_v1_jobs_autocoding__ac_job_uuid__run_status_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AcRunStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/results":{"get":{"tags":["autocoding"],"summary":"Get autocoding result lines","description":"Return all result lines for the results grid, with columns + unique account codes.","operationId":"get_results_api_v1_jobs_autocoding__ac_job_uuid__results_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AcResultsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/gl-rows":{"get":{"tags":["autocoding"],"summary":"Page the run's GL rows","description":"One page of the run's GL for the results GL pane (server-side, infinite scroll). Each row's\n`id` aligns with each bank line's gl_matched_indices for highlighting; ``ids`` returns the\nselected line's matched rows.","operationId":"gl_rows_api_v1_jobs_autocoding__ac_job_uuid__gl_rows_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Page size for the GL pane (1-500).","default":100,"title":"Limit"},"description":"Page size for the GL pane (1-500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Row offset for infinite-scroll paging.","default":0,"title":"Offset"},"description":"Row offset for infinite-scroll paging."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter the GL across columns","title":"Q"},"description":"Filter the GL across columns"},{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Matched mode — return only these GL row ids (CSV)","title":"Ids"},"description":"Matched mode — return only these GL row ids (CSV)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlRowsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/lines/{bs_index}/recode":{"put":{"tags":["autocoding"],"summary":"Recode one bank line","description":"Manually set the account_code for one bank-statement line (one-row UPDATE).","operationId":"recode_line_api_v1_jobs_autocoding__ac_job_uuid__lines__bs_index__recode_put","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}},{"name":"bs_index","in":"path","required":true,"schema":{"type":"integer","title":"Bs Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__RecodeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodeLineResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/recode-bulk":{"post":{"tags":["autocoding"],"summary":"Recode many lines in bulk","description":"Recode MANY lines in one request (multi-apply) — one round-trip, one metric recompute.","operationId":"recode_lines_bulk_api_v1_jobs_autocoding__ac_job_uuid__recode_bulk_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecodeBulkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodeBulkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/tax-bulk":{"post":{"tags":["autocoding"],"summary":"Set tax overrides in bulk","description":"Set the per-line Xero TaxType override on MANY lines (multi-apply) — one round-trip.","operationId":"set_tax_overrides_bulk_api_v1_jobs_autocoding__ac_job_uuid__tax_bulk_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxOverrideBulkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AcBulkUpdateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/tax-rates":{"get":{"tags":["autocoding"],"summary":"List switchable tax rates","description":"The switchable tax rates for this run — the client's LIVE Xero org rates (all of them, incl.\ncustom), falling back to the seeded region+provider config when Xero is unreachable / unlinked.\nThe per-line tax-override picker uses these; each line still defaults to its account's own rate.","operationId":"list_tax_rates_route_api_v1_jobs_autocoding__ac_job_uuid__tax_rates_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TaxRatesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/tracking-categories":{"get":{"tags":["autocoding"],"summary":"List Xero tracking categories","description":"The client's ACTIVE Xero tracking categories (+ options) for the per-line tracking picker —\nlive from the org, best-effort (empty when not Xero-linked / unreachable). A line takes ≤ 2 tags.","operationId":"list_tracking_categories_route_api_v1_jobs_autocoding__ac_job_uuid__tracking_categories_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingCategoriesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/tracking-bulk":{"post":{"tags":["autocoding"],"summary":"Set tracking tags in bulk","description":"Set the per-line tracking tags on MANY lines (multi-apply) — one round-trip.","operationId":"set_tracking_bulk_api_v1_jobs_autocoding__ac_job_uuid__tracking_bulk_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackingBulkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AcBulkUpdateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/xero/bank-accounts":{"get":{"tags":["autocoding"],"summary":"List Xero bank accounts","description":"The client's ACTIVE Xero bank accounts + the run's bank columns (for the\namount-column mapping) + push eligibility/counts.","operationId":"xero_bank_accounts_api_v1_jobs_autocoding__ac_job_uuid__xero_bank_accounts_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XeroBankAccountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/xero/preview":{"post":{"tags":["autocoding"],"summary":"Preview Xero sync","description":"Dry-run: exactly which bank transactions would post to Xero (no writes).","operationId":"xero_preview_api_v1_jobs_autocoding__ac_job_uuid__xero_preview_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroSyncRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XeroSyncPreviewResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/xero/sync":{"post":{"tags":["autocoding"],"summary":"Push coded lines to Xero","description":"Create the reviewed coded lines in Xero as spend/receive money (idempotent).","operationId":"xero_sync_api_v1_jobs_autocoding__ac_job_uuid__xero_sync_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroSyncRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XeroSyncResultResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/lines/{bs_index}/query":{"post":{"tags":["autocoding"],"summary":"Link a client query to line","description":"Record that a client query was raised for this bank line, so the results grid\nkeeps that row's raise-query action disabled across refresh.","operationId":"mark_line_query_api_v1_jobs_autocoding__ac_job_uuid__lines__bs_index__query_post","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}},{"name":"bs_index","in":"path","required":true,"schema":{"type":"integer","title":"Bs Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkLineQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarkLineQueryResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/client":{"patch":{"tags":["autocoding"],"summary":"Link run to a client","description":"Link (or re-link) this run to a client. Usable before or after processing —\na linked client is what enables raising client-level queries from the results.","operationId":"link_client_api_v1_jobs_autocoding__ac_job_uuid__client_patch","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__LinkClientRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinkClientResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/files/{file_uuid}/content":{"get":{"tags":["autocoding"],"summary":"Download a stored file","description":"Download/preview a stored GL, bank, or processed CSV file.","operationId":"file_content_api_v1_jobs_autocoding_files__file_uuid__content_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"True ⇒ attachment download; false ⇒ inline preview.","default":false,"title":"Download"},"description":"True ⇒ attachment download; false ⇒ inline preview."}],"responses":{"200":{"description":"The stored GL, bank, or processed CSV file bytes (inline or attachment).","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/split-counts":{"get":{"tags":["autocoding"],"summary":"Get per-line split counts","description":"Per-line split-leg counts for the whole run (the grid's \"Split · N\" chip on load).","operationId":"split_counts_api_v1_jobs_autocoding__ac_job_uuid__split_counts_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineSplitCountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/splits":{"get":{"tags":["autocoding"],"summary":"Get all split legs for the run","description":"All split legs for the run, keyed by bs_index (the grid's inline per-leg display).","operationId":"job_splits_api_v1_jobs_autocoding__ac_job_uuid__splits_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobSplitsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/{ac_job_uuid}/lines/{bs_index}/splits":{"get":{"tags":["autocoding"],"summary":"Get one line's split legs","description":"The current split legs for one bank line (empty ⇒ single-code).","operationId":"get_line_splits_api_v1_jobs_autocoding__ac_job_uuid__lines__bs_index__splits_get","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}},{"name":"bs_index","in":"path","required":true,"schema":{"type":"integer","title":"Bs Index"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineSplitsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["autocoding"],"summary":"Set one line's split allocation","description":"Split one bank line across N accounts (validated to sum to the line total), or clear it.","operationId":"set_line_splits_api_v1_jobs_autocoding__ac_job_uuid__lines__bs_index__splits_put","parameters":[{"name":"ac_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Ac Job Uuid"}},{"name":"bs_index","in":"path","required":true,"schema":{"type":"integer","title":"Bs Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSplitsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineSplitsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/bank-accounts":{"get":{"tags":["autocoding"],"summary":"List connected bank accounts","description":"The client's connected bank accounts (region-resolved provider) — populates the live-feed picker.","operationId":"bank_accounts_api_v1_jobs_autocoding_bank_accounts_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client whose connected bank accounts to list","title":"Client Uuid"},"description":"Client whose connected bank accounts to list"},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Override region (defaults to deployment country)","title":"Region"},"description":"Override region (defaults to deployment country)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BankAccountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/from-bank-feed":{"post":{"tags":["autocoding"],"summary":"Create run from live bank feed","description":"Pull the selected date range of transactions from the connected bank and create an autocoding\nrun — same cascade as an uploaded statement (returns the new run's ids).","operationId":"from_bank_feed_api_v1_jobs_autocoding_from_bank_feed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankFeedRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BankFeedRunResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/autocoding/bank-feed-preview":{"post":{"tags":["autocoding"],"summary":"Preview bank feed transaction count","description":"Count the posted transactions the feed would return for the range — a pre-run preview that\ndoubles as the 'Re-pull' refresh (hits the bank live each call). No run is created.","operationId":"bank_feed_preview_api_v1_jobs_autocoding_bank_feed_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankFeedPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BankFeedPreviewResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/recoding/clients/{client_uuid}/transactions":{"get":{"tags":["recoding"],"summary":"List client posted transactions","description":"A client's posted transactions (live journals), filtered server-side + paginated.","operationId":"list_transactions_api_v1_recoding_clients__client_uuid__transactions_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Restrict to one or more source accounts (comma-separated bare codes)","examples":["453"],"title":"Account Code"},"description":"Restrict to one or more source accounts (comma-separated bare codes)"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"On/after YYYY-MM-DD","examples":["2026-01-01"],"title":"Date From"},"description":"On/after YYYY-MM-DD"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"On/before YYYY-MM-DD","examples":["2026-03-31"],"title":"Date To"},"description":"On/before YYYY-MM-DD"},{"name":"contact","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Contact-name substring (comma-separated multi-select)","examples":["Acme"],"title":"Contact"},"description":"Contact-name substring (comma-separated multi-select)"},{"name":"text","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Description / reference substring","examples":["fuel"],"title":"Text"},"description":"Description / reference substring"},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Filter on abs(net) ≥ this","examples":[100],"title":"Min Amount"},"description":"Filter on abs(net) ≥ this"},{"name":"max_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Filter on abs(net) ≤ this","examples":[5000],"title":"Max Amount"},"description":"Filter on abs(net) ≤ this"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Page size (max 500)","default":100,"title":"Limit"},"description":"Page size (max 500)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip (infinite-scroll paging)","default":0,"title":"Offset"},"description":"Rows to skip (infinite-scroll paging)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodingTransactionsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/recoding/clients/{client_uuid}/filter-options":{"get":{"tags":["recoding"],"summary":"Get recoding filter facets","description":"Server-rendered filter facets (accounts, contacts, date bounds) over the full ledger.","operationId":"filter_options_api_v1_recoding_clients__client_uuid__filter_options_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodingFilterOptions_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/recoding/clients/{client_uuid}/recode":{"post":{"tags":["recoding"],"summary":"Bulk-recode selected transactions","description":"Bulk-reclassify the selected posted transactions to ``to_code`` — edited at source where the\nprovider allows, otherwise via a reclassification journal (reconciled/locked sources).","operationId":"recode_api_v1_recoding_clients__client_uuid__recode_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__recoding__schemas__RecodeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodeResultResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/recoding/clients/{client_uuid}/history":{"get":{"tags":["recoding"],"summary":"List recent recode batches","description":"Recent recode batches for the client (the tool's history).","operationId":"history_api_v1_recoding_clients__client_uuid__history_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of recent batches to return (max 100)","default":20,"title":"Limit"},"description":"Number of recent batches to return (max 100)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecodeHistoryResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/recoding/clients/{client_uuid}/changes":{"get":{"tags":["recoding"],"summary":"List staged ledger changes","description":"Staged ledger changes (recoding + autocoding) for the client — what we've changed and whether\nthe next resync has reflected it yet (``pending`` counts those still awaiting a resync).","operationId":"staged_changes_api_v1_recoding_clients__client_uuid__changes_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Number of recent staged changes to return (max 200)","default":50,"title":"Limit"},"description":"Number of recent staged changes to return (max 200)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LedgerChangesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/upload":{"post":{"tags":["pdf-splitter"],"summary":"Upload a bunch PDF for splitting","description":"Upload a multi-document (\"bunch\") PDF. Stores it in zbox, dispatches the split,\nand returns 202 {run_id}; progress streams over the run:<id> WS topic.","operationId":"upload_api_v1_jobs_pdf_splitter_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_api_v1_jobs_pdf_splitter_upload_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/check-duplicate":{"post":{"tags":["pdf-splitter"],"summary":"Check for duplicate bunch file","description":"1.0 check_duplicate_file — does a same-name bunch already exist for this firm/client?","operationId":"check_duplicate_api_v1_jobs_pdf_splitter_check_duplicate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckDuplicateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CheckDuplicateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/status":{"get":{"tags":["pdf-splitter"],"summary":"Get dispatched run status","description":"Poll a dispatched run's status by dispatch run_id (zato_runs).","operationId":"dispatch_status_api_v1_jobs_pdf_splitter_status_get","parameters":[{"name":"run_id","in":"query","required":true,"schema":{"type":"string","minLength":8,"description":"The dispatch run_id (from the 202 upload response) whose status to poll.","examples":["run_abc12345"],"title":"Run Id"},"description":"The dispatch run_id (from the 202 upload response) whose status to poll."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DispatchStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/categories":{"get":{"tags":["pdf-splitter"],"summary":"List split document categories","description":"The closed category vocabulary (boundary detector + recategorise dropdown), region-aware.","operationId":"categories_api_v1_jobs_pdf_splitter_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_str__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/documents":{"get":{"tags":["pdf-splitter"],"summary":"List split documents","description":"All split documents for the firm (optionally a client), newest first. The UI\ngroups them by file_alias_name (the source bunch). 1.0 bunch_split_files.","operationId":"list_documents_api_v1_jobs_pdf_splitter_documents_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional client filter — only that client's split documents. Omit for all firm documents.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"],"title":"Client Uuid"},"description":"Optional client filter — only that client's split documents. Omit for all firm documents."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_SplitDocument__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/active-runs":{"get":{"tags":["pdf-splitter"],"summary":"List in-progress splits","description":"In-progress splits for the firm. The UI polls this so a running split still shows\n'splitting…' after a page refresh (a mid-split source has no documents yet).","operationId":"active_runs_api_v1_jobs_pdf_splitter_active_runs_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional client filter for in-progress splits. Omit for all firm runs.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"],"title":"Client Uuid"},"description":"Optional client filter for in-progress splits. Omit for all firm runs."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActiveRunsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/documents/{document_uuid}":{"put":{"tags":["pdf-splitter"],"summary":"Edit a split document","description":"1.0 change-range + category update. A page_range change re-carves the sub-PDF\nto exactly the pages typed.","operationId":"edit_document_api_v1_jobs_pdf_splitter_documents__document_uuid__put","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","title":"Document Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditDocumentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DocumentView_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["pdf-splitter"],"summary":"Delete a split document","description":"Remove one split document from a bunch.","operationId":"delete_document_api_v1_jobs_pdf_splitter_documents__document_uuid__delete","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","title":"Document Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeleteDocumentResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/{source_file_uuid}/resplit":{"post":{"tags":["pdf-splitter"],"summary":"Re-split a whole bunch","description":"Re-partition a whole bunch (1.0 change-range): merges overlaps + gap-fills\nuncovered pages, so shrinking a doc auto-creates the remainder and overlapping\nedits merge — the bunch is always a complete partition.","operationId":"resplit_bunch_api_v1_jobs_pdf_splitter__source_file_uuid__resplit_post","parameters":[{"name":"source_file_uuid","in":"path","required":true,"schema":{"type":"string","title":"Source File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResplitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_DocumentView__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/{source_file_uuid}/documents":{"post":{"tags":["pdf-splitter"],"summary":"Add a manual split","description":"Manually carve a NEW document (page range + category) from the bunch source — so a\n5-page bunch can be partitioned into e.g. 1-3 and 4-5 with different categories.","operationId":"add_document_api_v1_jobs_pdf_splitter__source_file_uuid__documents_post","parameters":[{"name":"source_file_uuid","in":"path","required":true,"schema":{"type":"string","title":"Source File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDocumentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DocumentView_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/files/{file_uuid}/content":{"get":{"tags":["pdf-splitter"],"summary":"Stream or download a PDF","description":"Stream a split (or source) PDF. Inline by default (iframe preview); `?download=true`\nforces a download. Firm-scoped via the zbox row's firm_id_ref.","operationId":"file_content_api_v1_jobs_pdf_splitter_files__file_uuid__content_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"When true, forces a download (Content-Disposition: attachment) instead of an inline preview.","examples":[true],"default":false,"title":"Download"},"description":"When true, forces a download (Content-Disposition: attachment) instead of an inline preview."}],"responses":{"200":{"description":"The PDF bytes (inline preview or attachment).","content":{"application/json":{"schema":{}},"application/pdf":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/pdf-splitter/{source_file_uuid}/run-status":{"get":{"tags":["pdf-splitter"],"summary":"Get split status for a source","description":"Source-scoped status (no dispatch run_id needed) — what the frontend polls to show\nrunning/done/failed. Backed by the latest auto_module_runs row for this source.","operationId":"run_status_api_v1_jobs_pdf_splitter__source_file_uuid__run_status_get","parameters":[{"name":"source_file_uuid","in":"path","required":true,"schema":{"type":"string","title":"Source File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SplitStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs":{"get":{"tags":["jobs"],"summary":"List jobs for the firm","description":"Paginated, firm-scoped job list with optional status/search filters.\nUsers without the firm-wide bypass see only their assigned jobs\n(JOBS_MANAGEMENT__VIEW_ALL_JOBS vs __VIEW_ASSIGNED_JOBS).","operationId":"list_jobs_api_v1_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"description":"Optional status-slug filter (e.g. only 'open' jobs).","examples":["open"],"title":"Status"},"description":"Optional status-slug filter (e.g. only 'open' jobs)."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Optional free-text search over job code/name (server-side).","examples":["FY24"],"title":"Search"},"description":"Optional free-text search over job code/name (server-side)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["jobs"],"summary":"Create a job or bulk import","description":"Create a job — single (JSON body) or bulk (CSV).\n\nBranches on the request like the 1.0 `/create-job` route: when a binary\n`job_file` arrives as multipart/form-data it's parsed server-side and one\njob is created per row; otherwise the JSON body is a single job. Keeping\nboth on the same endpoint means the modal's one Save button drives both.","operationId":"create_job_api_v1_jobs_post","responses":{"200":{"description":"Single job created (JSON body). A multipart CSV upload instead returns `{records, created, errors}` in `data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"description":"Single-job create: send a JSON body (`JobCreateRequest` — only `client_uuid` is required). Bulk import instead: upload a multipart `job_file` CSV (one job per row) with no JSON body.","content":{"application/json":{"schema":{"description":"Body for a single-job create (`POST /jobs`, JSON path). The same endpoint\nalso accepts a multipart CSV upload (`job_file`) for bulk import, which does\nNOT use this model — see the router. `client_uuid` is the only required field;\neverything else is optional API-side (the create form collects more, but the\nbackend does not require them).","properties":{"client_uuid":{"description":"UUID of the client this job belongs to. REQUIRED — resolved against the caller's firm (404 if it doesn't exist in the firm).","examples":["f1e2d3c4-b5a6-7890-1234-567890abcdef"],"title":"Client Uuid","type":"string"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional human-readable job code. If supplied it must be UNIQUE within the firm (409 Conflict on collision).","examples":["FY24-0001"],"title":"Job Code"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name for the job. Optional at the API level (the create form collects it, but the backend does not require it).","examples":["FY24 Annual Accounts"],"title":"Job Name"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job-type slug; resolved to an FK id, auto-created if unseen. A config-gated type (e.g. AU 'ITR') is entity-restricted (422 if the client's entity type isn't allowed).","examples":["Annual"],"title":"Job Type"},"status":{"default":"Job Setup","description":"Initial workflow status; resolved to an FK id. New jobs start at 'Job Setup' (the first stage of the job status workflow — from then on the lifecycle machine owns the value).","examples":["Job Setup"],"title":"Status","type":"string"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Financial-year label.","examples":["2024"],"title":"Financial Year"},"job_value":{"anyOf":[{"minimum":0.0,"type":"number"},{"pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","type":"string"},{"type":"null"}],"description":"Dollar value the firm attributes to the job (portal currency, non-negative, may be zero). Pre-filled client-side from the firm's Default Job Value; whatever is saved here is the job's baseline (not audit-logged).","examples":[1500],"title":"Job Value"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reporting-period label.","examples":["FY2024"],"title":"Period"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job start date, ISO `YYYY-MM-DD`. Must be on or before the balance date (supplied via `external_info.balance_date`) — 422 otherwise.","examples":["2023-04-01"],"title":"Start Date"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Origin of the job (e.g. manual entry vs an import).","examples":["manual"],"title":"Source Type"},"job_source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human label for the source system/file the job came from.","examples":["XPM"],"title":"Job Source Name"},"external_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Free-form bounded attributes not modelled as columns (e.g. `balance_date`, reviewer). Read-whole config blob, not a growing collection.","examples":[{"balance_date":"2024-03-31"}],"title":"External Info"},"manager_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the firm user to assign the job to (the accountant picked on the create screen). Persisted as a team_member_mappings row; silently skipped if the uuid doesn't resolve to a firm user.","examples":["a1b2c3d4-e5f6-7890-1234-567890abcdef"],"title":"Manager Uuid"},"manager_uuids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"UUIDs of the firm users to assign the job to — a job may have MANY accountants. Persisted as team_member_mappings rows; unknown uuids are silently skipped. Takes precedence over the singular `manager_uuid`.","examples":[["a1b2c3d4-e5f6-7890-1234-567890abcdef"]],"title":"Manager Uuids"},"request_support":{"default":false,"description":"When true, routes this job to the Domain Support team for setup/run on the firm's behalf.","examples":[false],"title":"Request Support","type":"boolean"}},"required":["client_uuid"],"title":"JobCreateRequest","type":"object"}},"multipart/form-data":{"schema":{"type":"object","properties":{"job_file":{"type":"string","format":"binary","description":"CSV of jobs for bulk import (one job per row)."}},"required":["job_file"]}}}}}},"/api/v1/jobs/types":{"get":{"tags":["jobs"],"summary":"List selectable job types","description":"The active job-type lookup, for create/edit dropdowns (so the UI stops\nhardcoding types and stops auto-creating stray ones).\n\nFiltered to the portal/context: a config-gated type (e.g. AU ITR) is hidden\nunless its country feature flag is on and — when `client_uuid` is supplied —\nthe client's entity type is allowed (ITR is Individual-only).","operationId":"list_job_types_api_v1_jobs_types_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional client UUID; when supplied, entity-restricted types (e.g. AU 'ITR', Individual-only) are hidden unless the client's entity type allows them.","examples":["f1e2d3c4-b5a6-7890-1234-567890abcdef"],"title":"Client Uuid"},"description":"Optional client UUID; when supplied, entity-restricted types (e.g. AU 'ITR', Individual-only) are hidden unless the client's entity type allows them."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobTypeListResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/farming-modules":{"get":{"tags":["jobs"],"summary":"List active farming modules","description":"Active farming sub-categories for the farming module dropdown.","operationId":"list_farming_modules_api_v1_jobs_farming_modules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FarmingModuleListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/by-client/{client_uuid}":{"get":{"tags":["jobs"],"summary":"List jobs for a client","description":"Jobs for a specific client — reusable endpoint consumed by the\nClientJobsKanban component so the kanban can live in the jobs module.","operationId":"get_jobs_by_client_api_v1_jobs_by_client__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}":{"get":{"tags":["jobs"],"summary":"Get job detail","description":"Full job detail (404 if not in the caller's firm), hydrated with client\nname/uuid, per-user caps and Xero connectivity. Side effect: self-heals the\nprior-year link on first view. Gated by JOBS_MANAGEMENT__ACCESS.","operationId":"get_job_api_v1_jobs__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["jobs"],"summary":"Update or delete a job","description":"Partially update a job — only fields present in the payload are applied\n(the type slug is hydrated to its FK ref); `is_deleted` soft-deletes it.\n`status` is not patchable — the six-state lifecycle machine owns it.\nReturns the updated detail. Gated by JOBS_MANAGEMENT__EDIT_JOB.","operationId":"patch_job_api_v1_jobs__job_uuid__patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/summary":{"get":{"tags":["jobs"],"summary":"Get job summary metrics","description":"Aggregated per-job metrics for the workpaper header \"Job Summary\" card.\nSame view gate as get_job; firm scope enforced in the service.","operationId":"get_job_summary_api_v1_jobs__job_uuid__summary_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobSummaryMetrics_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/prior-suggestion":{"get":{"tags":["jobs"],"summary":"Get prior-year job suggestion","description":"Confidence-scored prior-year job suggestion for this job (never auto-linked).\nReturns ``{suggested_job_uuid, confidence, reason, prior_financial_year}``.","operationId":"get_prior_suggestion_api_v1_jobs__job_uuid__prior_suggestion_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PriorSuggestionResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/prior-link":{"patch":{"tags":["jobs"],"summary":"Set or clear prior-year link","description":"Confirm / change (uuid) / clear (null) the prior-year link; audited via\ndecision_events. The target must be a different job for the same client.","operationId":"set_prior_link_api_v1_jobs__job_uuid__prior_link_patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriorLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/prior-year/carry-forward":{"post":{"tags":["jobs"],"summary":"Carry forward prior-year balances","description":"Carry the linked prior job's TB closing → this job's missing balance-sheet\nopening rows (idempotent, re-runnable). Flags discrepancies, never overwrites.\nGated by PRIOR_YEAR__LINK_JOB today (split to EDIT_COMPARATIVES later if needed).","operationId":"carry_forward_prior_year_api_v1_jobs__job_uuid__prior_year_carry_forward_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CarryForwardResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/prior-year/comparatives-status":{"get":{"tags":["jobs"],"summary":"Get carry-forward comparatives status","description":"Carry-forward provenance + LIVE staleness for the comparatives banner:\n`{carried, status, source_tb_as_of, stale, last_run_at, discrepancy_count}`.","operationId":"comparatives_status_api_v1_jobs__job_uuid__prior_year_comparatives_status_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ComparativesStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/dashboard/summary":{"get":{"tags":["dashboard"],"summary":"Get the executive dashboard summary (scoped to the caller)","description":"KPIs, job-stage pipeline, and a ranked Decision Centre, plus a Ziffy-\nnarrated summary paragraph. Figures are firm-wide for Director/Manager\n(ORG.DASHBOARD__VIEW_FIRM) and scoped to the caller's branch ∧ assigned jobs\notherwise (`response.scope` says which). KPIs/pipeline/Decision Centre are\nrule-based (deterministic aggregates); only the narrative is LLM-generated.","operationId":"get_dashboard_summary_api_v1_dashboard_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DashboardSummary_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notifications":{"get":{"tags":["notifications"],"summary":"Get the notification feed","description":"The caller's own notification inbox (optionally unread-only / windowed),\nwith unread count + ``before_id`` cursor for infinite scroll.","operationId":"list_notifications_api_v1_notifications_get","parameters":[{"name":"unread","in":"query","required":false,"schema":{"type":"boolean","description":"When true, return only unread notifications; false (default) returns the full feed.","examples":[false],"default":false,"title":"Unread"},"description":"When true, return only unread notifications; false (default) returns the full feed."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max notifications to return in this page (1–100). Defaults to 30 if omitted.","examples":[30],"default":30,"title":"Limit"},"description":"Max notifications to return in this page (1–100). Defaults to 30 if omitted."},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Keyset cursor: return only notifications older than this notification_id (pass back the prior page's next_before_id). Omit for the first page.","examples":[10432],"title":"Before Id"},"description":"Keyset cursor: return only notifications older than this notification_id (pass back the prior page's next_before_id). Omit for the first page."},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only notifications created at/after this ISO-8601 timestamp. Optional window filter.","examples":["2026-07-01T00:00:00Z"],"title":"Since"},"description":"Only notifications created at/after this ISO-8601 timestamp. Optional window filter."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only notifications created at/before this ISO-8601 timestamp. Optional window filter.","examples":["2026-07-06T23:59:59Z"],"title":"Until"},"description":"Only notifications created at/before this ISO-8601 timestamp. Optional window filter."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NotificationListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notifications/unread-count":{"get":{"tags":["notifications"],"summary":"Get the unread notification count","description":"The caller's unread notification count — the bell badge reconcile.","operationId":"unread_count_api_v1_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UnreadCountOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notifications/read-all":{"post":{"tags":["notifications"],"summary":"Mark all notifications read","description":"Mark every one of the caller's notifications read; unread count → 0.","operationId":"mark_all_read_api_v1_notifications_read_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarkReadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notifications/{notification_uuid}/read":{"post":{"tags":["notifications"],"summary":"Mark one notification read","description":"Mark one of the caller's notifications read; returns the remaining\nunread count.","operationId":"mark_read_api_v1_notifications__notification_uuid__read_post","parameters":[{"name":"notification_uuid","in":"path","required":true,"schema":{"type":"string","title":"Notification Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarkReadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/activity/jobs/{job_uuid}":{"get":{"tags":["activity"],"summary":"Get a job's activity timeline","description":"Every activity event linked to one job, newest first (cursor via\n``before_id``). Optionally narrowed to a single ``verb``. Requires\nJOB.ACTIVITY__VIEW_JOB + object access to the job.","operationId":"job_timeline_api_v1_activity_jobs__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Before Id"}},{"name":"verb","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional catalog verb to filter to (e.g. `job.status_changed` for the Status History feed). Omit for the full timeline.","title":"Verb"},"description":"Optional catalog verb to filter to (e.g. `job.status_changed` for the Status History feed). Omit for the full timeline."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActivityListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/activity/clients/{client_uuid}":{"get":{"tags":["activity"],"summary":"Get a client's activity timeline","description":"Client-level-and-up activity events for one client, newest first (cursor\nvia ``before_id``). Reuses the clients view scopes + object access.","operationId":"client_timeline_api_v1_activity_clients__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Before Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActivityListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/activity/firm":{"get":{"tags":["activity"],"summary":"Get the firm activity timeline","description":"Firm-wide activity events (the firm audit feed), newest first with a\n``before_id`` cursor. Gated by ORG.ACTIVITY__VIEW_FIRM.","operationId":"firm_timeline_api_v1_activity_firm_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Before Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActivityListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/diagnostics/recent-errors":{"get":{"tags":["diagnostics"],"summary":"Get the caller's recent backend errors","description":"The caller's OWN recent error/warning log lines (firm+user scoped, with a\ntiered job→client→user fallback reported in ``precision``).","operationId":"recent_errors_route_api_v1_diagnostics_recent_errors_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecentErrorsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/clients/{client_uuid}":{"get":{"tags":["memory"],"summary":"Fetch live client detail","description":"Live client detail via the scoped memory tools; ``data`` is null when the\nclient is missing or not entitled (no existence leak).","operationId":"client_detail_api_v1_memory_clients__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_MemoryClientDetail__NoneType__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/jobs/{job_uuid}":{"get":{"tags":["memory"],"summary":"Fetch live job detail","description":"Live job detail via the scoped memory tools; ``data`` is null when the job\nis missing or not entitled (no existence leak).","operationId":"job_detail_api_v1_memory_jobs__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_MemoryJobDetail__NoneType__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/activity/{event_uuid}":{"get":{"tags":["memory"],"summary":"Fetch one activity-log event","description":"One activity-log event by UUID; ``data`` is null when the event is missing\nor not entitled (no existence leak).","operationId":"activity_detail_api_v1_memory_activity__event_uuid__get","parameters":[{"name":"event_uuid","in":"path","required":true,"schema":{"type":"string","title":"Event Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_MemoryActivityEvent__NoneType__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/recent":{"get":{"tags":["memory"],"summary":"List recent firm activity","description":"Recent firm activity events, optionally narrowed to one client (``client_uuid``).","operationId":"recent_actions_api_v1_memory_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MemoryActivityEvent__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/recall":{"get":{"tags":["memory"],"summary":"Recall from the knowledge base","description":"Hybrid scoped recall over the Ziffy Knowledge Base. Object access for\nclient/job narrowing is enforced inside the service (denied == empty).","operationId":"recall_memory_api_v1_memory_recall_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":500,"title":"Q"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":1,"default":8,"title":"K"}},{"name":"include_decisions","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Decisions"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecallResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/recall-log":{"get":{"tags":["memory"],"summary":"List the recall audit log","description":"The firm's retrieval-audit trail (who recalled what, when, with how many\nhits) — the explainability/compliance surface.","operationId":"recall_audit_log_api_v1_memory_recall_log_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_RecallLogEntry__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/memory/agent-records":{"get":{"tags":["memory"],"summary":"Inspect stored agent memory (dev)","description":"DEV-ONLY stored-memory inspector: the AgentCore records for the caller's scope\n(firm/client/job/user actor), via ai_gateway. Returns 404 unless the inspector is\nenabled (``settings.ziffy_memory_inspector_enabled``), so it's invisible in prod.","operationId":"agent_memory_records_api_v1_memory_agent_records_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":500,"default":"","title":"Q"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentMemoryRecords_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy/ask":{"post":{"tags":["ziffy"],"summary":"Ask Ziffy a question","description":"Answer a user question via the hosted Ziffy agent + its scoped tools.","operationId":"ask_api_v1_ziffy_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/Envelope_AskResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy/actions/confirm":{"post":{"tags":["ziffy"],"summary":"Confirm a Ziffy write action","description":"Execute a write-action the user confirmed on a Ziffy action card. The signed\ntoken + the action's own permission are re-checked in the service before the\nwrite runs (and a decision_events audit row is emitted).","operationId":"confirm_action_api_v1_ziffy_actions_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActionResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy/sessions":{"get":{"tags":["ziffy"],"summary":"List my Ziffy chat sessions","description":"List the current user's Ziffy chat threads (most-recently-active first).\n\nWhen ``scoped`` is set, restrict to the active tenant: ``job_uuid`` (a job\nthread), else ``client_uuid`` (a client-only thread), else the general thread.","operationId":"list_sessions_api_v1_ziffy_sessions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max threads to return (1–100).","examples":[30],"default":30,"title":"Limit"},"description":"Max threads to return (1–100)."},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Keyset cursor: return threads older than this internal id (for paging).","title":"Before Id"},"description":"Keyset cursor: return threads older than this internal id (for paging)."},{"name":"scoped","in":"query","required":false,"schema":{"type":"boolean","description":"When true, restrict to the active tenant resolved from client_uuid/job_uuid.","default":false,"title":"Scoped"},"description":"When true, restrict to the active tenant resolved from client_uuid/job_uuid."},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Active client scope; only applied when scoped=true.","title":"Client Uuid"},"description":"Active client scope; only applied when scoped=true."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Active job scope; only applied when scoped=true (takes precedence over client_uuid).","title":"Job Uuid"},"description":"Active job scope; only applied when scoped=true (takes precedence over client_uuid)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_SessionSummary__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy/sessions/{session_id}":{"get":{"tags":["ziffy"],"summary":"Get one Ziffy session's history","description":"The ordered turns of one of the current user's threads.","operationId":"session_history_api_v1_ziffy_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SessionHistory_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/get_my_permissions":{"get":{"tags":["ziffy-agent"],"summary":"Get the caller's permissions","description":"Agent tool: the caller's persona, role, user type, portal and sorted\npermission list — what Ziffy uses to explain what the user can do.","operationId":"get_my_permissions_api_v1_ziffy_agent_get_my_permissions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentPermissionsView_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/get_firm_overview":{"get":{"tags":["ziffy-agent"],"summary":"Get the caller's firm overview","description":"Agent tool: basic facts about the caller's own firm (name, type, job\ncount, onboard date, contact info).","operationId":"get_firm_overview_api_v1_ziffy_agent_get_firm_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentFirmOverview_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/list_users":{"get":{"tags":["ziffy-agent"],"summary":"List the firm's users","description":"Agent tool: the users of the caller's firm, with a count.","operationId":"list_users_api_v1_ziffy_agent_list_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentUsersList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/list_clients":{"get":{"tags":["ziffy-agent"],"summary":"List accessible clients","description":"Agent tool: the firm's clients the caller may see (access-tier\nfiltered), capped, with total vs shown counts.","operationId":"list_clients_api_v1_ziffy_agent_list_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentClientsList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/list_jobs":{"get":{"tags":["ziffy-agent"],"summary":"List accessible jobs","description":"Agent tool: the firm's jobs the caller may see (access-tier filtered),\ncapped, with total vs shown counts.","operationId":"list_jobs_api_v1_ziffy_agent_list_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentJobsList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/get_client_detail":{"get":{"tags":["ziffy-agent"],"summary":"Get the in-scope client's detail","description":"Agent tool: detail for the client pinned in the conversation's verified\nscope token. 403 when no client is in scope.","operationId":"get_client_detail_api_v1_ziffy_agent_get_client_detail_get","parameters":[{"name":"x-ziffy-scope","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Ziffy-Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentClientDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/get_job_detail":{"get":{"tags":["ziffy-agent"],"summary":"Get the in-scope job's detail","description":"Agent tool: detail for the job pinned in the conversation's verified\nscope token. 403 when no job is in scope.","operationId":"get_job_detail_api_v1_ziffy_agent_get_job_detail_get","parameters":[{"name":"x-ziffy-scope","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Ziffy-Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentJobDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/get_recent_activity":{"get":{"tags":["ziffy-agent"],"summary":"Get recent scoped activity","description":"Agent tool: recent activity events — client-scoped when the verified\nscope pins a client, otherwise firm-wide. Gated by ORG.ACTIVITY__VIEW_FIRM.","operationId":"get_recent_activity_api_v1_ziffy_agent_get_recent_activity_get","parameters":[{"name":"x-ziffy-scope","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Ziffy-Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentRecentActivity_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/list_manual_journals":{"get":{"tags":["ziffy-agent"],"summary":"List the in-scope job's manual journals","description":"Agent tool: the manual journals raised on the job pinned in the\nconversation's verified scope token. 403 when no job is in scope.","operationId":"list_manual_journals_api_v1_ziffy_agent_list_manual_journals_get","parameters":[{"name":"x-ziffy-scope","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Ziffy-Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentManualJournalsList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/progress":{"post":{"tags":["ziffy-agent"],"summary":"Publish live make_plan progress","description":"Agent-initiated (not a discoverable MCP tool — this is orchestrator-side\ncode, not a model tool call): pushes a live snapshot of a make_plan run's\ntasks/waves to the user's realtime lane, so the chat can show which steps\nare pending/active/done and which ran in parallel WHILE the plan is still\nexecuting (today's ZiffyPlanCard only renders once the whole answer lands).\nDeliberately outside the read-only ziffy-mcp mount (a side-effecting notify,\nnot a GET-mirrored data tool). Best-effort: publish() never raises.","operationId":"post_progress_api_v1_ziffy_agent_progress_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanView"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-agent/trace":{"post":{"tags":["ziffy-agent"],"summary":"Capture a Ziffy turn trace","description":"Agent-initiated (not a discoverable MCP tool): after the reply is returned the\nagent emits the full turn trace — router/planner/executor/synth tiers plus every tool,\nMCP and sub-agent span with their raw I/O. The backend masks it, archives the masked +\nraw bundles to S3 (WORM), and writes the firm-scoped index row the Domain Support / CS\ntrace viewer filters on. Scope (firm/user/client/job) is taken from the authenticated\nctx + verified scope token, never the body. Returns the new index_uuid (``duplicate``\nwhen the turn was already captured).","operationId":"post_trace_api_v1_ziffy_agent_trace_post","parameters":[{"name":"x-ziffy-scope","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Ziffy-Scope"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceEnvelope"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/ziffy-traces":{"get":{"tags":["ziffy-traces"],"summary":"List a firm's Ziffy traces","description":"List the firm's captured Ziffy turns (newest first), filterable by response /\nsession / X-Ray trace id, status, mode, tool, and cost / token / latency thresholds.\nFirm-scoped; PII is masked; no raw reveal.","operationId":"list_ziffy_traces_api_v1_domain_support_ziffy_traces_get","parameters":[{"name":"firm_uuid","in":"query","required":true,"schema":{"type":"string","description":"The organization whose Ziffy traces to list.","title":"Firm Uuid"},"description":"The organization whose Ziffy traces to list."},{"name":"response_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact turn id.","title":"Response Id"},"description":"Exact turn id."},{"name":"session_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A chat thread id.","title":"Session Uuid"},"description":"A chat thread id."},{"name":"trace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"X-Ray trace id.","title":"Trace Id"},"description":"X-Ray trace id."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ok | degraded | error","title":"Status"},"description":"ok | degraded | error"},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"single | multi | clarify | outside_scope | voice","title":"Mode"},"description":"single | multi | clarify | outside_scope | voice"},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A tool name the turn invoked.","title":"Tool"},"description":"A tool name the turn invoked."},{"name":"min_cost_cents","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Min Cost Cents"}},{"name":"min_tokens","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Min Tokens"}},{"name":"min_latency_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Min Latency Ms"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TraceListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/domain-support/ziffy-traces/{response_id}":{"get":{"tags":["ziffy-traces"],"summary":"Get a Ziffy trace detail","description":"Return one turn's masked trace: the summary row plus the span waterfall (tiers /\ntools / MCP with their MASKED I/O) read from the S3 bundle. Firm-scoped; 404 if\nunknown for the firm. Masked-only — the raw bundle has no read path here.","operationId":"get_ziffy_trace_api_v1_domain_support_ziffy_traces__response_id__get","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}},{"name":"firm_uuid","in":"query","required":true,"schema":{"type":"string","description":"The organization the trace belongs to.","title":"Firm Uuid"},"description":"The organization the trace belongs to."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TraceDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/ziffy-traces":{"get":{"tags":["cs-ziffy-traces"],"summary":"List a firm's Ziffy traces","description":"List the firm's captured Ziffy turns (newest first), filterable by response /\nsession / X-Ray trace id, status, mode, tool, and cost / token / latency thresholds.\nFirm-scoped; PII is masked; no raw reveal.","operationId":"list_ziffy_traces_api_v1_cs_ziffy_traces_get","parameters":[{"name":"firm_uuid","in":"query","required":true,"schema":{"type":"string","description":"The organization whose Ziffy traces to list.","title":"Firm Uuid"},"description":"The organization whose Ziffy traces to list."},{"name":"response_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact turn id.","title":"Response Id"},"description":"Exact turn id."},{"name":"session_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A chat thread id.","title":"Session Uuid"},"description":"A chat thread id."},{"name":"trace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"X-Ray trace id.","title":"Trace Id"},"description":"X-Ray trace id."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ok | degraded | error","title":"Status"},"description":"ok | degraded | error"},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"single | multi | clarify | outside_scope | voice","title":"Mode"},"description":"single | multi | clarify | outside_scope | voice"},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A tool name the turn invoked.","title":"Tool"},"description":"A tool name the turn invoked."},{"name":"min_cost_cents","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Min Cost Cents"}},{"name":"min_tokens","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Min Tokens"}},{"name":"min_latency_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Min Latency Ms"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TraceListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/cs/ziffy-traces/{response_id}":{"get":{"tags":["cs-ziffy-traces"],"summary":"Get a Ziffy trace detail","description":"Return one turn's masked trace: the summary row plus the span waterfall (tiers /\ntools / MCP with their MASKED I/O) read from the S3 bundle. Firm-scoped; 404 if\nunknown for the firm. Masked-only — the raw bundle has no read path here.","operationId":"get_ziffy_trace_api_v1_cs_ziffy_traces__response_id__get","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}},{"name":"firm_uuid","in":"query","required":true,"schema":{"type":"string","description":"The organization the trace belongs to.","title":"Firm Uuid"},"description":"The organization the trace belongs to."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TraceDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/jobs/{job_uuid}/snapshot":{"get":{"tags":["ziffy-watch"],"summary":"Get Z-watch job readiness snapshot","description":"Which workpapers this job's uploaded trial balance can generate, and which\nstill need supporting-document categories (read-only, computed live).","operationId":"job_snapshot_api_v1_ziffy_watch_jobs__job_uuid__snapshot_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WatchSnapshot_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/clients/{client_uuid}/coa-audit":{"get":{"tags":["ziffy-watch"],"summary":"Get Ziffy Watch CoA mapping audit","description":"Opus's second opinion on this client's still-unreviewed CoA mapping\npredictions (accounts a human hasn't approved or manually remapped).","operationId":"coa_audit_snapshot_api_v1_ziffy_watch_clients__client_uuid__coa_audit_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaAuditSnapshot_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/jobs/{job_uuid}/signoff-readiness":{"get":{"tags":["ziffy-watch"],"summary":"Get sign-off readiness results for a job","description":"Every persisted \"Ready to sign off\" review for this job, keyed by workpaper\ncode, so each row shows its prior verdict + last-calculated time without a rerun.","operationId":"signoff_readiness_snapshot_api_v1_ziffy_watch_jobs__job_uuid__signoff_readiness_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SignoffReadinessSnapshot_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/jobs/{job_uuid}/workpapers/{wp_code}/signoff-readiness":{"post":{"tags":["ziffy-watch"],"summary":"Start a workpaper's sign-off readiness review","description":"Kick off (or Re-check) the sign-off readiness review for one workpaper. The\nhosted Ziffy agent runs asynchronously off the request; this returns the\npersisted in_progress state immediately, and a toast fires on completion.","operationId":"check_signoff_readiness_api_v1_ziffy_watch_jobs__job_uuid__workpapers__wp_code__signoff_readiness_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SignoffReadiness_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/jobs/{job_uuid}/signoff-issues":{"get":{"tags":["ziffy-watch"],"summary":"Get the Ready-to-Sign-off issue checklist for a job","description":"The deterministic per-workpaper sign-off issue checklist — missing documents,\nunreconciled variances, not-ready dependencies, missing journals, and the job-wide\nunmapped-CoA precondition — each with how to resolve it and where to go. No LLM.","operationId":"signoff_issues_snapshot_api_v1_ziffy_watch_jobs__job_uuid__signoff_issues_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SignoffIssuesSnapshot_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/jobs/{job_uuid}/auto-journals/suggest":{"post":{"tags":["ziffy-watch"],"summary":"Suggest adjusting manual journals for a workpaper","description":"Dispatch a Ziffy run that drafts adjusting manual journals for one workpaper.\nReturns 202 ``{run_id}`` immediately; each drafted journal streams back over the\nuser's WS lane as a ``journal_draft`` frame. Nothing is posted — the drafts are\nephemeral until the user Moves one to draft (the existing confirm path).","operationId":"suggest_auto_journals_api_v1_ziffy_watch_jobs__job_uuid__auto_journals_suggest_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestAutoJournalsRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AutoJournalDispatch_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/sessions":{"get":{"tags":["ziffy-watch"],"summary":"List my Z-watch chat sessions","description":"The current user's Z-watch threads. When ``scoped``, restrict to the active\ntenant: ``job_uuid`` (job thread), else ``client_uuid`` (client thread), else general.","operationId":"list_sessions_api_v1_ziffy_watch_sessions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before Id"}},{"name":"scoped","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Scoped"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_SessionSummary__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ziffy-watch/sessions/{session_id}":{"get":{"tags":["ziffy-watch"],"summary":"Get one Z-watch session's history","description":"The ordered turns of one of the current user's Z-watch threads.","operationId":"session_history_api_v1_ziffy_watch_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SessionHistory_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/hitl/requests":{"get":{"tags":["hitl"],"summary":"List my HITL requests","description":"The caller's HITL inbox — requests they own or are permission-eligible\nto answer, optionally filtered by status. Gated by JOB.HITL__VIEW.","operationId":"list_requests_api_v1_hitl_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"description":"Optional inbox status filter — one of 'pending', 'answered', 'applied', 'rejected'. Omit to return all statuses.","examples":["pending"],"title":"Status"},"description":"Optional inbox status filter — one of 'pending', 'answered', 'applied', 'rejected'. Omit to return all statuses."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max number of requests to return (1–200).","examples":[50],"default":50,"title":"Limit"},"description":"Max number of requests to return (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HitlListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/hitl/requests/{request_uuid}":{"get":{"tags":["hitl"],"summary":"Get one HITL request","description":"One HITL request by uuid, access-checked against the caller.","operationId":"get_request_api_v1_hitl_requests__request_uuid__get","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HitlRequestOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/hitl/requests/{request_uuid}/answer":{"post":{"tags":["hitl"],"summary":"Answer or reject a HITL request","description":"Answer (or reject) a pending HITL request; the typed handler applies the\nanswer's side effects. Gated by JOB.HITL__ANSWER.","operationId":"answer_request_api_v1_hitl_requests__request_uuid__answer_post","parameters":[{"name":"request_uuid","in":"path","required":true,"schema":{"type":"string","title":"Request Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HitlAnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HitlAnswerOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds":{"get":{"tags":["materiality-thresholds"],"summary":"Get effective materiality thresholds","description":"Resolve the firm's effective GL materiality thresholds, optionally scoped to a job type,\nclient type, client, or job (merge order: MASTER -> ORG -> CLIENT_TYPE -> JOB_TYPE ->\nCLIENT -> JOB). Read-only; requires ORG.MATERIALITY_THRESHOLD__VIEW_TEMPLATE.","operationId":"get_effective_thresholds_api_v1_materiality_thresholds_get","parameters":[{"name":"job_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional. Scope resolution to a JOB_TYPE template; derived from the job when job_uuid is given.","examples":[12],"title":"Job Type Id"},"description":"Optional. Scope resolution to a JOB_TYPE template; derived from the job when job_uuid is given."},{"name":"client_entity_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional. Scope to a CLIENT_TYPE overlay. Only honoured when neither client_uuid nor job_uuid is supplied (a client/job resolves its own entity type).","examples":[6],"title":"Client Entity Type Id"},"description":"Optional. Scope to a CLIENT_TYPE overlay. Only honoured when neither client_uuid nor job_uuid is supplied (a client/job resolves its own entity type)."},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional. Resolve the effective thresholds for a specific client (CLIENT tier).","examples":["c1a2b3c4-d5e6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"Optional. Resolve the effective thresholds for a specific client (CLIENT tier)."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional. Resolve for a specific job (JOB tier); also derives its client and job type.","examples":["j1a2b3c4-d5e6-7890-abcd-1234567890ab"],"title":"Job Uuid"},"description":"Optional. Resolve for a specific job (JOB tier); also derives its client and job type."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/job-types":{"get":{"tags":["materiality-thresholds"],"summary":"List job types with override status","description":"List all job types with a per-type override flag, plus whether the firm has an\nORG-level override. Read-only; requires ORG.MATERIALITY_THRESHOLD__ACCESS.","operationId":"list_job_types_api_v1_materiality_thresholds_job_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobTypeListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/organization":{"put":{"tags":["materiality-thresholds"],"summary":"Update organization threshold overrides","description":"Upsert the firm's ORG-level threshold override, emit a decision event, and return the\nre-resolved effective thresholds. Requires ORG.MATERIALITY_THRESHOLD__SET_ORG_TEMPLATE.","operationId":"update_organization_api_v1_materiality_thresholds_organization_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgThresholdsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["materiality-thresholds"],"summary":"Reset organization thresholds to default","description":"Reset the firm's ORG-level threshold override and return the re-resolved effective\nthresholds. With a ``keys`` body only those rows re-inherit the default; without one the\nwhole override is dropped (no-op if none). Emits a decision event.","operationId":"reset_organization_api_v1_materiality_thresholds_organization_delete","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/job-type/{job_type_id}":{"put":{"tags":["materiality-thresholds"],"summary":"Update job-type threshold overrides","description":"Upsert a JOB_TYPE-level threshold override for the firm (404 if the job type doesn't\nexist), emit a decision event, and return the re-resolved effective thresholds.\nRequires ORG.MATERIALITY_THRESHOLD__SET_JOB_TYPE_TEMPLATE.","operationId":"update_job_type_api_v1_materiality_thresholds_job_type__job_type_id__put","parameters":[{"name":"job_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobTypeThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["materiality-thresholds"],"summary":"Reset job-type thresholds to default","description":"Reset the firm's JOB_TYPE-level threshold override and return the re-resolved effective\nthresholds for that job type. With a ``keys`` body only those rows re-inherit the default;\nwithout one the whole override is dropped (no-op if none). Emits a decision event.","operationId":"reset_job_type_api_v1_materiality_thresholds_job_type__job_type_id__delete","parameters":[{"name":"job_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Type Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/client/{client_uuid}":{"put":{"tags":["materiality-thresholds"],"summary":"Update client threshold overrides","description":"Upsert a CLIENT-level threshold override (404 unless the client belongs to the firm),\nemit a decision event, and return the re-resolved effective thresholds for that client.\nRequires CLIENT.MATERIALITY_THRESHOLD__SET_CLIENT_OVERRIDE.","operationId":"update_client_api_v1_materiality_thresholds_client__client_uuid__put","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["materiality-thresholds"],"summary":"Reset client thresholds to default","description":"Reset a CLIENT-level threshold override (404 unless the client belongs to the firm) and\nreturn the re-resolved effective thresholds for that client. With a ``keys`` body only those\nrows re-inherit the default; without one the whole override is reset. Emits a decision event.","operationId":"reset_client_api_v1_materiality_thresholds_client__client_uuid__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/client-type/{client_entity_type_id}":{"put":{"tags":["materiality-thresholds"],"summary":"Update client-type threshold overrides","description":"Upsert a client-type threshold overlay (stored inside the firm's ORG row), emit a\ndecision event, and return the re-resolved effective thresholds for that client type.","operationId":"update_client_type_api_v1_materiality_thresholds_client_type__client_entity_type_id__put","parameters":[{"name":"client_entity_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Entity Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientTypeThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["materiality-thresholds"],"summary":"Reset client-type thresholds to default","description":"Reset a client-type threshold overlay in the firm's ORG row and return the re-resolved\neffective thresholds for that client type. With a ``keys`` body only those rows re-inherit\nthe default; without one the whole overlay is removed (no-op if none). Emits a decision event.","operationId":"reset_client_type_api_v1_materiality_thresholds_client_type__client_entity_type_id__delete","parameters":[{"name":"client_entity_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Entity Type Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/materiality-thresholds/job/{job_uuid}":{"put":{"tags":["materiality-thresholds"],"summary":"Update job threshold overrides","description":"Upsert a JOB-level threshold override (404 unless the job belongs to the firm), emit a\ndecision event, and return the re-resolved effective thresholds for that job.\nRequires JOB.MATERIALITY_THRESHOLD__SET_JOB_OVERRIDE.","operationId":"update_job_api_v1_materiality_thresholds_job__job_uuid__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["materiality-thresholds"],"summary":"Reset job thresholds to default","description":"Reset a JOB-level threshold override (404 unless the job belongs to the firm) and return\nthe re-resolved effective thresholds for that job. With a ``keys`` body only those rows\nre-inherit the default; without one the whole override is reset. Emits a decision event.","operationId":"reset_job_api_v1_materiality_thresholds_job__job_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds":{"get":{"tags":["wp-thresholds"],"summary":"Get effective workpaper thresholds","description":"Resolve the firm's effective workpaper thresholds, optionally scoped to a job type,\nclient type, client, or job (merge order: MASTER -> ORG -> CLIENT_TYPE -> JOB_TYPE ->\nCLIENT -> JOB). Read-only; requires ORG.WP_THRESHOLD__VIEW_TEMPLATE.","operationId":"get_effective_thresholds_api_v1_wp_thresholds_get","parameters":[{"name":"job_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional. Scope resolution to this job type. Ignored when job_uuid is given (the job supplies its own type unless overridden).","examples":[12],"title":"Job Type Id"},"description":"Optional. Scope resolution to this job type. Ignored when job_uuid is given (the job supplies its own type unless overridden)."},{"name":"client_entity_type_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional. Scope resolution to this client-entity type. Honoured only when neither client_uuid nor job_uuid is supplied (a client/job resolves its own entity type from the client row).","examples":[3],"title":"Client Entity Type Id"},"description":"Optional. Scope resolution to this client-entity type. Honoured only when neither client_uuid nor job_uuid is supplied (a client/job resolves its own entity type from the client row)."},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional. Resolve the effective thresholds for this client (404 if not in the firm).","examples":["3f9a8b7c-1d2e-4f5a-9b0c-1a2b3c4d5e6f"],"title":"Client Uuid"},"description":"Optional. Resolve the effective thresholds for this client (404 if not in the firm)."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Optional. Resolve the effective thresholds for this job (404 if not in the firm); takes precedence over client_uuid / client_entity_type_id.","examples":["7c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"],"title":"Job Uuid"},"description":"Optional. Resolve the effective thresholds for this job (404 if not in the firm); takes precedence over client_uuid / client_entity_type_id."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/job-types":{"get":{"tags":["wp-thresholds"],"summary":"List job types with override status","description":"List all job types with a per-type WP override flag, plus whether the firm has an\nORG-level override. Read-only; requires ORG.WP_THRESHOLD__ACCESS.","operationId":"list_job_types_api_v1_wp_thresholds_job_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_JobTypeListResponse___3"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/organization":{"put":{"tags":["wp-thresholds"],"summary":"Update organization WP threshold overrides","description":"Upsert the firm's ORG-level WP threshold override, emit a decision event, and return\nthe re-resolved effective thresholds. Requires ORG.WP_THRESHOLD__SET_ORG_TEMPLATE.","operationId":"update_organization_api_v1_wp_thresholds_organization_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgWpThresholdsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-thresholds"],"summary":"Reset organization WP thresholds to default","description":"Reset the firm's ORG-level WP threshold override and return the re-resolved effective\nthresholds. With a ``keys`` body only those rows re-inherit the default; without one the\nwhole override is dropped (no-op if none). Emits a decision event.","operationId":"reset_organization_api_v1_wp_thresholds_organization_delete","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetWpThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/job-type/{job_type_id}":{"put":{"tags":["wp-thresholds"],"summary":"Update job-type WP threshold overrides","description":"Upsert a JOB_TYPE-level WP threshold override for the firm (404 if the job type doesn't\nexist), emit a decision event, and return the re-resolved effective thresholds.\nRequires ORG.WP_THRESHOLD__SET_JOB_TYPE_TEMPLATE.","operationId":"update_job_type_api_v1_wp_thresholds_job_type__job_type_id__put","parameters":[{"name":"job_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobTypeWpThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-thresholds"],"summary":"Reset job-type WP thresholds to default","description":"Reset the firm's JOB_TYPE-level WP threshold override and return the re-resolved effective\nthresholds for that job type. With a ``keys`` body only those rows re-inherit the default;\nwithout one the whole override is dropped (no-op if none). Emits a decision event.","operationId":"reset_job_type_api_v1_wp_thresholds_job_type__job_type_id__delete","parameters":[{"name":"job_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Type Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetWpThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/client/{client_uuid}":{"put":{"tags":["wp-thresholds"],"summary":"Update client WP threshold overrides","description":"Upsert a CLIENT-level WP threshold override (404 unless the client belongs to the firm),\nemit a decision event, and return the re-resolved effective thresholds for that client.\nRequires CLIENT.MATERIALITY_THRESHOLD__SET_CLIENT_OVERRIDE.","operationId":"update_client_api_v1_wp_thresholds_client__client_uuid__put","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientWpThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-thresholds"],"summary":"Reset client WP thresholds to default","description":"Reset a CLIENT-level WP threshold override (404 unless the client belongs to the firm) and\nreturn the re-resolved effective thresholds for that client. With a ``keys`` body only those\nrows re-inherit the default; without one the whole override is reset. Emits a decision event.","operationId":"reset_client_api_v1_wp_thresholds_client__client_uuid__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetWpThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/client-type/{client_entity_type_id}":{"put":{"tags":["wp-thresholds"],"summary":"Update client-type WP threshold overrides","description":"Upsert a client-type WP threshold overlay (stored inside the firm's ORG row), emit a\ndecision event, and return the re-resolved effective thresholds for that client type.","operationId":"update_client_type_api_v1_wp_thresholds_client_type__client_entity_type_id__put","parameters":[{"name":"client_entity_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Entity Type Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientTypeWpThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-thresholds"],"summary":"Reset client-type WP thresholds to default","description":"Reset a client-type WP threshold overlay in the firm's ORG row and return the re-resolved\neffective thresholds for that client type. With a ``keys`` body only those rows re-inherit the\ndefault; without one the whole overlay is removed (no-op if none). Emits a decision event.","operationId":"reset_client_type_api_v1_wp_thresholds_client_type__client_entity_type_id__delete","parameters":[{"name":"client_entity_type_id","in":"path","required":true,"schema":{"type":"integer","title":"Client Entity Type Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetWpThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-thresholds/job/{job_uuid}":{"put":{"tags":["wp-thresholds"],"summary":"Update job WP threshold overrides","description":"Upsert a JOB-level WP threshold override (404 unless the job belongs to the firm),\nemit a decision event, and return the re-resolved effective thresholds for that job.\nRequires JOB.WP_THRESHOLD__EDIT.","operationId":"update_job_api_v1_wp_thresholds_job__job_uuid__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobWpThresholdsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["wp-thresholds"],"summary":"Reset job WP thresholds to default","description":"Reset a JOB-level WP threshold override (404 unless the job belongs to the firm) and return\nthe re-resolved effective thresholds for that job. With a ``keys`` body only those rows\nre-inherit the default; without one the whole override is reset. Requires JOB.WP_THRESHOLD__DELETE.","operationId":"reset_job_api_v1_wp_thresholds_job__job_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResetWpThresholdsRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EffectiveWpThresholdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}/assignees":{"get":{"tags":["assignments"],"summary":"List teammates assigned to a client","description":"Return the firm teammates currently assigned to the client (uuid, name, email, type).","operationId":"list_client_assignees_api_v1_clients__client_uuid__assignees_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_AssigneeListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["assignments"],"summary":"Assign a teammate to a client","description":"Assign the given user (validated same-firm) to the client; idempotent per user+type.","operationId":"assign_client_api_v1_clients__client_uuid__assignees_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/clients/{client_uuid}/assignees/{user_uuid}":{"delete":{"tags":["assignments"],"summary":"Unassign a teammate from a client","description":"Remove the user's assignment from the client; succeeds even if none exists.","operationId":"unassign_client_api_v1_clients__client_uuid__assignees__user_uuid__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/assignees":{"get":{"tags":["assignments"],"summary":"List teammates assigned to a job","description":"Return the firm teammates currently assigned to the job (uuid, name, email, type).","operationId":"list_job_assignees_api_v1_jobs__job_uuid__assignees_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_AssigneeListResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["assignments"],"summary":"Assign a teammate to a job","description":"Assign the given user (validated same-firm) to the job; idempotent per user+type.","operationId":"assign_job_api_v1_jobs__job_uuid__assignees_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/jobs/{job_uuid}/assignees/{user_uuid}":{"delete":{"tags":["assignments"],"summary":"Unassign a teammate from a job","description":"Remove the user's assignment from the job; succeeds even if none exists.","operationId":"unassign_job_api_v1_jobs__job_uuid__assignees__user_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"user_uuid","in":"path","required":true,"schema":{"type":"string","title":"User Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get the state of a run","description":"The current state of a run (status, steps, summary), read from the\nRunTracker (Redis). 404 when the run is missing/expired OR owned by another\nuser — the same response either way, so a run id reveals nothing across\nusers.","operationId":"get_run_api_v1_runs__run_id__get","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/Envelope_Run_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/workpapers":{"get":{"tags":["workpapers"],"summary":"List workpapers for a job","description":"The workpapers present on a job (from its COA mapping) + each Balance per GL.\n\n``ctx`` lets the dev-portal visibility control (if enabled) hide WPs for this client/firm;\nwith no provider registered nothing is hidden. Each row is then enriched with\nthe studio-sidebar fields (``wp_group`` / ``has_ui`` / recon status).","operationId":"list_workpapers_api_v1_workpapers__job_uuid__workpapers_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/run":{"post":{"tags":["workpapers"],"summary":"Run workpaper automation inline","description":"Run the job's handlers now — only the WPs whose inputs changed (or all, with ``force``); ``wp_codes``\nscopes it to a single workpaper without touching any other WP's delta state.","operationId":"run_automation_api_v1_workpapers_jobs__job_uuid__run_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RunOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/pending":{"get":{"tags":["workpapers"],"summary":"Preview pending changes before a run","description":"The PENDING LIST — what a Run Automation would pick up right now (GL additions/deletions, COA edits,\nand workpapers with newly-extracted *staged* input), WITHOUT triggering a run. Read-only — the user\nreviews this before clicking Run. Extraction stages input into this list; it never auto-runs.","operationId":"pending_changes_api_v1_workpapers_jobs__job_uuid__pending_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PendingChangesOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/doc":{"get":{"tags":["workpapers"],"summary":"Get the full workpaper doc","description":"The ENTIRE stored workpaper doc (all sections), seeded from the template if\nabsent. Each section is augmented with its injected UI Config Block (+\nconfig_version) and the sidebar fields (wp_group / recon status) so the studio\n+ sidebar render every workpaper from this one read. The COA master-config\ngroup map drives each WP's sidebar group (Assets / Liabilities / …).","operationId":"get_full_doc_api_v1_workpapers__job_uuid__doc_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FullDocOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/field":{"get":{"tags":["workpapers"],"summary":"Read workpaper field values","description":"A workpaper's field values (``{field_id: value}`` + recon dsh), or ONE field\nwhen ``field_id`` is given — a light targeted read (vs. the whole doc). field_id\nis ``<row_id>~<col>`` for a table cell, or a summary cell id for a scalar. Same\nauth-only posture as the sibling reads (workpaper RBAC deferred POC-wide).","operationId":"get_workpaper_field_api_v1_workpapers__job_uuid___wp_code__field_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"field_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Read ONE field (``<row_id>~<col>`` for a table cell, or a summary cell id) instead of the whole workpaper; omit to return all field values.","examples":["row_3f2a~gross"],"title":"Field Id"},"description":"Read ONE field (``<row_id>~<col>`` for a table cell, or a summary cell id) instead of the whole workpaper; omit to return all field values."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperFieldValuesOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/prior-doc":{"get":{"tags":["workpapers"],"summary":"Get the prior-year workpaper doc","description":"The linked PRIOR-YEAR job's full workpaper doc, in the SAME shape as\n``/{job}/doc`` so the studio renders it read-only side-by-side. Returns an\nempty doc when no prior job is linked (the UI shows an empty state, never an\nerror). Strictly read-only — no engine run here.","operationId":"get_prior_year_doc_api_v1_workpapers__job_uuid__prior_doc_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PriorDocOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/dashboard":{"get":{"tags":["workpapers"],"summary":"Get the per-job workpaper dashboard","description":"The per-job WORKPAPER DASHBOARD (Z1 ``acc_dashboard_v2`` parity): every\nworkpaper's GL Closing Bal / WP Bal / Variance / reconciled, plus a By-Account\nview and a header summary — both views in one response (tab switch is\nclient-side). Composed from ``coa_gl`` + ``wp_runtime`` + manual journals + notes.","operationId":"workpaper_dashboard_api_v1_workpapers__job_uuid__dashboard_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperDashboardOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/edit-logs":{"get":{"tags":["workpapers"],"summary":"List cell-edit audit logs","description":"Cell-edit audit log for this job — every user-edited value, who changed it, and when.\n\n``wp_code`` filters server-side (reduces payload for large jobs); date-range and\neditor-email filtering are done client-side over the returned rows.","operationId":"get_edit_logs_api_v1_workpapers__job_uuid__edit_logs_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter the audit log to one workpaper server-side; omit for every workpaper on the job.","examples":["EXP"],"title":"Wp Code"},"description":"Filter the audit log to one workpaper server-side; omit for every workpaper on the job."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max rows to return (hard-capped at 500).","default":500,"title":"Limit"},"description":"Max rows to return (hard-capped at 500)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"Rows to skip, for pagination.","default":0,"title":"Offset"},"description":"Rows to skip, for pagination."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EditLogsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}":{"get":{"tags":["workpapers"],"summary":"View a stored workpaper","description":"The STORED filled-template view (hydrated, no recompute).","operationId":"view_workpaper_api_v1_workpapers__job_uuid___wp_code__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["workpapers"],"summary":"Save workpaper edits","description":"Save (edit→save): apply edits/adds/deletes in place, then compute + store once.","operationId":"save_workpaper_api_v1_workpapers__job_uuid___wp_code__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/export":{"post":{"tags":["workpapers"],"summary":"Export a workpaper to PDF","description":"Render the workpaper to a PDF (server-side) and return a download URL.\n\nS3-backed → a presigned GET URL; local-disk dev → a same-origin backend\ndownload route. The CPU-bound render runs off the event loop.","operationId":"export_workpaper_api_v1_workpapers__job_uuid___wp_code__export_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperExportOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/export/download":{"get":{"tags":["workpapers"],"summary":"Download the workpaper PDF","description":"Stream the workpaper PDF bytes inline (used by the local-disk dev backend,\nwhere there is no presigned URL). Re-renders from the current stored view.","operationId":"download_workpaper_pdf_api_v1_workpapers__job_uuid___wp_code__export_download_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"The rendered workpaper PDF, streamed inline.","content":{"application/json":{"schema":{}},"application/pdf":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/copy":{"get":{"tags":["workpapers"],"summary":"Copy the workpaper as clipboard HTML","description":"Return the workpaper as an HTML fragment for the clipboard (the Copy action). Shares the PDF\ndownload's pipeline — same projection + per-WP handler — so Copy and Download stay consistent;\nonly the output format differs. Pastes into Excel/Word/Sheets with tables intact.","operationId":"copy_workpaper_api_v1_workpapers__job_uuid___wp_code__copy_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"The workpaper as an HTML fragment for the clipboard.","content":{"application/json":{"schema":{}},"text/html":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/live-compute":{"post":{"tags":["workpapers"],"summary":"Preview recomputed values without saving","description":"Preview recomputed values after pending edits — does NOT persist.\n\nAccepts the same body as ``PUT /{job_uuid}/{wp_code}`` (``SaveIn``) but applies\nedits to an in-memory copy of the doc and returns the recomputed section WITHOUT\nwriting to the database. Safe to call on every field edit (debounced on the\nfrontend) for live formula preview while in edit mode.","operationId":"live_compute_workpaper_api_v1_workpapers__job_uuid___wp_code__live_compute_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperSectionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/visibility":{"put":{"tags":["workpapers"],"summary":"Hide or show a workpaper","description":"Hide/unhide a workpaper from this job's sidebar (Z1 'hide WP' parity) — flips the\nstored section's ``hidden`` flag, so the sidebar's *Show hidden* toggle governs it.\nAuth-only, matching the rest of this module (workpaper RBAC is deferred — see the\nmodule docstring; add ``@permission_required('workpaper.edit')`` with that pass).","operationId":"set_workpaper_hidden_api_v1_workpapers__job_uuid___wp_code__visibility_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetHiddenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SetHiddenOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/group":{"put":{"tags":["workpapers"],"summary":"Set a workpaper's sidebar group","description":"Move a workpaper to a user-chosen sidebar GROUP for this job (persists a per-job\n``wp_group_override`` on the stored section). Any valid group is allowed, incl. moving\nit INTO 'Workpaper Bank'. A blank/null ``group`` CLEARS the override, reverting the WP\nto its default grouping (auto-move on fill, or the Bank for a ``bank_default`` WP like\nRSV). Auth-only, matching the rest of this module (workpaper RBAC deferred — see the\nmodule docstring).","operationId":"set_workpaper_group_api_v1_workpapers__job_uuid___wp_code__group_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetGroupIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SetGroupOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/favourite":{"put":{"tags":["workpapers"],"summary":"Favourite or unfavourite a workpaper","description":"Favourite/unfavourite a workpaper for this job's sidebar — flips the stored section's\n``favourite`` flag so favourited WPs list together in a pinned section above the category\ngroups (per-job, shared). Auth-only, matching the rest of this module (workpaper RBAC is\ndeferred — see the module docstring).","operationId":"set_workpaper_favourite_api_v1_workpapers__job_uuid___wp_code__favourite_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetFavouriteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SetFavouriteOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/extracted/example":{"get":{"tags":["workpapers"],"summary":"Get the extracted-input example shape","description":"The EXPECTED extracted-JSON input shape for this workpaper (its pack's ``extraction.input_example``)\n— the contract the extractor / Workpapers page targets when POSTing ``.../extracted``. GL/TB-driven\nWPs return an empty example (they take no file input).","operationId":"extracted_input_example_api_v1_workpapers__job_uuid___wp_code__extracted_example_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExtractedInputExampleOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/recompute":{"post":{"tags":["workpapers"],"summary":"Recompute a workpaper's stored rows","description":"Re-run the calc over current stored rows + persist; returns the filled view.","operationId":"recompute_api_v1_workpapers__job_uuid___wp_code__recompute_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/sections/{section_id}/expand":{"patch":{"tags":["workpapers"],"summary":"Toggle a section's expanded state","description":"Guideline #3's per-section \"view all underlying transactions\" toggle (EXP today). Flips\nthe section's collapsed/expanded state and force-reruns the workpaper so the face actually\nchanges. Returns the run result (mirrors the dispatch-run response shape).","operationId":"toggle_section_expand_api_v1_workpapers__job_uuid___wp_code__sections__section_id__expand_patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","title":"Section Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleSectionExpandIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperRunResultOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/rows":{"post":{"tags":["workpapers"],"summary":"Add a line-item row","description":"Add a line-item row (manual entry). Returns the re-filled view.","operationId":"add_row_api_v1_workpapers__job_uuid___wp_code__rows_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/rows/{row_id}":{"patch":{"tags":["workpapers"],"summary":"Edit one cell of a row","description":"Edit one cell of a line-item row (locks the cell against handler reruns).","operationId":"update_cell_api_v1_workpapers__job_uuid___wp_code__rows__row_id__patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCellIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["workpapers"],"summary":"Delete a line-item row","description":"Remove a line-item row. Returns the re-filled view.","operationId":"delete_row_api_v1_workpapers__job_uuid___wp_code__rows__row_id__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/rows/{row_id}/restore-extracted":{"post":{"tags":["workpapers"],"summary":"Restore extracted values on a row","description":"Toggle a cell (or whole row, or scalar) back to its preserved EXTRACTED value, dropping the\nmanual override. ``cols`` empty ⇒ restore every overridden cell on the row. Returns the recomputed view.","operationId":"restore_extracted_api_v1_workpapers__job_uuid___wp_code__rows__row_id__restore_extracted_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreExtractedIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/edit-session/start":{"post":{"tags":["workpapers"],"summary":"Start an edit session (placeholder)","description":"PLACEHOLDER (Z1 parity): no real lock in Z2 — returns a synthetic session.","operationId":"start_edit_session_api_v1_workpapers__job_uuid___wp_code__edit_session_start_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EditSessionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/edit-session/lock-status":{"get":{"tags":["workpapers"],"summary":"Get edit-session lock status","description":"PLACEHOLDER (Z1 parity): Z2 has no edit lock — always unlocked.","operationId":"edit_lock_status_api_v1_workpapers__job_uuid___wp_code__edit_session_lock_status_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EditLockStatusOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/edit-session/compute":{"post":{"tags":["workpapers"],"summary":"Apply edits and recompute (Z1 parity)","description":"Z1-parity compute: apply edits, recompute (calc-engine) + store, return the view.\n(Z1 returned an ephemeral delta; Z2 recomputes + persists, which is a superset.)","operationId":"compute_edit_api_v1_workpapers__job_uuid___wp_code__edit_session_compute_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkpaperViewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/{wp_code}/edit-session/discard":{"post":{"tags":["workpapers"],"summary":"Discard an edit session (placeholder)","description":"PLACEHOLDER (Z1 parity): nothing server-side to discard (edits are client-local).","operationId":"discard_edit_session_api_v1_workpapers__job_uuid___wp_code__edit_session_discard_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EditSessionStatusOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/{job_uuid}/extract/{wp_code}":{"post":{"tags":["workpapers"],"summary":"Dispatch a document extraction run","description":"Dispatch a document → workpaper data extraction (202 + run_id).\nRefused (409) while the workpaper is approved or the job signed off.","operationId":"extract_workpaper_api_v1_workpapers__job_uuid__extract__wp_code__post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DispatchOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/runs":{"post":{"tags":["workpapers"],"summary":"Dispatch an async automation run","description":"Dispatch the Run-automation ASYNC (202 {run_id}): the agent tier claims +\nruns the fresh-data pipeline — inline Xero delta sync → job documents rebuild\n→ workpapers — and the client watches the stage progress on the\n``run:<run_id>`` WS topic (the studio's run-progress dock). Sync/build\nproblems degrade to a warning stage; the workpapers still run. The inline\n``/jobs/{job}/run`` remains for immediate-feedback runs (no sync stage).","operationId":"dispatch_run_api_v1_workpapers_jobs__job_uuid__runs_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkpaperRunIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DispatchOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/{code}/lineage":{"get":{"tags":["workpapers"],"summary":"Get the whole-workpaper lineage graph","description":"Whole-workpaper lineage graph for the Data Lineage Explorer — the union of every\ntraceable field's derivation tree (one DAG), derived dynamically from the engine\nformula map + this job's stored doc. Same auth-only + firm-scoped posture as the\nper-field route below.","operationId":"get_job_wp_lineage_api_v1_workpapers_jobs__job_uuid___code__lineage_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","description":"Max derivation-tree depth to expand (clamped 1–12).","default":8,"title":"Depth"},"description":"Max derivation-tree depth to expand (clamped 1–12)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineageDetailOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/{code}/lineage/{field_id}":{"get":{"tags":["workpapers"],"summary":"Get one field's lineage detail","description":"Traceable Value payload for the studio lineage drawer/explorer — derived\nDYNAMICALLY from the engine formula map + THIS job's stored doc (calculation\nDAG, GL accounts, source files). One level deep; the UI drills via each node's\n``fieldRef`` (recursive \"total of totals\", crossing workpapers on a {WP:} ref).\n\nAuth-only, consistent with the rest of this module (workpaper ``LINEAGE_VIEW``\nenforcement is deferred POC-wide — see ``rbac.py`` + the module docstring).\n``ctx.firm_id`` scopes the GL/file reads to the caller's firm.","operationId":"get_job_lineage_api_v1_workpapers_jobs__job_uuid___code__lineage__field_id__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"field_id","in":"path","required":true,"schema":{"type":"string","title":"Field Id"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","description":"Max derivation-tree depth to expand (clamped 1–12).","default":8,"title":"Depth"},"description":"Max derivation-tree depth to expand (clamped 1–12)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineageDetailOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/{code}/gl-account-transactions":{"get":{"tags":["workpapers"],"summary":"Page one GL account's transactions","description":"Lazy, date-sorted + paginated full ledger of ONE GL account behind the lineage\n\"view all\" expander. ``focus_gl_id`` opens on the page holding the traced row's\ncontributing line. Auth-only + firm-scoped, like the lineage route above.","operationId":"get_lineage_account_transactions_api_v1_workpapers_jobs__job_uuid___code__gl_account_transactions_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"account_code","in":"query","required":true,"schema":{"type":"string","description":"The GL account code whose transactions to page (required).","examples":["6-1000"],"title":"Account Code"},"description":"The GL account code whose transactions to page (required)."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"0-indexed page number.","default":0,"title":"Page"},"description":"0-indexed page number."},{"name":"size","in":"query","required":false,"schema":{"type":"integer","description":"Page size (clamped 1–200).","default":25,"title":"Size"},"description":"Page size (clamped 1–200)."},{"name":"focus_gl_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Open on the page holding this GL line id (the traced contributing row).","title":"Focus Gl Id"},"description":"Open on the page holding this GL line id (the traced contributing row)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AccountTransactionsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/ppm/gl-assist":{"get":{"tags":["workpapers"],"summary":"PPM GL-Assist: candidate prepayment accounts + transactions","description":"The PPM General-Ledger method (User Stories): scan the job's current-year GL for **Expense**\naccounts whose name contains a prepayment keyword and return each one's transactions plus the five\nprepayment categories. ``has_matches`` drives the studio Yes/No notification; the user then picks\ntransactions + keys the service dates, which the studio saves into the PPM ``D.4`` table.\nAuth-only + firm-scoped (like the GL-account-transactions route).","operationId":"get_ppm_gl_assist_api_v1_workpapers_jobs__job_uuid__ppm_gl_assist_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"keywords","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated expense-name keywords to match (default: rent,insurance,lease,interest,subscription).","examples":["rent,insurance,lease,interest,subscription"],"title":"Keywords"},"description":"Comma-separated expense-name keywords to match (default: rent,insurance,lease,interest,subscription)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PpmGlAssistOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpapers/jobs/{job_uuid}/reset":{"delete":{"tags":["workpapers"],"summary":"Reset a job's workpaper state","description":"Reset a job for a clean re-run: wipe its generated workpaper state +\nmanual-journal data, and (when ``delete_files``) the job's uploaded source\nfiles and/or (when ``delete_tb``) its trial balance. COA mappings\n(client-level) are deliberately left intact.","operationId":"reset_job_workpapers_api_v1_workpapers_jobs__job_uuid__reset_delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"delete_files","in":"query","required":false,"schema":{"type":"boolean","description":"Also delete the job's uploaded source files.","default":false,"title":"Delete Files"},"description":"Also delete the job's uploaded source files."},{"name":"delete_tb","in":"query","required":false,"schema":{"type":"boolean","description":"Also delete the job's trial balance.","default":false,"title":"Delete Tb"},"description":"Also delete the job's trial balance."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResetJobOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/get_by_workpaper/{job_uuid}/{client_uuid}":{"get":{"tags":["notes"],"summary":"List notes for a job's workpapers","description":"All notes for the job's workpapers (optionally one WP, optionally one cell),\ngrouped by WP. `cell_field_id` scopes to a single cell of the workpaper.","operationId":"get_by_workpaper_api_v1_notes_get_by_workpaper__job_uuid___client_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"workpaper_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional WP code to scope the list to a single workpaper; omit to return notes across all of the job's workpapers.","examples":["EXP"],"title":"Workpaper Code"},"description":"Optional WP code to scope the list to a single workpaper; omit to return notes across all of the job's workpapers."},{"name":"cell_field_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional cell / doc field id to scope to one cell's notes; omit for WP-level (or all-cell) notes.","examples":["EXP.D.0"],"title":"Cell Field Id"},"description":"Optional cell / doc field id to scope to one cell's notes; omit for WP-level (or all-cell) notes."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NotesListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/create_note/{job_uuid}/{client_uuid}":{"post":{"tags":["notes"],"summary":"Create a workpaper note","description":"Insert a NEW note for the workpaper (never upserts an existing one).\n`cell_field_id` links the note to a specific cell (doc `_id`); omit for a\nworkpaper-level note.","operationId":"create_note_api_v1_notes_create_note__job_uuid___client_uuid__post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_note_api_v1_notes_create_note__job_uuid___client_uuid__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NoteOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/update_content/{job_uuid}/{client_uuid}":{"put":{"tags":["notes"],"summary":"Update a note's content","description":"Edit a single note's content / add attachments (author only).","operationId":"update_content_api_v1_notes_update_content__job_uuid___client_uuid__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_content_api_v1_notes_update_content__job_uuid___client_uuid__put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NoteOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/delete_note/{note_uuid}":{"put":{"tags":["notes"],"summary":"Delete a note or attachment","description":"Soft-delete a whole note (`delete_note=true`) or one attachment (author only).\nFirm ownership of the note's job is enforced in the service (no job_uuid here).","operationId":"delete_note_api_v1_notes_delete_note__note_uuid__put","parameters":[{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}},{"name":"delete_note","in":"query","required":false,"schema":{"type":"boolean","description":"true = soft-delete the whole note; false = remove a single attachment (then `file_uuid` is required).","examples":[true],"default":false,"title":"Delete Note"},"description":"true = soft-delete the whole note; false = remove a single attachment (then `file_uuid` is required)."},{"name":"file_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ZBox file id of the attachment to remove. Required when `delete_note=false` (single-attachment removal); ignored for a whole-note delete.","examples":["8b3d2f1a-6c4e-4a2b-9f0d-1e2c3d4b5a6f"],"title":"File Uuid"},"description":"ZBox file id of the attachment to remove. Required when `delete_note=false` (single-attachment removal); ignored for a whole-note delete."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NoteDeleteResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/pin/{note_uuid}":{"put":{"tags":["notes"],"summary":"Pin or unpin a note","description":"Pin / unpin a note (pinned notes sort first). Firm-scoped via the service.","operationId":"pin_note_api_v1_notes_pin__note_uuid__put","parameters":[{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}},{"name":"pinned","in":"query","required":true,"schema":{"type":"boolean","description":"Required. true = pin the note (sorts first); false = unpin.","examples":[true],"title":"Pinned"},"description":"Required. true = pin the note (sorts first); false = unpin."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NoteOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/mark_as_read/{job_uuid}":{"put":{"tags":["notes"],"summary":"Mark a workpaper's notes read","description":"Mark the current user read across all of the WP's notes.","operationId":"mark_as_read_api_v1_notes_mark_as_read__job_uuid__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"workpaper_code","in":"query","required":true,"schema":{"type":"string","description":"Required. WP code whose notes are marked read for the current user.","examples":["EXP"],"title":"Workpaper Code"},"description":"Required. WP code whose notes are marked read for the current user."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarkReadResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/notes/users_dropdown/{org_id}":{"get":{"tags":["notes"],"summary":"List firm users for mentions","description":"Firm users for the @-mention picker (firm-scoped via ctx, not org_id).","operationId":"users_dropdown_api_v1_notes_users_dropdown__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UsersDropdownOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/review/points/{job_uuid}":{"get":{"tags":["review"],"summary":"List review/brief points for a job","description":"All point threads for the job (optionally one WP / one cell / one\nstatus / brief-vs-review), newest first, responses in thread order.","operationId":"list_points_api_v1_review_points__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"workpaper_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one workpaper's points.","examples":["FIA"],"title":"Workpaper Code"},"description":"Filter to one workpaper's points."},{"name":"cell_field_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to points on one workpaper cell.","examples":["FIA.12"],"title":"Cell Field Id"},"description":"Filter to points on one workpaper cell."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by review status: open | responded | accepted.","examples":["open"],"title":"Status"},"description":"Filter by review status: open | responded | accepted."},{"name":"point_kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by kind: brief | review.","examples":["review"],"title":"Point Kind"},"description":"Filter by kind: brief | review."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["review"],"summary":"Raise a review/brief point","description":"Raise a point against the job's workpaper (or one cell). The brief-vs-\nreview classification is stamped from the job's automation-run state (BR-3).","operationId":"create_point_api_v1_review_points__job_uuid__post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_point_api_v1_review_points__job_uuid__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/points/{job_uuid}/{note_uuid}/respond":{"post":{"tags":["review"],"summary":"Answer a review point","description":"Append a threaded response to the point (accountant/director — BR-4/BR-5);\nthe point moves to `responded` and its author is notified.","operationId":"respond_point_api_v1_review_points__job_uuid___note_uuid__respond_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_respond_point_api_v1_review_points__job_uuid___note_uuid__respond_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/points/{job_uuid}/{note_uuid}/accept":{"post":{"tags":["review"],"summary":"Accept (clear) a review point","description":"The reviewer is satisfied — the point is cleared (`accepted`); idempotent.","operationId":"accept_point_api_v1_review_points__job_uuid___note_uuid__accept_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/points/{job_uuid}/{note_uuid}/follow-up":{"post":{"tags":["review"],"summary":"Raise a follow-up point","description":"The answer wasn't satisfactory (BR-7): clears the predecessor and chains\na new open point to it.","operationId":"follow_up_point_api_v1_review_points__job_uuid___note_uuid__follow_up_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_follow_up_point_api_v1_review_points__job_uuid___note_uuid__follow_up_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/points/{job_uuid}/{note_uuid}":{"put":{"tags":["review"],"summary":"Edit an unanswered review point","description":"Author-only in-place edit, allowed until the point receives a response\n(BR-21); afterwards it returns 409 POINT_HAS_RESPONSE.","operationId":"update_point_api_v1_review_points__job_uuid___note_uuid__put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_update_point_api_v1_review_points__job_uuid___note_uuid__put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/points/{job_uuid}/{note_uuid}/delete":{"put":{"tags":["review"],"summary":"Delete an unanswered review point","description":"Author-only soft-delete, same BR-21 window as edit.","operationId":"delete_point_api_v1_review_points__job_uuid___note_uuid__delete_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"note_uuid","in":"path","required":true,"schema":{"type":"string","title":"Note Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/approvals":{"get":{"tags":["review"],"summary":"List a job's workpaper approvals","description":"Per-WP approval status + open point/query counts + the BR-9 gate verdict,\nincluding run-generated WPs nobody has reviewed yet (pending).","operationId":"list_approvals_api_v1_review_jobs__job_uuid__approvals_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/workpapers/{wp_code}/log":{"get":{"tags":["review"],"summary":"Get a workpaper's approval log","description":"Timestamped approve/unapprove/reject/changes-detected history (BR-10),\nnewest first, visible to all job viewers.","operationId":"approval_log_api_v1_review_jobs__job_uuid__workpapers__wp_code__log_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/workpapers/{wp_code}/approve":{"post":{"tags":["review"],"summary":"Approve a workpaper","description":"Approve (BR-9 gate-checked: 409 APPROVAL_GATE_OPEN_ITEMS while any point\nor query on the WP is open). Approval edit-locks the workpaper (BR-11).","operationId":"approve_wp_api_v1_review_jobs__job_uuid__workpapers__wp_code__approve_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApprovalActionIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/workpapers/{wp_code}/unapprove":{"post":{"tags":["review"],"summary":"Unapprove a workpaper","description":"Revert an approved WP to open/neutral — NOT a rejection (BR-22).","operationId":"unapprove_wp_api_v1_review_jobs__job_uuid__workpapers__wp_code__unapprove_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApprovalActionIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/workpapers/{wp_code}/reject":{"post":{"tags":["review"],"summary":"Reject a workpaper","description":"Reject — returns the WP to the accountant and re-opens editing (BR-12).","operationId":"reject_wp_api_v1_review_jobs__job_uuid__workpapers__wp_code__reject_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApprovalActionIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/approvals/bulk":{"post":{"tags":["review"],"summary":"Bulk approve/unapprove/reject workpapers","description":"BR-22: apply one action to a multi-select. Bulk approve gate-checks each\nWP (partial success — failures carry their open counts); always 200.","operationId":"bulk_approvals_api_v1_review_jobs__job_uuid__approvals_bulk_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApprovalIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/lifecycle":{"post":{"tags":["review"],"summary":"Move a job between review stages","description":"Pre-sign-off stage moves + reverts (BR-24). `mark_ready_for_signoff`\nrequires every workpaper approved; everything is blocked once signed.","operationId":"job_lifecycle_api_v1_review_jobs__job_uuid__lifecycle_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LifecycleIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/in-review-readiness":{"get":{"tags":["review"],"summary":"Whether a Processed job can move to In Review","description":"Readiness for the 'Mark as Ready for Review' action: returns the current\nstatus, open-query + pending-review-point counts, and `ready` (Processed with\nboth at zero). Drives the button's enabled state; the transition re-checks.","operationId":"in_review_readiness_api_v1_review_jobs__job_uuid__in_review_readiness_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/review-completed-readiness":{"get":{"tags":["review"],"summary":"Whether an In Review job can move to Ready For Sign Off","description":"Readiness for the 'Ready for Sign Off' action: returns the current status,\napproved/total workpaper counts, and `ready` (In Review with every workpaper\naccepted). Drives the button's enabled state; the transition re-checks.","operationId":"review_completed_readiness_api_v1_review_jobs__job_uuid__review_completed_readiness_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/sign-off":{"post":{"tags":["review"],"summary":"Director sign-off of a job","description":"One-click director sign-off (BR-15/BR-23): requires ready-to-sign + every\nworkpaper approved (re-checked server-side). Locks the whole job (BR-18).","operationId":"sign_off_job_api_v1_review_jobs__job_uuid__sign_off_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/sign-off/reject":{"post":{"tags":["review"],"summary":"Director rejects a job at sign-off","description":"Superior-authority reject (BR-16): the job returns to in-review and the\nwhole job team is alerted by bell + email (BR-17).","operationId":"reject_sign_off_api_v1_review_jobs__job_uuid__sign_off_reject_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CommentsIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/review/jobs/{job_uuid}/sign-off/revoke":{"post":{"tags":["review"],"summary":"Director revokes a signed-off job","description":"Director-only, NON-destructive revoke (BR-19/BR-20): re-opens the job for\neveryone without discarding any work.","operationId":"revoke_sign_off_api_v1_review_jobs__job_uuid__sign_off_revoke_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CommentsIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workpaper-studio/definitions":{"get":{"tags":["workpaper-studio"],"summary":"List the workpaper definition catalogue","description":"Every workpaper the run set knows — bundled file packs ∪ portal-authored DB definitions —\neach marked source/status/editable/has_hooks/in_run_set/hidden.","operationId":"list_definitions_api_v1_workpaper_studio_definitions_get","parameters":[{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional country filter (e.g. NZ, AU); omit for all countries.","examples":["NZ"],"title":"Country"},"description":"Optional country filter (e.g. NZ, AU); omit for all countries."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CatalogueOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["workpaper-studio"],"summary":"Create or version-bump a definition","description":"Create or version-bump a definition (mints/bumps + history + audit). ``publish=true`` also\nenters it into the run set when valid.","operationId":"save_definition_api_v1_workpaper_studio_definitions_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveDefinitionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SaveDefinitionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/new":{"get":{"tags":["workpaper-studio"],"summary":"Scaffold a blank workpaper definition","description":"A blank, valid Definition scaffold to seed the Create wizard (one table, no sources).","operationId":"scaffold_definition_api_v1_workpaper_studio_definitions_new_get","parameters":[{"name":"wp_code","in":"query","required":true,"schema":{"type":"string","description":"Workpaper code to scaffold — UPPER_SNAKE, 2-40 chars, starts with a letter.","examples":["OCA"],"title":"Wp Code"},"description":"Workpaper code to scaffold — UPPER_SNAKE, 2-40 chars, starts with a letter."},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country pack for the new WP; omit for the active portal's country.","examples":["NZ"],"title":"Country"},"description":"Country pack for the new WP; omit for the active portal's country."},{"name":"wp_name","in":"query","required":false,"schema":{"type":"string","description":"Optional human-readable WP name; defaults to wp_code.","examples":["Other Current Assets"],"default":"","title":"Wp Name"},"description":"Optional human-readable WP name; defaults to wp_code."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ScaffoldOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-id/{config_uuid}":{"get":{"tags":["workpaper-studio"],"summary":"Get a definition by id","description":"One definition envelope (definition + summary) by config UUID; nulls when not found.","operationId":"get_definition_by_id_api_v1_workpaper_studio_definitions_by_id__config_uuid__get","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DefinitionEnvelopeOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["workpaper-studio"],"summary":"Delete a definition","description":"Delete a portal-authored definition by config UUID; ``ok=false`` when not found.","operationId":"delete_definition_api_v1_workpaper_studio_definitions_by_id__config_uuid__delete","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-id/{config_uuid}/versions":{"get":{"tags":["workpaper-studio"],"summary":"List a definition's versions","description":"The saved version history of one definition.","operationId":"list_versions_api_v1_workpaper_studio_definitions_by_id__config_uuid__versions_get","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VersionsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-code/{wp_code}":{"get":{"tags":["workpaper-studio"],"summary":"Get a definition by workpaper code","description":"Hydrate an existing WP for editing — a DB definition, else a bundled file pack (read-only-derived).","operationId":"get_definition_by_code_api_v1_workpaper_studio_definitions_by_code__wp_code__get","parameters":[{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country pack of the WP to hydrate; omit for the active portal's country.","examples":["NZ"],"title":"Country"},"description":"Country pack of the WP to hydrate; omit for the active portal's country."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DefinitionEnvelopeOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/validate":{"post":{"tags":["workpaper-studio"],"summary":"Validate a definition without saving","description":"Dry-run the layered validation pipeline (no persistence); returns issues + the normalized form.","operationId":"validate_definition_route_api_v1_workpaper_studio_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkpaperDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ValidationResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-id/{config_uuid}/publish":{"post":{"tags":["workpaper-studio"],"summary":"Publish a definition","description":"Publish the definition into the run set; ``published=false`` when validation fails.","operationId":"publish_definition_api_v1_workpaper_studio_definitions_by_id__config_uuid__publish_post","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SaveDefinitionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-id/{config_uuid}/unpublish":{"post":{"tags":["workpaper-studio"],"summary":"Unpublish a definition","description":"Remove the definition from the run set; ``ok=false`` when it isn't found.","operationId":"unpublish_definition_api_v1_workpaper_studio_definitions_by_id__config_uuid__unpublish_post","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/definitions/by-id/{config_uuid}/restore/{version}":{"post":{"tags":["workpaper-studio"],"summary":"Restore a definition version","description":"Restore an historical version as a new draft (does not publish it).","operationId":"restore_version_api_v1_workpaper_studio_definitions_by_id__config_uuid__restore__version__post","parameters":[{"name":"config_uuid","in":"path","required":true,"schema":{"type":"string","title":"Config Uuid"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SaveDefinitionOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/preview":{"post":{"tags":["workpaper-studio"],"summary":"Preview a definition in memory","description":"Compute a candidate WP in memory (calc-engine) — never touches a stored job doc.","operationId":"preview_definition_api_v1_workpaper_studio_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PreviewOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/guidelines/by-code/{wp_code}":{"put":{"tags":["workpaper-studio"],"summary":"Set a workpaper's guidelines","description":"Set a WP's guidelines markdown — works for ANY workpaper (a file pack with no DB row gets a\nminted guidelines-only row; it never enters the run set).","operationId":"set_guidelines_api_v1_workpaper_studio_guidelines_by_code__wp_code__put","parameters":[{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country pack of the WP; omit for the active portal's country.","examples":["NZ"],"title":"Country"},"description":"Country pack of the WP; omit for the active portal's country."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidelinesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/visibility":{"get":{"tags":["workpaper-studio"],"summary":"List visibility overrides","description":"The stored per-scope visibility overrides, optionally filtered by country.","operationId":"list_visibility_api_v1_workpaper_studio_visibility_get","parameters":[{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional country filter; omit for all countries.","examples":["NZ"],"title":"Country"},"description":"Optional country filter; omit for all countries."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VisibilityListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["workpaper-studio"],"summary":"Set a visibility override","description":"Hide/show a WP for a platform/firm/client scope. A hidden WP drops out of the catalogue + run set.","operationId":"set_visibility_api_v1_workpaper_studio_visibility_put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisibilityIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VisibilityItem_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["workpaper-studio"],"summary":"Clear a visibility override","description":"Delete one (wp_code, country, scope, scope_id) visibility override — the WP\nreverts to its default visibility for that scope.","operationId":"clear_visibility_api_v1_workpaper_studio_visibility_delete","parameters":[{"name":"wp_code","in":"query","required":true,"schema":{"type":"string","description":"Workpaper code whose visibility override to clear.","examples":["OCA"],"title":"Wp Code"},"description":"Workpaper code whose visibility override to clear."},{"name":"scope","in":"query","required":true,"schema":{"type":"string","description":"Scope of the override to clear: platform, firm, or client.","examples":["platform"],"title":"Scope"},"description":"Scope of the override to clear: platform, firm, or client."},{"name":"scope_id","in":"query","required":false,"schema":{"type":"string","description":"Firm/client id of the override; empty for the platform scope.","default":"","title":"Scope Id"},"description":"Firm/client id of the override; empty for the platform scope."},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country pack of the WP; omit for the active portal's country.","examples":["NZ"],"title":"Country"},"description":"Country pack of the WP; omit for the active portal's country."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workpaper-studio/registry/reload":{"post":{"tags":["workpaper-studio"],"summary":"Reload published definitions into the run set","description":"Re-register every published DB definition into the run set (publish-without-deploy\nafter a restart); returns the published count.","operationId":"reload_registry_api_v1_workpaper_studio_registry_reload_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReloadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/tenants/{xero_tenant_uuid}/resync":{"post":{"tags":["xero","xero"],"summary":"Resync tenant raw materials","description":"Re-fetch a tenant's raw materials (delta by default, full re-baseline on\ndemand). Returns the dispatched run_id; progress streams on\n``xero_tenant_sync:<xero_tenant_uuid>``.","operationId":"resync_tenant_api_v1_xero_tenants__xero_tenant_uuid__resync_post","parameters":[{"name":"xero_tenant_uuid","in":"path","required":true,"schema":{"type":"string","title":"Xero Tenant Uuid"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","pattern":"^(delta|full)$","default":"delta","title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resync Tenant Api V1 Xero Tenants  Xero Tenant Uuid  Resync Post","$ref":"#/components/schemas/ResyncDispatchResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/raw-status":{"get":{"tags":["xero","xero"],"summary":"Get raw import status","description":"Per-resource raw-import watermark for the client's bound tenant.","operationId":"raw_status_api_v1_xero_clients__client_uuid__raw_status_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Raw Status Api V1 Xero Clients  Client Uuid  Raw Status Get","$ref":"#/components/schemas/RawStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/general-ledger":{"get":{"tags":["xero","xero"],"summary":"Get general ledger for job","description":"Return a job's general ledger rows with paging, filters, and debit/credit totals.\n\nAccrual (default) reads v_gl_combined (GL + posted Zato MJs); 'cash' basis and\nsource='manual' read the raw general_ledger table.","operationId":"general_ledger_for_job_api_v1_xero_jobs__job_uuid__general_ledger_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with entry_date >= start_date.","title":"Start Date"},"description":"Filter rows with entry_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with entry_date <= end_date.","title":"End Date"},"description":"Filter rows with entry_date <= end_date."},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Restrict to these account codes.","title":"Account Code"},"description":"Restrict to these account codes."},{"name":"source","in":"query","required":false,"schema":{"type":"string","description":"'xero'/'all' (default) use v_gl_combined (GL + posted Zato MJs). 'manual' uses raw table for uploaded files only.","default":"xero","title":"Source"},"description":"'xero'/'all' (default) use v_gl_combined (GL + posted Zato MJs). 'manual' uses raw table for uploaded files only."},{"name":"gl_year","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Restrict to one gl_year (e.g. last year). Omitted → all years.","title":"Gl Year"},"description":"Restrict to one gl_year (e.g. last year). Omitted → all years."},{"name":"basis","in":"query","required":false,"schema":{"type":"string","description":"'invoice' (accrual, default) or 'cash' — cash keeps/scales invoice-backed lines by in-period settlement.","default":"invoice","title":"Basis"},"description":"'invoice' (accrual, default) or 'cash' — cash keeps/scales invoice-backed lines by in-period settlement."},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Page size (lazy scroll).","title":"Limit"},"description":"Page size (lazy scroll)."},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Rows already loaded.","title":"Offset"},"description":"Rows already loaded."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response General Ledger For Job Api V1 Xero Jobs  Job Uuid  General Ledger Get","$ref":"#/components/schemas/JobGeneralLedgerResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/gst-ledger":{"get":{"tags":["xero","xero"],"summary":"Get GST ledger for job","description":"The Xero GST control account's ledger for a job, in period/date order.","operationId":"gst_ledger_for_job_api_v1_xero_jobs__job_uuid__gst_ledger_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with entry_date >= start_date.","title":"Start Date"},"description":"Filter rows with entry_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with entry_date <= end_date.","title":"End Date"},"description":"Filter rows with entry_date <= end_date."},{"name":"basis","in":"query","required":false,"schema":{"type":"string","description":"GST basis: 'invoice' (accrual, default) or 'cash'.","default":"invoice","title":"Basis"},"description":"GST basis: 'invoice' (accrual, default) or 'cash'."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Gst Ledger For Job Api V1 Xero Jobs  Job Uuid  Gst Ledger Get","$ref":"#/components/schemas/JobGstLedgerResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/aged-payables":{"get":{"tags":["xero","xero"],"summary":"Get aged payables for job","description":"Return stored aged-payables rows for the job, optionally filtered by as_of_date.","operationId":"aged_payables_for_job_api_v1_xero_jobs__job_uuid__aged_payables_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with as_of_date >= start_date.","title":"Start Date"},"description":"Filter rows with as_of_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with as_of_date <= end_date.","title":"End Date"},"description":"Filter rows with as_of_date <= end_date."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Aged Payables For Job Api V1 Xero Jobs  Job Uuid  Aged Payables Get","$ref":"#/components/schemas/JobAgedResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/aged-receivables":{"get":{"tags":["xero","xero"],"summary":"Get aged receivables for job","description":"Return stored aged-receivables rows for the job, optionally filtered by as_of_date.","operationId":"aged_receivables_for_job_api_v1_xero_jobs__job_uuid__aged_receivables_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with as_of_date >= start_date.","title":"Start Date"},"description":"Filter rows with as_of_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter rows with as_of_date <= end_date.","title":"End Date"},"description":"Filter rows with as_of_date <= end_date."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Aged Receivables For Job Api V1 Xero Jobs  Job Uuid  Aged Receivables Get","$ref":"#/components/schemas/JobAgedResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/reports-summary":{"get":{"tags":["xero","xero"],"summary":"Get job documents summary","description":"Docs overview — the latest version of each financial document for the job.","operationId":"reports_summary_for_job_api_v1_xero_jobs__job_uuid__reports_summary_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reports Summary For Job Api V1 Xero Jobs  Job Uuid  Reports Summary Get","$ref":"#/components/schemas/JobReportsSummaryResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/reports/{report_type}/versions":{"get":{"tags":["xero","xero"],"summary":"List report versions","description":"All snapshot versions of a report for a job, newest first.","operationId":"list_report_versions_api_v1_xero_jobs__job_uuid__reports__report_type__versions_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"report_type","in":"path","required":true,"schema":{"type":"string","title":"Report Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Report Versions Api V1 Xero Jobs  Job Uuid  Reports  Report Type  Versions Get","$ref":"#/components/schemas/ReportVersionsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/reports/{report_type}/versions/{version_no}/download":{"get":{"tags":["xero","xero"],"summary":"Download a report version","description":"Download one specific snapshot version (version-pinned S3 object).","operationId":"download_report_version_api_v1_xero_jobs__job_uuid__reports__report_type__versions__version_no__download_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"report_type","in":"path","required":true,"schema":{"type":"string","title":"Report Type"}},{"name":"version_no","in":"path","required":true,"schema":{"type":"integer","title":"Version No"}}],"responses":{"200":{"description":"The report version's XLSX bytes, or a redirect to a version-pinned presigned S3 URL.","content":{"application/json":{"schema":{}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/gl/versions":{"get":{"tags":["xero","xero"],"summary":"List stored GL versions","description":"Back-compat alias — all general_ledger snapshot versions for a job, newest first.","operationId":"list_gl_versions_api_v1_xero_jobs__job_uuid__gl_versions_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Gl Versions Api V1 Xero Jobs  Job Uuid  Gl Versions Get","$ref":"#/components/schemas/ReportVersionsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/gl/versions/{version_no}/download":{"get":{"tags":["xero","xero"],"summary":"Download a GL version","description":"Back-compat alias — download one general_ledger snapshot version (xlsx bytes\nlocally, or a redirect to a version-pinned presigned S3 URL).","operationId":"download_gl_version_api_v1_xero_jobs__job_uuid__gl_versions__version_no__download_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"version_no","in":"path","required":true,"schema":{"type":"integer","title":"Version No"}}],"responses":{"200":{"description":"The report version's XLSX bytes, or a redirect to a version-pinned presigned S3 URL.","content":{"application/json":{"schema":{}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/trial-balance":{"get":{"tags":["xero","xero"],"summary":"Stored trial balance for a client","description":"Stored Trial Balance rows for the client (Xero-synced and/or manual uploads),\nfiltered by date range, account codes and source. Returns rows plus YTD totals.","operationId":"trial_balance_for_client_api_v1_xero_clients__client_uuid__trial_balance_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional. Only rows with balance_date >= start_date.","title":"Start Date"},"description":"Optional. Only rows with balance_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional. Only rows with balance_date <= end_date.","title":"End Date"},"description":"Optional. Only rows with balance_date <= end_date."},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Optional. Restrict to these account codes (repeatable).","title":"Account Code"},"description":"Optional. Restrict to these account codes (repeatable)."},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"None = all rows; 'xero' = synced only; 'manual' = uploaded only.","title":"Source"},"description":"None = all rows; 'xero' = synced only; 'manual' = uploaded only."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trial Balance For Client Api V1 Xero Clients  Client Uuid  Trial Balance Get","$ref":"#/components/schemas/ClientTrialBalanceResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/general-ledger-live":{"get":{"tags":["xero","xero"],"summary":"Build live GL via engine","description":"Build the GL on the fly from synced journals via the Rust engine (no store).\n\nCalls the engine's job-optional build endpoint; nothing is written to the\ngeneral_ledger table — the rows are computed and returned per request. With\none or more ``account_code`` values the engine drills into just those accounts;\nwith none it builds the whole ledger (``account_codes: []`` ⇒ entire GL).","operationId":"general_ledger_live_api_v1_xero_clients__client_uuid__general_ledger_live_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional period start (entry_date >= start_date). Enables opening-balance sync.","title":"Start Date"},"description":"Optional period start (entry_date >= start_date). Enables opening-balance sync."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Optional period end (entry_date <= end_date). Defaults to today.","title":"End Date"},"description":"Optional period end (entry_date <= end_date). Defaults to today."},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Optional account drill-down (repeatable: ?account_code=200&account_code=400). Omitted ⇒ the engine builds the ENTIRE general ledger.","title":"Account Code"},"description":"Optional account drill-down (repeatable: ?account_code=200&account_code=400). Omitted ⇒ the engine builds the ENTIRE general ledger."},{"name":"basis","in":"query","required":false,"schema":{"type":"string","description":"'invoice' (accrual, default) or 'cash' — cash nets/scales invoice-backed lines by in-period settlement (same model as the job GL).","default":"invoice","title":"Basis"},"description":"'invoice' (accrual, default) or 'cash' — cash nets/scales invoice-backed lines by in-period settlement (same model as the job GL)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response General Ledger Live Api V1 Xero Clients  Client Uuid  General Ledger Live Get","$ref":"#/components/schemas/ClientGeneralLedgerLiveResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/contacts":{"get":{"tags":["xero","xero"],"summary":"List active Xero contacts","description":"Active Xero contacts for the client — drives the AP/AR per-contact picker.","operationId":"client_contacts_api_v1_xero_clients__client_uuid__contacts_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Client Contacts Api V1 Xero Clients  Client Uuid  Contacts Get","$ref":"#/components/schemas/ClientContactsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/gl-accounts":{"get":{"tags":["xero","xero"],"summary":"List client GL accounts","description":"Chart of accounts (code + name) for the client — drives the GL account\ndrill-down picker. Read from synced accounts; no GL build needed.","operationId":"client_gl_accounts_api_v1_xero_clients__client_uuid__gl_accounts_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Client Gl Accounts Api V1 Xero Clients  Client Uuid  Gl Accounts Get","$ref":"#/components/schemas/ClientGlAccountsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/gl-upload":{"get":{"tags":["xero","xero"],"summary":"Latest uploaded GL file reference","description":"The latest manually-uploaded GL file for the client (for the digital viewer).","operationId":"client_gl_upload_api_v1_xero_clients__client_uuid__gl_upload_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Client Gl Upload Api V1 Xero Clients  Client Uuid  Gl Upload Get","$ref":"#/components/schemas/ClientGlUploadResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/reports-summary":{"get":{"tags":["xero","xero"],"summary":"Latest stored document versions","description":"Docs overview — latest version of each document, scoped to the client.","operationId":"reports_summary_for_client_api_v1_xero_clients__client_uuid__reports_summary_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reports Summary For Client Api V1 Xero Clients  Client Uuid  Reports Summary Get","$ref":"#/components/schemas/ClientReportsSummaryResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/trial-balance-live":{"get":{"tags":["xero","xero"],"summary":"Live trial balance from Xero","description":"Live Trial Balance from Xero via the engine's stateless endpoint (no store).","operationId":"trial_balance_live_api_v1_xero_clients__client_uuid__trial_balance_live_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"report_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"As-at date (defaults to today).","title":"Report Date"},"description":"As-at date (defaults to today)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trial Balance Live Api V1 Xero Clients  Client Uuid  Trial Balance Live Get","$ref":"#/components/schemas/ClientTrialBalanceLiveResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/aged-payables-live":{"get":{"tags":["xero","xero"],"summary":"Live aged payables report","description":"Live Aged Payables computed from synced data via the engine (no store).","operationId":"aged_payables_live_api_v1_xero_clients__client_uuid__aged_payables_live_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"As-at date (defaults to today).","title":"As Of Date"},"description":"As-at date (defaults to today)."},{"name":"ageing_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'duedate' (default) or 'invoicedate'.","title":"Ageing By"},"description":"'duedate' (default) or 'invoicedate'."},{"name":"periods","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":1},{"type":"null"}],"description":"Number of ageing periods (1–5).","title":"Periods"},"description":"Number of ageing periods (1–5)."},{"name":"period_size","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Length of each ageing period.","title":"Period Size"},"description":"Length of each ageing period."},{"name":"period_unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'month' (default) or 'week'.","title":"Period Unit"},"description":"'month' (default) or 'week'."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Aged Payables Live Api V1 Xero Clients  Client Uuid  Aged Payables Live Get","$ref":"#/components/schemas/ClientAgedLiveResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/aged-receivables-live":{"get":{"tags":["xero","xero"],"summary":"Live aged receivables report","description":"Live Aged Receivables computed from synced data via the engine (no store).","operationId":"aged_receivables_live_api_v1_xero_clients__client_uuid__aged_receivables_live_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"as_of_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"As-at date (defaults to today).","title":"As Of Date"},"description":"As-at date (defaults to today)."},{"name":"ageing_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'duedate' (default) or 'invoicedate'.","title":"Ageing By"},"description":"'duedate' (default) or 'invoicedate'."},{"name":"periods","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":1},{"type":"null"}],"description":"Number of ageing periods (1–5).","title":"Periods"},"description":"Number of ageing periods (1–5)."},{"name":"period_size","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Length of each ageing period.","title":"Period Size"},"description":"Length of each ageing period."},{"name":"period_unit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'month' (default) or 'week'.","title":"Period Unit"},"description":"'month' (default) or 'week'."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Aged Receivables Live Api V1 Xero Clients  Client Uuid  Aged Receivables Live Get","$ref":"#/components/schemas/ClientAgedLiveResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/reports/{report}":{"get":{"tags":["xero","xero"],"summary":"Fetch a live Xero report","description":"Live fetch of a named Xero report (Balance Sheet, P&L, Bank/Budget/Exec).","operationId":"xero_report_api_v1_xero_clients__client_uuid__reports__report__get","parameters":[{"name":"report","in":"path","required":true,"schema":{"type":"string","title":"Report"}},{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Xero Report Api V1 Xero Clients  Client Uuid  Reports  Report  Get","$ref":"#/components/schemas/XeroReportResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/published-reports":{"get":{"tags":["xero","xero"],"summary":"List published Xero reports","description":"List published reports (BAS / GST live statements) for the picker.","operationId":"xero_published_reports_api_v1_xero_clients__client_uuid__published_reports_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Xero Published Reports Api V1 Xero Clients  Client Uuid  Published Reports Get","$ref":"#/components/schemas/PublishedReportsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/bank-accounts":{"get":{"tags":["xero","xero"],"summary":"List Xero bank accounts","description":"Bank accounts (type + status) for the Bank Summary filter dropdowns.","operationId":"xero_bank_accounts_api_v1_xero_clients__client_uuid__bank_accounts_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Xero Bank Accounts Api V1 Xero Clients  Client Uuid  Bank Accounts Get","$ref":"#/components/schemas/app__modules__xero__schemas_docs__BankAccountsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/published-reports/{report_id}":{"get":{"tags":["xero","xero"],"summary":"Fetch one published report","description":"Fetch one published report (BAS / GST) by its ReportID.\n\nReturns both the normalised row structure (for BAS-style row renderers)\nand the shaped GST fields (for the GST detail view). GST reports use\na Fields array instead of Rows; merging both ensures neither consumer breaks.","operationId":"xero_published_report_api_v1_xero_clients__client_uuid__published_reports__report_id__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Xero Published Report Api V1 Xero Clients  Client Uuid  Published Reports  Report Id  Get","$ref":"#/components/schemas/PublishedReportDetailResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/tenant-options":{"get":{"tags":["xero"],"summary":"Classify authorised Xero organisations","description":"Classify every authorised Xero org for the client being connected.","operationId":"tenant_options_api_v1_xero_clients__client_uuid__tenant_options_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTenantOptionsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/adopt-tenants":{"post":{"tags":["xero"],"summary":"Adopt Xero tenants for client","description":"Bind the primary org to this client, reconnect disconnected ones, and\nonboard brand-new orgs — all from one user submission.","operationId":"adopt_tenants_api_v1_xero_clients__client_uuid__adopt_tenants_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroAdoptTenantsBatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XeroAdoptTenantsResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/connect":{"post":{"tags":["xero"],"summary":"Start Xero OAuth connection","description":"Mint a Xero OAuth state and return the authorize URL the browser should visit.","operationId":"connect_api_v1_xero_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/callback":{"get":{"tags":["xero"],"summary":"Handle Xero OAuth callback","description":"Xero redirects here with ?code&state. Exchanges code, saves tokens + tenants.\n\nAuth is provided by the state token itself (minted by /connect, stored in\nRedis, single-use). No JWT cookie is required because Xero's user-agent\nredirect won't carry our cookies cross-site reliably.\n\nHandles both regular Xero OAuth and XPM OAuth flows via state lookup.","operationId":"callback_api_v1_xero_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/xero/tenants":{"get":{"tags":["xero"],"summary":"List firm's Xero tenants","description":"List all Xero tenants for the caller's firm, with the client each is bound to.","operationId":"list_tenants_api_v1_xero_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTenantListResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/tenants/{xero_tenant_uuid}/bind":{"post":{"tags":["xero"],"summary":"Bind Xero tenant to client","description":"Bind a firm Xero tenant to a Zato client and commit; 404 if not found.","operationId":"bind_tenant_api_v1_xero_tenants__xero_tenant_uuid__bind_post","parameters":[{"name":"xero_tenant_uuid","in":"path","required":true,"schema":{"type":"string","title":"Xero Tenant Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTenantBindRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTenantBindResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/adopt-tenant":{"post":{"tags":["xero"],"summary":"Adopt Xero org for client","description":"Per-client connect flow: bind the chosen org to this client and overwrite\nthe client's data from that Xero org (replaces the manual record).","operationId":"adopt_tenant_api_v1_xero_clients__client_uuid__adopt_tenant_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroAdoptTenantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XeroAdoptTenantResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/clients/{client_uuid}/status":{"get":{"tags":["xero"],"summary":"Get client Xero connection status","description":"Report whether the client has a bound Xero tenant, plus its details.","operationId":"client_status_api_v1_xero_clients__client_uuid__status_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroClientStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/sync/trial-balance":{"post":{"tags":["xero"],"summary":"Trigger trial balance sync","description":"Create a trial-balance sync job and run the Xero fetch via the engine.\n\nBlocks until the engine sync completes (or fails); the returned status is final.","operationId":"sync_trial_balance_api_v1_xero_sync_trial_balance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroSyncTrialBalanceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroSyncJobSummary"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/sync/{xero_sync_job_uuid}":{"get":{"tags":["xero"],"summary":"Get sync job status","description":"Fetch a Xero sync job's status by UUID (firm-scoped; 404 if not found).","operationId":"sync_status_api_v1_xero_sync__xero_sync_job_uuid__get","parameters":[{"name":"xero_sync_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Xero Sync Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroSyncJobSummary"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/jobs/{job_uuid}/trial-balance":{"get":{"tags":["xero"],"summary":"Get trial balance for job","description":"Return parsed trial balance rows for the latest sync of this job.","operationId":"trial_balance_for_job_api_v1_xero_jobs__job_uuid__trial_balance_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Rows with balance_date >= start_date.","title":"Start Date"},"description":"Rows with balance_date >= start_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Rows with balance_date <= end_date.","title":"End Date"},"description":"Rows with balance_date <= end_date."},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Restrict to these account codes.","title":"Account Code"},"description":"Restrict to these account codes."},{"name":"source","in":"query","required":false,"schema":{"type":"string","description":"'xero' (default, Xero-synced only), 'manual' (uploaded only), or any other value (e.g. 'all') for every source.","default":"xero","title":"Source"},"description":"'xero' (default, Xero-synced only), 'manual' (uploaded only), or any other value (e.g. 'all') for every source."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTrialBalanceResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/connect":{"post":{"tags":["akahu"],"summary":"Generate Akahu OAuth authorize URL","description":"Generate Akahu OAuth authorize URL for popup redirection.","operationId":"connect_api_v1_akahu_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuConnectResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/callback":{"get":{"tags":["akahu"],"summary":"Handle Akahu OAuth callback","description":"OAuth callback landing page. Exchanges code and notifies parent window via postMessage.\n`state` is a single-use CSRF nonce (G6) resolved back to {client_uuid, firm_id}.","operationId":"callback_api_v1_akahu_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OAuth authorization code from Akahu. Optional here (None-guarded): absent on an error/denied callback, which renders the failure page.","examples":["id_xxxxxxxxxxxxxxxxxxxxxxxx"],"title":"Code"},"description":"OAuth authorization code from Akahu. Optional here (None-guarded): absent on an error/denied callback, which renders the failure page."},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Single-use CSRF state nonce (G6) minted at /start and resolved back to {client_uuid, firm_id}. Optional here (None-guarded).","examples":["3f2a9c1e8b7d4f6a"],"title":"State"},"description":"Single-use CSRF state nonce (G6) minted at /start and resolved back to {client_uuid, firm_id}. Optional here (None-guarded)."},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OAuth error code Akahu returns when the user denies/authorization fails. Present only on the failure path.","examples":["access_denied"],"title":"Error"},"description":"OAuth error code Akahu returns when the user denies/authorization fails. Present only on the failure path."},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable OAuth error detail, shown on the failure page when present.","examples":["The user denied the authorization request."],"title":"Error Description"},"description":"Human-readable OAuth error detail, shown on the failure page when present."}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/akahu/status":{"get":{"tags":["akahu"],"summary":"Get Akahu connection status","description":"Check if the client is connected to Akahu, returning provider email and account listings.","operationId":"get_status_api_v1_akahu_status_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"UUID of the client whose Akahu connection status to fetch. Required.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"UUID of the client whose Akahu connection status to fetch. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/sync":{"post":{"tags":["akahu"],"summary":"Sync Akahu bank accounts","description":"Trigger direct refresh of Akahu bank accounts.","operationId":"sync_api_v1_akahu_sync_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuSyncRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuStatusResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/balances":{"post":{"tags":["akahu"],"summary":"Compute account closing balances","description":"Compute date-based closing balances for all connected accounts.","operationId":"get_balances_api_v1_akahu_balances_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuBalanceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuBalanceResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/disconnect":{"delete":{"tags":["akahu"],"summary":"Disconnect all Akahu connections","description":"Disconnect/revoke ALL Akahu connections for this client (every email/token).","operationId":"disconnect_api_v1_akahu_disconnect_delete","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"UUID of the client whose Akahu connections (every email/token) to revoke. Required.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"UUID of the client whose Akahu connections (every email/token) to revoke. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Disconnect Api V1 Akahu Disconnect Delete","$ref":"#/components/schemas/AkahuActionResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/connections/{credential_uuid}":{"delete":{"tags":["akahu"],"summary":"Disconnect one Akahu connection","description":"Disconnect/revoke ONE Akahu connection (a single email/token) for this client,\nleaving the client's other connections intact.","operationId":"disconnect_connection_api_v1_akahu_connections__credential_uuid__delete","parameters":[{"name":"credential_uuid","in":"path","required":true,"schema":{"type":"string","title":"Credential Uuid"}},{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"UUID of the client that owns the connection. Required (the connection is scoped to this client before revoking).","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"UUID of the client that owns the connection. Required (the connection is scoped to this client before revoking)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Disconnect Connection Api V1 Akahu Connections  Credential Uuid  Delete","$ref":"#/components/schemas/AkahuActionResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/send-link":{"post":{"tags":["akahu"],"summary":"Email Akahu authorization link","description":"Send the Akahu authorization link to the specified user email.","operationId":"send_link_api_v1_akahu_send_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuSendLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AkahuActionResponse","additionalProperties":{"type":"string"},"type":"object","title":"Response Send Link Api V1 Akahu Send Link Post"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/akahu/connect-info":{"get":{"tags":["akahu"],"summary":"Show Akahu consumer information page","description":"Consumer Information page (A2). 'Continue' forwards to /start.","operationId":"connect_info_api_v1_akahu_connect_info_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"UUID of the client the consumer-information page is for. Required — embedded into the /start URL the 'Continue' button forwards to.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"UUID of the client the consumer-information page is for. Required — embedded into the /start URL the 'Continue' button forwards to."}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/akahu/start":{"get":{"tags":["akahu"],"summary":"Start Akahu OAuth flow","description":"Mint a fresh single-use CSRF state nonce and 302-redirect to Akahu's hosted\nOAuth flow. The nonce is created at click time (short-lived) and consumed on\n/callback, so a forged/replayed callback is rejected (G6).","operationId":"start_api_v1_akahu_start_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"UUID of the client to begin the Akahu OAuth flow for. Required — bound into the freshly minted CSRF state nonce.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"],"title":"Client Uuid"},"description":"UUID of the client to begin the Akahu OAuth flow for. Required — bound into the freshly minted CSRF state nonce."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/akahu/webhook":{"post":{"tags":["akahu"],"summary":"Receive Akahu webhook events","description":"Akahu webhook receiver (G1). Verify the RSA signature over the RAW body,\nreturn 200 within Akahu's 5s budget, and dispatch the event. A bad/absent\nsignature is rejected 401 and never processed.","operationId":"webhook_api_v1_akahu_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bank-feeds/accounts":{"get":{"tags":["bank-feeds"],"summary":"List connected bank accounts","description":"All of a client's connected bank accounts (across every provider), each with\nits single latest transaction.","operationId":"list_accounts_api_v1_bank_feeds_accounts_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client whose connected bank accounts to list (firm-scoped). Required.","examples":["3f9a1c2e-7b40-4d1a-9c88-0a1b2c3d4e5f"],"title":"Client Uuid"},"description":"Client whose connected bank accounts to list (firm-scoped). Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BankFeedAccountSchema"},"title":"Response List Accounts Api V1 Bank Feeds Accounts Get"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ird/agent-link":{"post":{"tags":["ird"],"summary":"Link Agent","description":"Software-Intermediation Link — link the firm's tax agent to our platform,\nthen discover its clients in one go.","operationId":"link_agent_api_v1_ird_agent_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdAgentLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdDiscoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/discover":{"post":{"tags":["ird"],"summary":"Discover","description":"Populate the mapping list with the firm's IRD clients. Prefers the TDS\nclient-list path (mTLS-only) when a client_list_id is given — it works even when\nIntermediation delegation doesn't; falls back to the Intermediation RCL by agent.","operationId":"discover_api_v1_ird_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdDiscoverRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdDiscoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/mappings":{"get":{"tags":["ird"],"summary":"List Mappings","description":"The discovered IRD clients + their Zato-client link (for the wizard).","operationId":"list_mappings_api_v1_ird_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdMappingListResponse"}}}}}}},"/api/v1/ird/mappings/auto":{"post":{"tags":["ird"],"summary":"Auto Map","description":"Auto-match discovered IRD clients to Zato clients (IRD# exact, then name).","operationId":"auto_map_api_v1_ird_mappings_auto_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdAutoMapResponse"}}}}}}},"/api/v1/ird/mappings/{ird_number}":{"post":{"tags":["ird"],"summary":"Set Mapping","description":"Manually point (or clear) an IRD client's Zato-client link.","operationId":"set_mapping_api_v1_ird_mappings__ird_number__post","parameters":[{"name":"ird_number","in":"path","required":true,"schema":{"type":"string","title":"Ird Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdSetMappingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdMappingItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/sync":{"post":{"tags":["ird"],"summary":"Sync","description":"Dispatch a durable TDS data sync over the firm's confirmed client mappings.","operationId":"sync_api_v1_ird_sync_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IrdSyncRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/data":{"get":{"tags":["ird"],"summary":"Get Data","description":"The synced customer→account→period tree (optionally scoped to one client).","operationId":"get_data_api_v1_ird_data_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional: scope the tree to one Zato client by UUID. Omit to return the whole firm's synced customers.","examples":["9f1c2b7e-4d3a-4a11-9c0e-1b2c3d4e5f60"],"title":"Client Uuid"},"description":"Optional: scope the tree to one Zato client by UUID. Omit to return the whole firm's synced customers."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/data/period/{period_id}":{"get":{"tags":["ird"],"summary":"Get Period Detail","description":"Full detail (transactions / bill items / credit transfers) for one period.","operationId":"get_period_detail_api_v1_ird_data_period__period_id__get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"integer","title":"Period Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/connect":{"post":{"tags":["ird"],"summary":"Connect","description":"Mint an IRD OAuth state and return the authorize URL the browser visits.\n\nFirm-level: the accountant authorizes the firm's myIR once. No body — the grant\nis scoped to the caller's firm.","operationId":"connect_api_v1_ird_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdConnectResponse"}}}}}}},"/api/v1/ird/callback":{"get":{"tags":["ird"],"summary":"Callback","description":"IRD redirects here with ?code&state. Exchanges the code, stores the firm's\ngrant, and bounces back into the practice-portal integrations surface.\n\nAuth is the single-use ``state`` token minted by /connect (stored in Redis);\nno JWT cookie is required because the myIR redirect won't carry our cookies.","operationId":"callback_api_v1_ird_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"REQUIRED. The OAuth authorization code IRD returns on redirect.","title":"Code"},"description":"REQUIRED. The OAuth authorization code IRD returns on redirect."},{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"REQUIRED. The single-use OAuth state token minted by /connect (validated against Redis).","title":"State"},"description":"REQUIRED. The single-use OAuth state token minted by /connect (validated against Redis)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ird/status":{"get":{"tags":["ird"],"summary":"Get Status","description":"Read-only: whether the firm's myIR is connected + grant health.","operationId":"get_status_api_v1_ird_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdStatusResponse"}}}}}}},"/api/v1/ird/disconnect":{"delete":{"tags":["ird"],"summary":"Disconnect","description":"Remove the firm's stored IRD grant (soft-delete). Idempotent.","operationId":"disconnect_api_v1_ird_disconnect_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrdDisconnectResponse"}}}}}}},"/api/v1/bank-feeds/coa-bank-accounts":{"get":{"tags":["bank-feeds"],"summary":"List linkable COA bank accounts","description":"The client's COA bank accounts (zato account type 'bank') — the link dropdown options.","operationId":"coa_bank_accounts_api_v1_bank_feeds_coa_bank_accounts_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client whose COA bank accounts to list. Required.","examples":["3f9a1c2e-7b40-4d1a-9c88-0a1b2c3d4e5f"],"title":"Client Uuid"},"description":"Client whose COA bank accounts to list. Required."},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Provider override (defaults to xero). Optional — the COA is provider-neutral.","examples":["xero"],"title":"Provider"},"description":"Provider override (defaults to xero). Optional — the COA is provider-neutral."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaBankAccountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/bank-feeds/accounts/{bank_account_uuid}/coa-link":{"put":{"tags":["bank-feeds"],"summary":"Set or clear COA account link","description":"Link (or, with all-null, unlink) a connected bank account to a COA bank account.","operationId":"set_coa_link_api_v1_bank_feeds_accounts__bank_account_uuid__coa_link_put","parameters":[{"name":"bank_account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Bank Account Uuid"}},{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client that owns the bank account. Required.","examples":["3f9a1c2e-7b40-4d1a-9c88-0a1b2c3d4e5f"],"title":"Client Uuid"},"description":"Client that owns the bank account. Required."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCoaLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CoaLinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/bank-feeds/accounts/{bank_account_uuid}/transactions":{"post":{"tags":["bank-feeds"],"summary":"Query bank account transactions","description":"The account's transactions for the window — read-through (fetch + persist when past coverage).","operationId":"account_transactions_api_v1_bank_feeds_accounts__bank_account_uuid__transactions_post","parameters":[{"name":"bank_account_uuid","in":"path","required":true,"schema":{"type":"string","title":"Bank Account Uuid"}},{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client that owns the bank account. Required.","examples":["3f9a1c2e-7b40-4d1a-9c88-0a1b2c3d4e5f"],"title":"Client Uuid"},"description":"Client that owns the bank account. Required."},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Provider region override (defaults to deployment country). Optional.","examples":["nz"],"title":"Region"},"description":"Provider region override (defaults to deployment country). Optional."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionQueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TransactionsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/grid-prefs/{grid_table}":{"get":{"tags":["grid-prefs"],"summary":"Get saved grid preferences","description":"The caller's saved AG Grid preferences for one grid table.\n404 when the user has never saved preferences for it.","operationId":"get_prefs_api_v1_grid_prefs__grid_table__get","parameters":[{"name":"grid_table","in":"path","required":true,"schema":{"type":"string","title":"Grid Table"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridPrefsResponse"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["grid-prefs"],"summary":"Save grid preferences","description":"Upsert the caller's AG Grid preferences for one grid table. Returns 204.","operationId":"save_prefs_api_v1_grid_prefs__grid_table__put","parameters":[{"name":"grid_table","in":"path","required":true,"schema":{"type":"string","title":"Grid Table"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GridPrefsBody"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/auth":{"post":{"tags":["xero-xpm"],"summary":"Start XPM OAuth connection","description":"Mint an XPM OAuth state and return the Xero authorize URL.\n\nThe frontend opens this URL in a popup window.  On completion Xero\nredirects to /xero/xpm/callback.","operationId":"xpm_auth_api_v1_xero_xpm_auth_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XpmAuthResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/auth-status":{"get":{"tags":["xero-xpm"],"summary":"Check XPM connection status","description":"Poll endpoint: returns {connected: bool} for the popup to check after close.","operationId":"xpm_auth_status_api_v1_xero_xpm_auth_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XpmAuthStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/sync":{"post":{"tags":["xero-xpm"],"summary":"Refresh XPM tenant state","description":"Refresh PRACTICEMANAGER tenant + connection state.\n\nLive-fetch only: this does NOT import jobs. XPM jobs are fetched live for the\nMap Jobs wizard and persisted only on the user's explicit confirm.","operationId":"xpm_sync_api_v1_xero_xpm_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XpmSyncResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/organizations":{"get":{"tags":["xero-xpm"],"summary":"List connected XPM tenants","description":"List PRACTICEMANAGER tenants connected to this firm.","operationId":"xpm_organizations_api_v1_xero_xpm_organizations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_XpmTenantsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/refresh-token":{"post":{"tags":["xero-xpm"],"summary":"Force XPM token refresh","description":"Manually force an XPM token refresh.","operationId":"xpm_refresh_token_api_v1_xero_xpm_refresh_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RefreshedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/xpm/disconnect":{"post":{"tags":["xero-xpm"],"summary":"Disconnect XPM credential","description":"Deactivate the XPM credential and mark all PRACTICEMANAGER tenants offline.","operationId":"xpm_disconnect_api_v1_xero_xpm_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DisconnectedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/organisations":{"get":{"tags":["xero-partner-sync"],"summary":"List connected Xero organisations","description":"List ORGANISATION tenants accessible via the Xero GL token.\n\nA firm with no active Xero grant is a normal, expected state — not an error.\nIt returns `200 {organisations: [], connected: false}` so the browser can tell\n\"never connected\" apart from \"the call failed\". Raising for both (AppError →\n500) made them indistinguishable, so every connect surface rendered its\n\"Connect Xero\" panel on a transient outage and StepManageClients silently\nemptied a connected firm's client list.","operationId":"list_organisations_api_v1_xero_partner_sync_organisations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OrganisationsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/connected-clients":{"get":{"tags":["xero-partner-sync"],"summary":"List Xero-connected Zato clients","description":"Zato clients that have a blue Xero tenant bound.","operationId":"connected_clients_api_v1_xero_partner_sync_connected_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/xpm-clients":{"get":{"tags":["xero-partner-sync"],"summary":"List XPM practice clients","description":"XPM practice client list (XML, green side).","operationId":"xpm_clients_api_v1_xero_partner_sync_xpm_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/client-mappings":{"get":{"tags":["xero-partner-sync"],"summary":"Get client mappings","description":"Return existing Zato ↔ XPM client mappings.","operationId":"get_client_mappings_api_v1_xero_partner_sync_client_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ClientMappingsResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["xero-partner-sync"],"summary":"Save client mappings","description":"Persist confirmed Zato ↔ XPM client mappings (sets linked_with_xpm).\n\nThe mappings are saved synchronously; the slower best-effort GST/IRD\nenrichment (one live XPM call per client) is dispatched off the request loop\nafter commit, so the response returns as soon as the mappings persist instead\nof waiting on N serial XPM round-trips. The client viewer refreshes live from\na ``user:<id>`` WS frame when the enrichment finishes.","operationId":"save_client_mappings_api_v1_xero_partner_sync_client_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__xero__router_partner_sync__SaveClientMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SaveClientMappingsResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/xpm-jobs":{"get":{"tags":["xero-partner-sync"],"summary":"List XPM jobs","description":"List all XPM jobs (two concurrent XPM calls behind a short-TTL cache).\n\nRead-only: GST is seeded once per client at mapping time (see\n``save_client_mappings`` → off-loop enrichment), NOT on this path — the old\nper-client GST pre-seed here was an N+1 of serial XPM calls and was removed. No\nsession write happens, so there is nothing to commit.","operationId":"xpm_jobs_api_v1_xero_partner_sync_xpm_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/map-jobs":{"post":{"tags":["xero-partner-sync"],"summary":"Import XPM jobs to clients","description":"Import + assign XPM jobs to Zato clients.","operationId":"map_jobs_api_v1_xero_partner_sync_map_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapJobsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MapJobsResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/synced-jobs":{"get":{"tags":["xero-partner-sync"],"summary":"List imported XPM jobs","description":"Return all XPM-sourced jobs for this firm.","operationId":"synced_jobs_api_v1_xero_partner_sync_synced_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/xpm-jobs-for-client":{"get":{"tags":["xero-partner-sync"],"summary":"List XPM jobs for client","description":"Return XPM jobs assigned to a specific Zato client.","operationId":"xpm_jobs_for_client_api_v1_xero_partner_sync_xpm_jobs_for_client_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Required. Zato client_uuid whose imported XPM jobs to list.","examples":["550e8400-e29b-41d4-a716-446655440000"],"title":"Client Uuid"},"description":"Required. Zato client_uuid whose imported XPM jobs to list."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/disconnect-clients":{"post":{"tags":["xero-partner-sync"],"summary":"Clear XPM mapping for client","description":"Remove XPM mapping for a single Zato client.","operationId":"disconnect_client_api_v1_xero_partner_sync_disconnect_clients_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectClientRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DisconnectedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/disconnect-xero":{"post":{"tags":["xero-partner-sync"],"summary":"Disconnect Xero GL credential","description":"Deactivate the Xero GL credential + mark ORGANISATION tenants offline.","operationId":"disconnect_xero_api_v1_xero_partner_sync_disconnect_xero_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DisconnectedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/xero/partner-sync/disconnect-xpm":{"post":{"tags":["xero-partner-sync"],"summary":"Disconnect XPM credential","description":"Deactivate the XPM credential + mark PRACTICEMANAGER tenants offline.","operationId":"disconnect_xpm_api_v1_xero_partner_sync_disconnect_xpm_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DisconnectedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/tree":{"get":{"tags":["zbox","zbox"],"summary":"Get integration browser tree","description":"Firm-scoped provider tree roots: live providers return a lazy root node;\nseeded providers return their bundled tree with per-folder file counts.","operationId":"get_integration_tree_api_v1_zbox_zbox_integrations_tree_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationTreeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/folder":{"get":{"tags":["zbox","zbox"],"summary":"Browse one integration folder level","description":"One folder level of a live integration (lazy expand + cursor file paging).\n`folder_id` absent = the provider root. Filter params are provider-aware:\nunsupported filters are ignored by that provider rather than failing browse.\nPassing target_type/target_uuid ('job'|'client') badges rows already linked to\nthat job/client (linked_to_target) so the browse can flag re-pulls.","operationId":"get_integration_folder_api_v1_zbox_zbox_integrations_folder_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","maxLength":32,"description":"Live integration provider key to browse (required; must be a live provider, e.g. 'sharepoint').","examples":["sharepoint"],"title":"Provider"},"description":"Live integration provider key to browse (required; must be a live provider, e.g. 'sharepoint')."},{"name":"folder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Folder node id to expand; omit for the provider root.","title":"Folder Id"},"description":"Folder node id to expand; omit for the provider root."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"description":"Opaque paging cursor from a previous page's next_cursor; omit for the first page.","title":"Cursor"},"description":"Opaque paging cursor from a previous page's next_cursor; omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Max files per page (capped server-side by zbox_integration_page_size).","default":100,"title":"Limit"},"description":"Max files per page (capped server-side by zbox_integration_page_size)."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"updated_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Updated From"}},{"name":"updated_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Updated To"}},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Created From"}},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Created To"}},{"name":"include_deleted","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Deleted"}},{"name":"thread_master","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thread Master"}},{"name":"document_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Document Type"}},{"name":"is_knowledge","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Knowledge"}},{"name":"cabinet_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Cabinet Type"}},{"name":"cabinet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Cabinet Id"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Target Type"}},{"name":"target_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Target Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationFolderResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/filter-capabilities":{"get":{"tags":["zbox","zbox"],"summary":"Per-provider live-filter capabilities","description":"The filter keys each live provider honours — drives the provider-aware filter\ntoolbar so the FE only offers controls a provider can actually apply.","operationId":"get_integration_filter_capabilities_api_v1_zbox_zbox_integrations_filter_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationFilterCapsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/fyi/assist":{"get":{"tags":["zbox","zbox"],"summary":"FYI entity auto-map assist","description":"Suggest the FYI entity matching a Zato client (a saved mapping, else a fuzzy\nmatch) plus job FY/name hints, so the ZBox browser can pre-focus the right FYI\nentity instead of making the user hunt through every entity.","operationId":"get_fyi_assist_api_v1_zbox_zbox_integrations_fyi_assist_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","maxLength":64,"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiAssistResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/fyi/assist/confirm":{"post":{"tags":["zbox","zbox"],"summary":"Confirm FYI entity mapping","description":"Persist the confirmed FYI entity → Zato client mapping (the learning) so the\nnext import for this client pre-selects the entity instantly.","operationId":"confirm_fyi_assist_api_v1_zbox_zbox_integrations_fyi_assist_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FyiAssistConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiAssistConfirmResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/link":{"post":{"tags":["zbox","zbox"],"summary":"Link integration folder files to a job","description":"Link all files under the given provider folder nodes to a firm-owned job\n(validates job ownership); may trigger auto-categorization.","operationId":"link_integration_node_api_v1_zbox_zbox_integrations_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkNodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinkNodeResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/link-live":{"post":{"tags":["zbox","zbox"],"summary":"Link live provider files and ingest","description":"Link a live provider's file(s)/folder(s) to a job or client, then ingest the\nbytes into S3 (+ optional auto-categorize) off the request loop.","operationId":"link_live_integration_api_v1_zbox_zbox_integrations_link_live_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkLiveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinkLiveAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/zbox/integrations/file-content":{"get":{"tags":["zbox","zbox"],"summary":"Stream an integration file inline","description":"Stream a live integration file's bytes inline (in-house view — the backend\nholds the provider token, so the browser never has to sign in). `version_id`/\n`file_name` are FYI-specific (download by version id; mime derived from name).","operationId":"integration_file_content_api_v1_zbox_zbox_integrations_file_content_get","parameters":[{"name":"file_id","in":"query","required":true,"schema":{"type":"string","maxLength":512,"description":"External id of the live-provider file to stream (required).","examples":["01ABCDEFGHFILEID"],"title":"File Id"},"description":"External id of the live-provider file to stream (required)."},{"name":"provider","in":"query","required":false,"schema":{"type":"string","maxLength":32,"description":"Live provider the file belongs to (defaults to 'sharepoint').","default":"sharepoint","title":"Provider"},"description":"Live provider the file belongs to (defaults to 'sharepoint')."},{"name":"version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"description":"FYI-specific: download by this document version id.","title":"Version Id"},"description":"FYI-specific: download by this document version id."},{"name":"file_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"FYI-specific: file name the response mime type is derived from.","title":"File Name"},"description":"FYI-specific: file name the response mime type is derived from."}],"responses":{"200":{"description":"The live integration file's bytes streamed inline (in-house view).","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/tree":{"get":{"tags":["zbox"],"summary":"Browse the ZBox org tree","description":"Firm-rooted org tree (root + one page of clients, jobs lazy-loaded on expand;\n`q` name-filters clients server-side, `limit`/`offset` page them). Pass\n`client_uuid` for that client's subtree (client → jobs) — the client-scoped\nexplorer AND the firm tree's lazy jobs-on-expand fetch.","operationId":"get_tree_api_v1_zbox_tree_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Uuid"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TreeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files":{"get":{"tags":["zbox"],"summary":"List ZBox files","description":"One page of firm-scoped files matching the filters (state, category, provider,\nsearch, triage), with sort + limit/offset paging.","operationId":"list_files_api_v1_zbox_files_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"State"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Category"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Provider"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"triage","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Triage"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"updated_at","title":"Sort"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"include_job_links","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Job Links"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/ids":{"get":{"tags":["zbox"],"summary":"List all matching file ids","description":"Every file_uuid matching the current filters (no page window) — the grid's\ncross-page 'select all matching'. Same filter contract as GET /files, minus the\nsort/limit/offset paging (order is irrelevant for a select-all id set).","operationId":"list_file_ids_api_v1_zbox_files_ids_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"State"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Category"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Provider"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"triage","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Triage"}},{"name":"include_job_links","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Job Links"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileIdsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/counts":{"get":{"tags":["zbox"],"summary":"Get per-triage file counts","description":"Per-triage-bucket counts ({all, uncategorised, low_confidence, failed}) over the\nSAME scope as the file list — so the quick-filter pills reflect the whole result set,\nnot the loaded page. Declared BEFORE /files/{file_uuid} so 'counts' isn't a uuid.","operationId":"file_counts_api_v1_zbox_files_counts_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Provider"}},{"name":"include_job_links","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Job Links"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileCountsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}":{"get":{"tags":["zbox"],"summary":"Get a ZBox file","description":"Full metadata for one firm-scoped ZBox file. Pass `job_uuid` (when viewed in a\njob context) to reflect that job's per-job category override, if one is set.","operationId":"get_file_api_v1_zbox_files__file_uuid__get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["zbox"],"summary":"Move a file to recycle bin","description":"Soft-delete a file into the recycle bin (restorable).","operationId":"delete_file_api_v1_zbox_files__file_uuid__delete","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileDeletedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/summarize":{"post":{"tags":["zbox"],"summary":"Summarize a ZBox file via the OCR agent","description":"Condense the file's text via the OCR agent's `summary` mode and persist it to\n`extracted_data.summary` (readable straight off GET /files/{file_uuid} after this).\nReuses the stored summary when the file is unchanged unless `force=true`.","operationId":"summarize_file_api_v1_zbox_files__file_uuid__summarize_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileSummaryResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/view-url":{"get":{"tags":["zbox"],"summary":"Get a file view URL","description":"A URL the browser can use to view the file's content inline.","operationId":"file_view_url_api_v1_zbox_files__file_uuid__view_url_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_FileViewUrlResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/download":{"get":{"tags":["zbox"],"summary":"Download a ZBox file","description":"Stream a local-disk blob inline (default local dev); for the S3 backend,\nredirect to a short-lived presigned URL.","operationId":"file_download_api_v1_zbox_files__file_uuid__download_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"The file's bytes inline (local backend), or a redirect to a presigned S3 URL.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/stream":{"get":{"tags":["zbox"],"summary":"Stream a file's bytes same-origin","description":"Stream a file's bytes inline, SAME-ORIGIN, for in-app rendering (the lineage\nfull-PDF viewer). Reads S3 server-side so the browser never fetches a cross-origin\npresigned URL — whose bucket CORS would block pdfjs's XHR. Unlike ``/download``\n(which redirects to a presigned URL for the S3 backend) this always returns bytes.","operationId":"file_stream_api_v1_zbox_files__file_uuid__stream_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"The file's bytes inline, same-origin.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/link":{"post":{"tags":["zbox"],"summary":"Link a file to a job","description":"Attach an existing ZBox file to a job.","operationId":"link_file_api_v1_zbox_files__file_uuid__link_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkFileRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/link":{"post":{"tags":["zbox"],"summary":"Bulk link files to a job","description":"Link many ZBox files to one job in a single call.","operationId":"bulk_link_files_api_v1_zbox_files_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkLinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/jobs/{job_uuid}/files/{file_uuid}":{"delete":{"tags":["zbox"],"summary":"Remove a file from a job","description":"Remove a file from a job by DELINKING (not deleting): the file + its extraction are\npreserved; only the job link detaches and the WP rows it fed retire on the next Run.","operationId":"delink_file_from_job_api_v1_zbox_jobs__job_uuid__files__file_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DelinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/clients/{client_uuid}/files/{file_uuid}":{"delete":{"tags":["zbox"],"summary":"Remove a file from a client","description":"Remove a file from a client by DELINKING (not deleting): the file + its extraction are\npreserved; only the direct client tag detaches.","operationId":"delink_file_from_client_api_v1_zbox_clients__client_uuid__files__file_uuid__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientDelinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/jobs/{job_uuid}/files/delink":{"post":{"tags":["zbox"],"summary":"Bulk remove files from a job","description":"Bulk DELINK (not delete) many files from a job: detach each file's job link(s). The files\n+ their extraction are preserved (they stay in Zbox, re-linkable); the WP rows they fed\nretire on the next run. Mirrors the single-file job unlink for a selection.","operationId":"bulk_delink_files_from_job_api_v1_zbox_jobs__job_uuid__files_delink_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDelinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkDelinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/clients/{client_uuid}/files/delink":{"post":{"tags":["zbox"],"summary":"Bulk remove files from a client","description":"Bulk DELINK (not delete) many files from a client tag: detach each file's direct client\nlink. The files + their extraction are preserved (they stay in Zbox, re-linkable). Mirrors\nthe single-file client unlink for a selection.","operationId":"bulk_delink_files_from_client_api_v1_zbox_clients__client_uuid__files_delink_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDelinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkDelinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/delete":{"post":{"tags":["zbox"],"summary":"Bulk move files to recycle bin","description":"Soft-delete many files into the recycle bin (restorable).","operationId":"bulk_delete_files_api_v1_zbox_files_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkDeleteResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/recycle-bin":{"get":{"tags":["zbox"],"summary":"List recycle-bin files","description":"One page of the firm's soft-deleted files, optionally name-filtered.","operationId":"list_recycle_bin_api_v1_zbox_recycle_bin_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeletedFileListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/restore":{"post":{"tags":["zbox"],"summary":"Restore a deleted file","description":"Restore one file from the recycle bin.","operationId":"restore_file_api_v1_zbox_files__file_uuid__restore_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileRestoredResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/restore":{"post":{"tags":["zbox"],"summary":"Bulk restore deleted files","description":"Restore many files from the recycle bin at once.","operationId":"bulk_restore_files_api_v1_zbox_files_restore_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkRestoreResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/purge":{"delete":{"tags":["zbox"],"summary":"Permanently delete a file","description":"Permanently delete one recycle-bin file (irreversible).","operationId":"purge_file_api_v1_zbox_files__file_uuid__purge_delete","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FilePurgedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/purge":{"post":{"tags":["zbox"],"summary":"Bulk permanently delete files","description":"Permanently delete many recycle-bin files (irreversible).","operationId":"bulk_purge_files_api_v1_zbox_files_purge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkPurgeResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/upload":{"post":{"tags":["zbox"],"summary":"Upload a document to ZBox","description":"Upload one file (size-capped) into the firm's ZBox, optionally pre-linked to a\njob/client; GL ingest is deliberately NOT triggered here (see comment below).","operationId":"upload_file_api_v1_zbox_files_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_v1_zbox_files_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadedFileResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/categories":{"get":{"tags":["zbox"],"summary":"List file categories","description":"The firm's category catalog used by file categorization.","operationId":"list_categories_api_v1_zbox_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CategoriesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/jobs/{job_uuid}/ledger-slots":{"get":{"tags":["zbox"],"summary":"Get a job's ledger slots","description":"Single-slot ledger status for a job: which of GL / Last Year GL / Trial\nBalance are filled (+ the file). Drives the slot cards + dropdown gating.","operationId":"job_ledger_slots_api_v1_zbox_jobs__job_uuid__ledger_slots_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LedgerSlotsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/sources":{"get":{"tags":["zbox"],"summary":"List data sources","description":"Config-driven data-source registry (label/order/colour) for the UI.","operationId":"list_sources_api_v1_zbox_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SourcesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/categorize":{"post":{"tags":["zbox"],"summary":"Start AI file categorization","description":"Start async AI categorization for the given files; returns 202 with the batch handle.","operationId":"categorize_files_api_v1_zbox_files_categorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategorizeRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CategorizeAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/category":{"put":{"tags":["zbox"],"summary":"Set a file's category","description":"Manually set a file's category (HITL override); ledger categories may fill\nthe job's ledger slot.","operationId":"set_file_category_api_v1_zbox_files__file_uuid__category_put","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/category/bulk":{"post":{"tags":["zbox"],"summary":"Bulk-apply a category to many files","description":"Apply one category to many files in one call (By-File grid multi-select).","operationId":"bulk_set_file_category_api_v1_zbox_files_category_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSetCategoryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkSetCategoryResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/{file_uuid}/link-client":{"post":{"tags":["zbox"],"summary":"Link a file to a client","description":"Tag a file with a firm-level client (job links stay on /link).","operationId":"link_file_client_api_v1_zbox_files__file_uuid__link_client_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__zbox__schemas__LinkClientRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/files/link-client":{"post":{"tags":["zbox"],"summary":"Bulk link files to a client","description":"Tag many files with one client in a single call.","operationId":"bulk_link_files_client_api_v1_zbox_files_link_client_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLinkClientRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkLinkResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/tree":{"get":{"tags":["zbox"],"summary":"Get integration browser tree","description":"Firm-scoped provider tree roots: live providers return a lazy root node;\nseeded providers return their bundled tree with per-folder file counts.","operationId":"get_integration_tree_api_v1_zbox_integrations_tree_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationTreeResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder":{"get":{"tags":["zbox"],"summary":"Browse one integration folder level","description":"One folder level of a live integration (lazy expand + cursor file paging).\n`folder_id` absent = the provider root. Filter params are provider-aware:\nunsupported filters are ignored by that provider rather than failing browse.\nPassing target_type/target_uuid ('job'|'client') badges rows already linked to\nthat job/client (linked_to_target) so the browse can flag re-pulls.","operationId":"get_integration_folder_api_v1_zbox_integrations_folder_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","maxLength":32,"description":"Live integration provider key to browse (required; must be a live provider, e.g. 'sharepoint').","examples":["sharepoint"],"title":"Provider"},"description":"Live integration provider key to browse (required; must be a live provider, e.g. 'sharepoint')."},{"name":"folder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"Folder node id to expand; omit for the provider root.","title":"Folder Id"},"description":"Folder node id to expand; omit for the provider root."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"description":"Opaque paging cursor from a previous page's next_cursor; omit for the first page.","title":"Cursor"},"description":"Opaque paging cursor from a previous page's next_cursor; omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Max files per page (capped server-side by zbox_integration_page_size).","default":100,"title":"Limit"},"description":"Max files per page (capped server-side by zbox_integration_page_size)."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"updated_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Updated From"}},{"name":"updated_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Updated To"}},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Created From"}},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Created To"}},{"name":"include_deleted","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Deleted"}},{"name":"thread_master","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thread Master"}},{"name":"document_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Document Type"}},{"name":"is_knowledge","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Knowledge"}},{"name":"cabinet_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Cabinet Type"}},{"name":"cabinet_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Cabinet Id"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Target Type"}},{"name":"target_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Target Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationFolderResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/filter-capabilities":{"get":{"tags":["zbox"],"summary":"Per-provider live-filter capabilities","description":"The filter keys each live provider honours — drives the provider-aware filter\ntoolbar so the FE only offers controls a provider can actually apply.","operationId":"get_integration_filter_capabilities_api_v1_zbox_integrations_filter_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationFilterCapsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/fyi/assist":{"get":{"tags":["zbox"],"summary":"FYI entity auto-map assist","description":"Suggest the FYI entity matching a Zato client (a saved mapping, else a fuzzy\nmatch) plus job FY/name hints, so the ZBox browser can pre-focus the right FYI\nentity instead of making the user hunt through every entity.","operationId":"get_fyi_assist_api_v1_zbox_integrations_fyi_assist_get","parameters":[{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","maxLength":64,"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiAssistResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/fyi/assist/confirm":{"post":{"tags":["zbox"],"summary":"Confirm FYI entity mapping","description":"Persist the confirmed FYI entity → Zato client mapping (the learning) so the\nnext import for this client pre-selects the entity instantly.","operationId":"confirm_fyi_assist_api_v1_zbox_integrations_fyi_assist_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FyiAssistConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiAssistConfirmResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/link":{"post":{"tags":["zbox"],"summary":"Link integration folder files to a job","description":"Link all files under the given provider folder nodes to a firm-owned job\n(validates job ownership); may trigger auto-categorization.","operationId":"link_integration_node_api_v1_zbox_integrations_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkNodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinkNodeResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/link-live":{"post":{"tags":["zbox"],"summary":"Link live provider files and ingest","description":"Link a live provider's file(s)/folder(s) to a job or client, then ingest the\nbytes into S3 (+ optional auto-categorize) off the request loop.","operationId":"link_live_integration_api_v1_zbox_integrations_link_live_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkLiveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinkLiveAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/file-content":{"get":{"tags":["zbox"],"summary":"Stream an integration file inline","description":"Stream a live integration file's bytes inline (in-house view — the backend\nholds the provider token, so the browser never has to sign in). `version_id`/\n`file_name` are FYI-specific (download by version id; mime derived from name).","operationId":"integration_file_content_api_v1_zbox_integrations_file_content_get","parameters":[{"name":"file_id","in":"query","required":true,"schema":{"type":"string","maxLength":512,"description":"External id of the live-provider file to stream (required).","examples":["01ABCDEFGHFILEID"],"title":"File Id"},"description":"External id of the live-provider file to stream (required)."},{"name":"provider","in":"query","required":false,"schema":{"type":"string","maxLength":32,"description":"Live provider the file belongs to (defaults to 'sharepoint').","default":"sharepoint","title":"Provider"},"description":"Live provider the file belongs to (defaults to 'sharepoint')."},{"name":"version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"description":"FYI-specific: download by this document version id.","title":"Version Id"},"description":"FYI-specific: download by this document version id."},{"name":"file_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"FYI-specific: file name the response mime type is derived from.","title":"File Name"},"description":"FYI-specific: file name the response mime type is derived from."}],"responses":{"200":{"description":"The live integration file's bytes streamed inline (in-house view).","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/structure":{"get":{"tags":["zbox"],"summary":"Get provider folder structure marks","description":"Every structural mark for a folder provider — each says the subfolders of one\nfolder are Clients / Jobs / Fiscal years (declared inline while browsing). Empty\nuntil the firm marks its first folder.","operationId":"get_folder_structure_api_v1_zbox_integrations_folder_mapping_structure_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","maxLength":32,"title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderStructureResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/mark":{"post":{"tags":["zbox"],"summary":"Mark a folder's subfolders as a Zato entity level","description":"Declare (or clear, when child_role is null) that a folder's immediate subfolders\nare Clients / Jobs / Fiscal years / Sources. Per-folder so uneven trees are allowed;\ndrives the browse structural badges and the Map-clients auto-map. `folder_id` null =\nthe provider root. `depth_roles` (only on a \"client\" mark) sets the default ordered\ndepth chain in one action, so client folders work without drilling into each one.","operationId":"mark_folder_structure_api_v1_zbox_integrations_folder_mapping_mark_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderMarkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderMarkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/tags":{"get":{"tags":["zbox"],"summary":"List provider folder tags","description":"Every active client/job folder tag for a folder provider (OneDrive, Dropbox,\nGoogle Drive, SharePoint) — hydrates browse badges and the auto-map review table.","operationId":"list_folder_tags_api_v1_zbox_integrations_folder_mapping_tags_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","maxLength":32,"title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderTagsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["zbox"],"summary":"Save a batch of provider folder tags","description":"Persist confirmed folder tags from the bulk auto-map review table. Each tag\nsupersedes any prior active tag on the same folder + kind.","operationId":"save_folder_tags_api_v1_zbox_integrations_folder_mapping_tags_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderTagsSaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderTagsSaveResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/mapped-folders":{"get":{"tags":["zbox"],"summary":"List provider folders mapped to a client or job","description":"Provider folders (OneDrive/Dropbox/Drive/SharePoint) tagged to one client or\njob, each with its live linked-file count — the entity's ZBox entry points, so the\naccountant jumps straight to a mapped folder instead of walking the tree. Pass\nexactly one of `client_uuid` / `job_uuid`; firm-scoped, one indexed read.","operationId":"list_entity_mapped_folders_api_v1_zbox_mapped_folders_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Uuid"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MappedFoldersResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/resolve":{"post":{"tags":["zbox"],"summary":"Resolve a folder's effective client/job target","description":"The Zato client/job a folder resolves to — its own tag, else the nearest tagged\nancestor in the supplied breadcrumb chain — so linking pre-selects the target\ninstead of making the user re-pick. Null target when nothing in the chain is\ntagged. One indexed read; no provider tree walk.","operationId":"resolve_folder_target_api_v1_zbox_integrations_folder_mapping_resolve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderResolveResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/import":{"post":{"tags":["zbox"],"summary":"Import files from mapped provider folders","description":"Migrate every file under the provider's mapped folders to its tagged client/job\nin one action — the payoff of tagging. `folder_ids` empty = all mapped folders.\nLinks are stamped folder-map provenance; the bytes then ingest (S3 + optional\ncategorize) off the request loop, streamed to the same progress dock via `batch_id`.","operationId":"import_mapped_folders_api_v1_zbox_integrations_folder_mapping_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderImportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderImportAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/auto-map":{"post":{"tags":["zbox"],"summary":"Auto-map provider client folders","description":"List a base folder's child folders and fuzzy-match each to a Zato client (one\nbounded provider page). Jobs are matched lazily per client via the jobs endpoint.","operationId":"auto_map_folder_clients_api_v1_zbox_integrations_folder_mapping_auto_map_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderAutoMapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderAutoMapClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/auto-map-jobs":{"post":{"tags":["zbox"],"summary":"Auto-map one client folder's job folders","description":"Match one client folder's child folders to that client's jobs (lazy, per\nclient on row-expand) so a large firm never triggers a nested whole-tree walk.","operationId":"auto_map_folder_jobs_api_v1_zbox_integrations_folder_mapping_auto_map_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderAutoMapJobsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderAutoMapJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/tag":{"post":{"tags":["zbox"],"summary":"Tag a provider folder as a client/job","description":"Tag one live provider folder as a Zato client or job (inline from the browse\ngrid). A tag is a standing rule; linking from it pre-selects the target.","operationId":"tag_folder_api_v1_zbox_integrations_folder_mapping_tag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderTagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderTagsSaveResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/untag":{"post":{"tags":["zbox"],"summary":"Remove a provider folder tag","description":"Clear a folder's active client/job tag (a specific kind, or all kinds). With\n`cascade`, also unlink the files the tag auto-linked.","operationId":"untag_folder_api_v1_zbox_integrations_folder_mapping_untag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderUntagRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FolderUntagResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/ai-tag":{"post":{"tags":["zbox"],"summary":"Dispatch an AI folder auto-tag run","description":"Kick off an AI pass that reads the provider's whole folder tree + the firm's\nclient/job book and proposes a role (client/job/fiscal-year/source) + target for each\nfolder — smart, non-uniform, not rigid levels. Returns 202 {run_id}; the run executes\noff the edge loop and streams progress on the run banner. Nothing is tagged until a\nhuman confirms the proposals in the review drawer.","operationId":"dispatch_folder_ai_tag_api_v1_zbox_integrations_folder_mapping_ai_tag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiTagRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AiTagDispatchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/ai-tag/{run_id}":{"get":{"tags":["zbox"],"summary":"Get an AI folder auto-tag run's proposals","description":"The proposals from an AI folder auto-tag run (poll after the run banner reports\ndone). 404 if the run is missing/expired or owned by another user; `proposals` is\nempty until the run completes. Confirming a proposal reuses the existing tag/mark\nroutes — nothing here persists.","operationId":"get_folder_ai_tag_proposals_api_v1_zbox_integrations_folder_mapping_ai_tag__run_id__get","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/Envelope_AiTagProposalsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/folder-mapping/ai-tag/apply":{"post":{"tags":["zbox"],"summary":"Apply the human-reviewed AI folder structure","description":"Persist the folder roles a human confirmed in the tagging pane. The edits overlay\nthe run's stored proposals + walked tree and re-derive the structure marks from the\ncorrected roles. TAGGING IS ROLES-ONLY: this writes marks, never entity (client/job)\ntags — which Zato client/job each folder maps to is resolved later on Map-to-Zato.","operationId":"apply_folder_ai_tag_review_api_v1_zbox_integrations_folder_mapping_ai_tag_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiTagApplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AiTagApplyResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/sharepoint/credentials":{"get":{"tags":["sharepoint"],"summary":"Get SharePoint connection status","description":"Return the firm's SharePoint connection status (connected flag plus which\ncredential fields are stored). Requires ORG.INTEGRATIONS__VIEW_BY_ERP.","operationId":"get_credentials_api_v1_integrations_sharepoint_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_CredentialStatusResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["sharepoint"],"summary":"Save and verify SharePoint credentials","description":"Verify the submitted SharePoint credentials against Microsoft and persist\nthem for the firm; nothing is saved if verification fails.\nRequires ORG.INTEGRATIONS__CONNECT_ERP.","operationId":"save_credentials_api_v1_integrations_sharepoint_credentials_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharePointCredentialsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SaveCredentialsResponse___1"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["sharepoint"],"summary":"Disconnect SharePoint","description":"Delete the firm's stored SharePoint credentials and hide the integration\nfrom the ZBox Integration Browser. Requires ORG.INTEGRATIONS__DISCONNECT_ERP.","operationId":"delete_credentials_api_v1_integrations_sharepoint_credentials_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/dropbox/credentials":{"get":{"tags":["dropbox"],"summary":"Get Dropbox connection status","description":"Return the firm's Dropbox connection status (connected flag, app key,\nwhether a secret / refresh token is stored). Requires PUBLIC.ZBOX__VIEW.","operationId":"get_credentials_api_v1_integrations_dropbox_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_CredentialStatusResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["dropbox"],"summary":"Save and verify Dropbox credentials","description":"Verify the submitted Dropbox app key/secret/refresh token against Dropbox\nand persist them for the firm; nothing is saved if verification fails.\nRequires PUBLIC.ZBOX__LINK.","operationId":"save_credentials_api_v1_integrations_dropbox_credentials_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DropboxCredentialsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SaveCredentialsResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["dropbox"],"summary":"Disconnect Dropbox","description":"Delete the firm's stored Dropbox credentials and hide the integration from\nthe ZBox Integration Browser. Requires PUBLIC.ZBOX__LINK.","operationId":"delete_credentials_api_v1_integrations_dropbox_credentials_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/googledrive/credentials":{"get":{"tags":["googledrive"],"summary":"Get Google Drive connection status","description":"Return the firm's Google Drive connection status: connected flag, client id,\nauth mode (service account / OAuth), stored-secret flags, redirect URI.\nRequires PUBLIC.ZBOX__VIEW.","operationId":"get_credentials_api_v1_integrations_googledrive_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_CredentialStatusResponse___3"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["googledrive"],"summary":"Disconnect Google Drive","description":"Delete the firm's stored Google Drive credentials and hide the integration\nfrom the ZBox Integration Browser. Requires PUBLIC.ZBOX__LINK.","operationId":"delete_credentials_api_v1_integrations_googledrive_credentials_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/googledrive/connect":{"post":{"tags":["googledrive"],"summary":"Start Google Drive connection","description":"Connect Google Drive. Service-account mode (a pasted SA key JSON) connects\nimmediately — no popup. OAuth mode stores the app id/secret and returns the\nconsent URL; the refresh token is captured at /callback.","operationId":"connect_api_v1_integrations_googledrive_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleDriveConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConnectResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/googledrive/callback":{"get":{"tags":["googledrive"],"summary":"Handle Google OAuth callback","description":"Google redirects here with ?code&state. Exchanges the code for a refresh\ntoken, verifies + persists, then closes the popup. State-authenticated (no JWT).","operationId":"callback_api_v1_integrations_googledrive_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"The one-time OAuth authorization code Google appends to the redirect. Exchanged (unconditionally) for a refresh token.","examples":["4/0AeanS0abcDEF12345ghijkLMNop"],"title":"Code"},"description":"The one-time OAuth authorization code Google appends to the redirect. Exchanged (unconditionally) for a refresh token."},{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"The single-use state token minted by /connect (authenticates this callback in place of a JWT). Looked up in Redis to recover the firm/user.","examples":["k3J9xQ2vN7pRt5wZ8yB1cD4eF6gH0aS"],"title":"State"},"description":"The single-use state token minted by /connect (authenticates this callback in place of a JWT). Looked up in Redis to recover the firm/user."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/onedrive/credentials":{"get":{"tags":["onedrive"],"summary":"Get OneDrive connection status","description":"Return the firm's OneDrive connection status (connected flag plus which\ncredential fields are stored). Requires PUBLIC.ZBOX__VIEW.","operationId":"get_credentials_api_v1_integrations_onedrive_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_CredentialStatusResponse___4"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["onedrive"],"summary":"Save and verify OneDrive credentials","description":"Verify the submitted OneDrive credentials against Microsoft and persist\nthem for the firm; nothing is saved if verification fails.\nRequires PUBLIC.ZBOX__LINK.","operationId":"save_credentials_api_v1_integrations_onedrive_credentials_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OneDriveCredentialsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SaveCredentialsResponse___3"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["onedrive"],"summary":"Disconnect OneDrive","description":"Delete the firm's stored OneDrive credentials and hide the integration from\nthe ZBox Integration Browser. Requires PUBLIC.ZBOX__LINK.","operationId":"delete_credentials_api_v1_integrations_onedrive_credentials_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/credentials":{"get":{"tags":["fyi"],"summary":"Get FYI connection status","description":"Return the firm's FYI credential status: connected flag, region, access\nid, and a decrypted secret echo so the Connect form can pre-fill.","operationId":"get_credentials_api_v1_integrations_fyi_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_CredentialStatusResponse___5"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["fyi"],"summary":"Save and verify FYI credentials","description":"Verify the credentials against the FYI API first and persist only if\nFYI accepts them — rejected credentials are never stored.","operationId":"save_credentials_api_v1_integrations_fyi_credentials_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FYICredentialsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SaveCredentialsResponse___4"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["fyi"],"summary":"Disconnect FYI","description":"Delete the firm's stored FYI credentials and hide FYI from the ZBox\nIntegration Browser.","operationId":"delete_credentials_api_v1_integrations_fyi_credentials_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/clients":{"get":{"tags":["fyi"],"summary":"List Zato clients with mapping status","description":"Paginated non-deleted Zato clients for the firm, each with its FYI entity\nmapping status — server-side search (client name), mapping_status filter\n(all|mapped|unmapped) and name sort, for the mapping grid's infinite scroll.","operationId":"list_clients_api_v1_integrations_fyi_clients_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"mapping_status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Mapping Status"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","default":"asc","title":"Sort Dir"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientsListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/client-mappings":{"get":{"tags":["fyi"],"summary":"List FYI client mappings","description":"All FYI entity → Zato client mappings for the firm.","operationId":"list_client_mappings_api_v1_integrations_fyi_client_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_ClientMappingsResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["fyi"],"summary":"Save FYI client mappings","description":"Upsert FYI entity → Zato client mappings; a null zato_client_uuid\nclears the link. Returns the saved count.","operationId":"save_client_mappings_api_v1_integrations_fyi_client_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fyi__schemas__SaveClientMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SavedCountResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/auto-map-clients":{"post":{"tags":["fyi"],"summary":"Auto-map clients by exact name","description":"Exact-name auto-match between unmapped Zato clients and FYI entities\n(normalised names); returns the matched count.","operationId":"auto_map_clients_api_v1_integrations_fyi_auto_map_clients_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AutoMapClientsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/entities-only":{"get":{"tags":["fyi"],"summary":"List FYI entities for the picker","description":"Paginated FYI entity list for the picker, filterable by search, group,\nmanager, partner and mapping status.","operationId":"list_entities_only_api_v1_integrations_fyi_entities_only_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"group_name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Group Name"}},{"name":"manager_name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Manager Name"}},{"name":"partner_name","in":"query","required":false,"schema":{"type":"string","default":"","title":"Partner Name"}},{"name":"mapping_status","in":"query","required":false,"schema":{"type":"string","description":"Filter by mapping state: 'all' (default), 'mapped', or 'unmapped'.","examples":["unmapped"],"default":"all","title":"Mapping Status"},"description":"Filter by mapping state: 'all' (default), 'mapped', or 'unmapped'."},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EntitiesOnlyResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/zato-jobs":{"get":{"tags":["fyi"],"summary":"List Zato jobs","description":"All non-deleted Zato jobs for the firm joined with client names (the\nmapping wizard's left panel).","operationId":"list_zato_jobs_api_v1_integrations_fyi_zato_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ZatoJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/entities":{"get":{"tags":["fyi"],"summary":"List cached FYI entities","description":"FYI entities read from the local cache (fyi_entity_cache), joined with\nany Zato client mapping.","operationId":"list_fyi_entities_api_v1_integrations_fyi_entities_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiEntitiesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/jobs":{"get":{"tags":["fyi"],"summary":"List cached FYI jobs","description":"FYI jobs read from the local cache, joined with folder → Zato job\nmappings; optionally filtered by entity and search.","operationId":"list_fyi_jobs_api_v1_integrations_fyi_jobs_get","parameters":[{"name":"entity_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Entity Id"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiJobsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/mappings":{"get":{"tags":["fyi"],"summary":"List FYI job mappings","description":"All folder-level FYI job → Zato job mappings for the firm.","operationId":"list_mappings_api_v1_integrations_fyi_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JobMappingsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["fyi"],"summary":"Save FYI job mappings","description":"Upsert FYI job → Zato job folder mappings (soft-deactivate any existing\nactive mapping, then insert). Returns the saved count.","operationId":"save_mappings_api_v1_integrations_fyi_mappings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveMappingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SavedCountResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/mappings/{zato_job_uuid}":{"delete":{"tags":["fyi"],"summary":"Unmap a Zato job","description":"Soft-deactivate all active FYI folder mappings pointing at this Zato job.","operationId":"unmap_job_api_v1_integrations_fyi_mappings__zato_job_uuid__delete","parameters":[{"name":"zato_job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Zato Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemovedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/sync":{"post":{"tags":["fyi"],"summary":"Start a background FYI sync","description":"Schedule a full FYI sync off the request loop and return 202 immediately.\n\nThe FYI entity list is large + heavy (thousands of rows, ~25-60s/page), so a\nsynchronous handler would block the loop and time out the browser. The\nbackground task commits per-page; the UI polls /sync-status for live progress.","operationId":"sync_now_api_v1_integrations_fyi_sync_post","parameters":[{"name":"jobs","in":"query","required":false,"schema":{"type":"boolean","description":"Also sync jobs for mapped clients","default":true,"title":"Jobs"},"description":"Also sync jobs for mapped clients"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncStartedResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/sync-status":{"get":{"tags":["fyi"],"summary":"Get FYI sync status","description":"Current FYI sync state for the firm: status, entity/job counts, last\nsynced time and last error.","operationId":"sync_status_api_v1_integrations_fyi_sync_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncStatusOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/entity-filter-options":{"get":{"tags":["fyi"],"summary":"List entity filter options","description":"Distinct group / manager / partner names of active cached FYI entities,\nfor the picker's filter dropdowns.","operationId":"entity_filter_options_api_v1_integrations_fyi_entity_filter_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EntityFilterOptionsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/auto-map-fuzzy":{"post":{"tags":["fyi"],"summary":"Auto-map clients by name similarity","description":"Suggest FYI entity → client mappings whose normalised names match at or\nabove the similarity threshold.","operationId":"auto_map_fuzzy_api_v1_integrations_fyi_auto_map_fuzzy_post","parameters":[{"name":"threshold","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.5,"description":"Minimum normalised-name similarity (0.5-1.0) for a suggested match; higher = stricter.","examples":[0.8],"default":0.8,"title":"Threshold"},"description":"Minimum normalised-name similarity (0.5-1.0) for a suggested match; higher = stricter."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AutoMapFuzzyResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/cabinets":{"get":{"tags":["fyi"],"summary":"List cached FYI cabinets","description":"Cached FYI cabinets for the firm (name, type, flags), each marked with\nwhether it is hidden.","operationId":"list_cabinets_api_v1_integrations_fyi_cabinets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CabinetsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/sync-cabinets":{"post":{"tags":["fyi"],"summary":"Sync FYI cabinets","description":"Fetch the cabinet list live from FYI and upsert it into the local cache;\nrequires stored FYI credentials. Returns the cabinet count.","operationId":"sync_cabinets_api_v1_integrations_fyi_sync_cabinets_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncCabinetsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/hidden-cabinets":{"post":{"tags":["fyi"],"summary":"Set hidden FYI cabinets","description":"Replace the firm's hidden-cabinet set with the given cabinet ids.","operationId":"set_hidden_cabinets_api_v1_integrations_fyi_hidden_cabinets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetHiddenCabinetsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HiddenCabinetsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/fyi/job-suggestions":{"post":{"tags":["fyi"],"summary":"Suggest a Zato job for each FYI job","description":"Match each FYI job to the best Zato job for its client via the shared name\nmatcher (client-name tokens stripped both sides, scored on the short + full name).\nPure scoring over the names the drawer already loaded — a still-live saved mapping\nwins (origin 'manual'), else the best fuzzy match that clears the threshold, else\nnone. A human confirms every pick in the drawer before it persists.","operationId":"suggest_jobs_api_v1_integrations_fyi_job_suggestions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FyiJobSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiJobSuggestResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/fyi/ai-map":{"post":{"tags":["fyi"],"summary":"Dispatch a FYI AI mapping run","description":"Kick off an AI pass that reads the firm's active FYI entities + jobs and its Zato\nclient/job book and proposes the best Zato client for each FYI entity + the best Zato\njob for each FYI job. Returns 202 {run_id}; the run executes off the edge loop and\nstreams progress on the run banner. Nothing is mapped until a human confirms the\npre-filled picks in the mapping drawer.","operationId":"dispatch_fyi_map_api_v1_zbox_integrations_fyi_ai_map_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FyiAiMapDispatchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/zbox/integrations/fyi/ai-map/{run_id}":{"get":{"tags":["fyi"],"summary":"Get a FYI AI mapping run's proposals","description":"The entity/job maps from a FYI AI mapping run (poll after the run banner reports\ndone). 404 if the run is missing/expired or owned by another user; both maps are\nempty until the run completes. Confirming a pick reuses the existing FYI save routes\n— nothing here persists.","operationId":"get_fyi_map_proposals_api_v1_zbox_integrations_fyi_ai_map__run_id__get","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/Envelope_FyiAiMapProposalsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/process":{"post":{"tags":["gl"],"summary":"Process an uploaded GL file","description":"Parse an uploaded GL file (Excel/CSV) via the Rust engine and store rows\nin general_ledger (source_type='uploaded'). The file must already be in ZBox\n(uploaded via POST /zbox/files/upload).","operationId":"process_gl_file_api_v1_gl_files__file_uuid__process_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"gl_year","in":"query","required":true,"schema":{"type":"string","description":"Required. Fiscal year string the GL rows are stamped with, e.g. '2025'. Pass an empty string only to let the Rust engine auto-detect the year from the file's transaction dates.","examples":["2025"],"title":"Gl Year"},"description":"Required. Fiscal year string the GL rows are stamped with, e.g. '2025'. Pass an empty string only to let the Rust engine auto-detect the year from the file's transaction dates."},{"name":"client_uuid","in":"query","required":false,"schema":{"type":"string","description":"Optional. Client UUID to scope this GL to. If omitted/empty the backend derives it from the file's client tags (zbox_links); a job-only upload resolves it from the job.","examples":["c1f2e3d4-5a6b-7c8d-9e0f-112233445566"],"default":"","title":"Client Uuid"},"description":"Optional. Client UUID to scope this GL to. If omitted/empty the backend derives it from the file's client tags (zbox_links); a job-only upload resolves it from the job."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. Job UUID this GL upload belongs to.","examples":["j1f2e3d4-5a6b-7c8d-9e0f-112233445566"],"title":"Job Uuid"},"description":"Optional. Job UUID this GL upload belongs to."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlProcessResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/rows":{"get":{"tags":["gl"],"summary":"Preview extracted GL rows","description":"Return the extracted GL rows stored for an uploaded file — the data behind\nthe in-app preview. Reads from general_ledger (never the raw file).","operationId":"preview_gl_rows_api_v1_gl_files__file_uuid__rows_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Optional. Max rows to return (1–1000, default 200).","examples":[200],"default":200,"title":"Limit"},"description":"Optional. Max rows to return (1–1000, default 200)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Optional. Row offset for pagination (default 0).","examples":[0],"default":0,"title":"Offset"},"description":"Optional. Row offset for pagination (default 0)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlPreviewResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/columns":{"get":{"tags":["gl"],"summary":"Check GL column coverage","description":"Report which expected GL columns the uploaded file has and which required\nones are missing — so the UI can ask the user to map them. Read-only.","operationId":"gl_column_check_api_v1_gl_files__file_uuid__columns_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ColumnCheckStatus_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/columns/apply":{"post":{"tags":["gl"],"summary":"Apply GL column mapping","description":"Rename the file's headers to Zato's expected columns per the mapping, then\nre-extract (replacing the prior mis-parsed rows for this file).","operationId":"gl_apply_column_mapping_api_v1_gl_files__file_uuid__columns_apply_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ColumnMappingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ColumnMappingResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/tracking-columns":{"get":{"tags":["gl"],"summary":"List tracking column candidates","description":"This file's unrecognized columns to offer as tracking categories — the\nmanual tracking step of the upload flow (after column mapping).","operationId":"gl_tracking_columns_api_v1_gl_files__file_uuid__tracking_columns_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingColumnsPending_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/tracking-columns/apply":{"post":{"tags":["gl"],"summary":"Apply tracking columns","description":"Tag the chosen columns as tracking → write tracking + client_tracking.","operationId":"gl_apply_tracking_columns_api_v1_gl_files__file_uuid__tracking_columns_apply_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ColumnsApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingColumnsApplyResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/opening-balance":{"get":{"tags":["gl"],"summary":"Assess opening balance status","description":"Assess opening balances for an uploaded GL: whether any opening row exists,\nwhich balance-sheet accounts are missing one, and whether a prior-year trial\nbalance is available to import from. Read-only.","operationId":"opening_balance_status_api_v1_gl_files__file_uuid__opening_balance_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OpeningBalanceStatus_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl/files/{file_uuid}/opening-balance/resolve":{"post":{"tags":["gl"],"summary":"Resolve missing opening balances","description":"Fill missing opening rows — method='zero' (open every missing account at 0)\nor 'import_tb' (balance-sheet accounts open at the prior-year TB closing\nbalance; P&L always 0). Idempotent: accounts with an opening row are skipped.","operationId":"resolve_opening_balance_api_v1_gl_files__file_uuid__opening_balance_resolve_post","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveOpeningRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OpeningBalanceResolution_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules":{"post":{"tags":["gl-rules"],"summary":"Create a GL scrutiny rule","description":"Create a GL-scrutiny rule at FIRM or CLIENT scope for the caller's firm\n(validates the rule payload and rejects duplicates).","operationId":"create_rule_api_v1_gl_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleWriteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WriteResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules/org":{"get":{"tags":["gl-rules"],"summary":"List the firm's rules","description":"List the firm's rules (optionally filtered to one client). Legacy contract:\nwithout ``is_data`` it returns the client list only (the filter source).","operationId":"list_rules_api_v1_gl_rules_org_get","parameters":[{"name":"is_data","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. Any truthy value returns the rules list; omit to get the client filter-source list only (legacy contract).","examples":["true"],"title":"Is Data"},"description":"Optional. Any truthy value returns the rules list; omit to get the client filter-source list only (legacy contract)."},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. Restrict the rules list to one client (UUID). Takes precedence over client_uuid_filter.","title":"Client Uuid"},"description":"Optional. Restrict the rules list to one client (UUID). Takes precedence over client_uuid_filter."},{"name":"client_uuid_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. Alternate client-UUID filter, used only when client_uuid is absent.","title":"Client Uuid Filter"},"description":"Optional. Alternate client-UUID filter, used only when client_uuid is absent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_RuleListItem__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules/dropdown":{"get":{"tags":["gl-rules"],"summary":"Get rule builder dropdown data","description":"Dropdown source data for the rule-builder form — the firm's clients and\nthe COA account options.","operationId":"dropdown_api_v1_gl_rules_dropdown_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DropdownResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules/bulk-upload":{"put":{"tags":["gl-rules"],"summary":"Bulk-allocate rules to clients","description":"Allocate the given rules to many clients in one request (all firm clients\nwhen ``client_uuids`` is empty); reports how many rules were created.","operationId":"bulk_upload_api_v1_gl_rules_bulk_upload_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WriteResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules/{condition_id}":{"get":{"tags":["gl-rules"],"summary":"Get one rule","description":"Return one rule with its account and client allocations (404 if missing).","operationId":"get_rule_api_v1_gl_rules__condition_id__get","parameters":[{"name":"condition_id","in":"path","required":true,"schema":{"type":"integer","title":"Condition Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RuleEditShape_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"tags":["gl-rules"],"summary":"Update a rule","description":"Update an existing rule's definition and scope (validates the payload;\n404 if the rule does not exist).","operationId":"update_rule_api_v1_gl_rules__condition_id__put","parameters":[{"name":"condition_id","in":"path","required":true,"schema":{"type":"integer","title":"Condition Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleWriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WriteResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["gl-rules"],"summary":"Delete a rule","description":"Delete a rule at FIRM scope, or detach it from one client with\n``scope=CLIENT`` (which then requires ``client_uuid``).","operationId":"delete_rule_api_v1_gl_rules__condition_id__delete","parameters":[{"name":"condition_id","in":"path","required":true,"schema":{"type":"integer","title":"Condition Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"Delete scope. 'FIRM' (default) deletes the rule; 'CLIENT' detaches it from a single client (then client_uuid is required).","examples":["FIRM"],"default":"FIRM","title":"Scope"},"description":"Delete scope. 'FIRM' (default) deletes the rule; 'CLIENT' detaches it from a single client (then client_uuid is required)."},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Client UUID to detach. Required when scope='CLIENT'; ignored for FIRM scope.","title":"Client Uuid"},"description":"Client UUID to detach. Required when scope='CLIENT'; ignored for FIRM scope."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConditionIdResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-rules/{condition_id}/toggle":{"put":{"tags":["gl-rules"],"summary":"Toggle a rule active/inactive","description":"Flip a rule between active and inactive (a GLOBAL rule is first cloned to\nFIRM scope so the toggle never mutates the shared global row).","operationId":"toggle_rule_api_v1_gl_rules__condition_id__toggle_put","parameters":[{"name":"condition_id","in":"path","required":true,"schema":{"type":"integer","title":"Condition Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ToggleResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-scrutiny/jobs/{job_uuid}/gl-status":{"get":{"tags":["gl-scrutiny"],"summary":"Check job GL availability","description":"Report whether the job already has current-/last-year GL stored (Xero-built\nor uploaded), so the tool can skip straight to analysis. Read-only.","operationId":"gl_status_api_v1_gl_scrutiny_jobs__job_uuid__gl_status_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlStatusResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-scrutiny/jobs/{job_uuid}/manual-gl":{"post":{"tags":["gl-scrutiny"],"summary":"Upload one year's GL manually","description":"Manually upload one year's GL for a job — reuses the zbox + GL pipeline,\nDB-safely (explicit year, clears prior manual rows for that year first).","operationId":"manual_gl_upload_api_v1_gl_scrutiny_jobs__job_uuid__manual_gl_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_manual_gl_upload_api_v1_gl_scrutiny_jobs__job_uuid__manual_gl_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualGlUploadResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/gl-scrutiny/jobs/{job_uuid}/analyze":{"post":{"tags":["gl-scrutiny"],"summary":"Run GL scrutiny analysis","description":"Run the combined GL-scrutiny engine (analytical detectors + firm rules) over\nthe job's stored CY/PY GL and return the AnalysisResult. Compute-on-demand —\nnothing is persisted.","operationId":"analyze_job_api_v1_gl_scrutiny_jobs__job_uuid__analyze_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlAnalysisResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}":{"get":{"tags":["tracking"],"summary":"Get the client's tracking schema","description":"The client's tracking schema (categories + options), each annotated with\n`used` so the UI can enable/disable the guarded delete.","operationId":"get_tracking_schema_api_v1_tracking__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/pending-columns":{"get":{"tags":["tracking"],"summary":"List pending tracking columns","description":"Unrecognized manual-GL upload columns staged for this client that aren't\ntagged yet — the drawer surfaces these to tag as tracking categories.","operationId":"pending_columns_api_v1_tracking__client_uuid__pending_columns_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PendingColumnsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/columns/apply":{"post":{"tags":["tracking"],"summary":"Tag upload columns as tracking categories","description":"Tag the chosen upload columns → promote into general_ledger.tracking\nin place + derive the client schema.","operationId":"apply_columns_api_v1_tracking__client_uuid__columns_apply_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ColumnsApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/categories":{"post":{"tags":["tracking"],"summary":"Create a tracking category","description":"Add a tracking category — created locally as `manual`; it reaches Xero only\non an explicit \"Sync with Xero\". Returns the refreshed schema.","operationId":"create_category_api_v1_tracking__client_uuid__categories_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/categories/{category_id}":{"patch":{"tags":["tracking"],"summary":"Update a tracking category","description":"Rename and/or archive/restore a category. A rename propagates into\ngeneral_ledger.tracking and, for a Xero-sourced category, updates Xero too.","operationId":"patch_category_api_v1_tracking__client_uuid__categories__category_id__patch","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["tracking"],"summary":"Delete a tracking category","description":"Guarded delete — 409 if the category is used on any GL transaction\n(archive it instead).","operationId":"delete_category_api_v1_tracking__client_uuid__categories__category_id__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/categories/{category_id}/options":{"post":{"tags":["tracking"],"summary":"Add a tracking option","description":"Add an option to a category (name unique within it, capped). Created in Xero\nimmediately when the category is Xero-sourced. Returns the refreshed schema.","operationId":"create_option_api_v1_tracking__client_uuid__categories__category_id__options_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/categories/{category_id}/options/{option_id}":{"patch":{"tags":["tracking"],"summary":"Update a tracking option","description":"Rename and/or archive/restore an option. A rename propagates into\ngeneral_ledger.tracking and, for a Xero-sourced category, updates Xero too.","operationId":"patch_option_api_v1_tracking__client_uuid__categories__category_id__options__option_id__patch","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"option_id","in":"path","required":true,"schema":{"type":"string","title":"Option Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["tracking"],"summary":"Delete a tracking option","description":"Guarded delete — 409 if the option is used on any GL transaction.","operationId":"delete_option_api_v1_tracking__client_uuid__categories__category_id__options__option_id__delete","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"option_id","in":"path","required":true,"schema":{"type":"string","title":"Option Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingSchemaResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tracking/{client_uuid}/sync":{"post":{"tags":["tracking"],"summary":"Sync tracking categories with Xero","description":"Two-way sync — pull Xero's categories and push local-only manual items. If\nthey fit under Xero's caps they're pushed automatically; if they'd breach the\ncaps, a cap-resolution approval is raised to choose which to send.","operationId":"sync_with_xero_api_v1_tracking__client_uuid__sync_post","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/users":{"get":{"tags":["partner-api"],"summary":"List firm users (partner API)","description":"Paginated list of the key's firm's users, with optional name search.\nRequires the ``users:read`` API-key scope.","operationId":"list_users_api_v1_partner_users_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Optional case-insensitive name/email search filter.","examples":["jane"],"title":"Search"},"description":"Optional case-insensitive name/email search filter."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number.","examples":[1],"default":1,"title":"Page"},"description":"1-based page number."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page (1–200).","examples":[50],"default":50,"title":"Page Size"},"description":"Rows per page (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerUserList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/clients":{"get":{"tags":["partner-api"],"summary":"List clients (partner API)","description":"Paginated list of the firm's clients, filterable by name search and\n``updated_since``. Requires the ``clients:read`` API-key scope.","operationId":"list_clients_api_v1_partner_clients_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Optional case-insensitive client-name search filter.","examples":["Acme"],"title":"Search"},"description":"Optional case-insensitive client-name search filter."},{"name":"updated_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional ISO-8601 date/datetime; only clients updated at or after this are returned.","examples":["2026-01-31"],"title":"Updated Since"},"description":"Optional ISO-8601 date/datetime; only clients updated at or after this are returned."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number.","examples":[1],"default":1,"title":"Page"},"description":"1-based page number."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page (1–200).","examples":[50],"default":50,"title":"Page Size"},"description":"Rows per page (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerClientList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/clients/{client_uuid}":{"get":{"tags":["partner-api"],"summary":"Get one client (partner API)","description":"Fetch a single firm-scoped client by UUID (404 if not the key's firm's).\nRequires the ``clients:read`` API-key scope.","operationId":"get_client_api_v1_partner_clients__client_uuid__get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerClientOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/clients/{client_uuid}/jobs":{"get":{"tags":["partner-api"],"summary":"List a client's jobs","description":"Paginated list of one client's jobs (client must belong to the key's firm).\nRequires the ``jobs:read`` API-key scope.","operationId":"list_client_jobs_api_v1_partner_clients__client_uuid__jobs_get","parameters":[{"name":"client_uuid","in":"path","required":true,"schema":{"type":"string","title":"Client Uuid"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number.","examples":[1],"default":1,"title":"Page"},"description":"1-based page number."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page (1–200).","examples":[50],"default":50,"title":"Page Size"},"description":"Rows per page (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/jobs":{"get":{"tags":["partner-api"],"summary":"List jobs (partner API)","description":"Paginated list of the firm's jobs, filterable by client, status and\nfinancial year. Requires the ``jobs:read`` API-key scope.","operationId":"list_jobs_api_v1_partner_jobs_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional client UUID filter (only that client's jobs).","examples":["81bee014-b346-4256-837b-584a9e6f41da"],"title":"Client Uuid"},"description":"Optional client UUID filter (only that client's jobs)."},{"name":"status_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional job-status id filter.","examples":[3],"title":"Status Id"},"description":"Optional job-status id filter."},{"name":"financial_year","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"description":"Optional financial-year filter.","examples":["2026"],"title":"Financial Year"},"description":"Optional financial-year filter."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number.","examples":[1],"default":1,"title":"Page"},"description":"1-based page number."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page (1–200).","examples":[50],"default":50,"title":"Page Size"},"description":"Rows per page (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/jobs/{job_uuid}":{"get":{"tags":["partner-api"],"summary":"Get one job (partner API)","description":"Fetch a single firm-scoped job by UUID (404 if not the key's firm's).\nRequires the ``jobs:read`` API-key scope.","operationId":"get_job_api_v1_partner_jobs__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerJobOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/files/upload-urls":{"post":{"tags":["partner-api"],"summary":"Issue presigned file upload URLs","description":"Create an upload batch and return presigned PUT URLs — file bytes never\ntransit the backend; the registrar worker registers uploads afterwards.\nRequires the ``files:write`` API-key scope.","operationId":"issue_upload_urls_api_v1_partner_files_upload_urls_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadUrlsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/files":{"get":{"tags":["partner-api"],"summary":"Poll an upload batch's status","description":"Per-file status of an upload batch. Accepts the ``files:read`` or\n``files:write`` API-key scope (rate-limited in the files:read bucket).","operationId":"batch_status_api_v1_partner_files_get","parameters":[{"name":"batch_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"REQUIRED. The upload batch id returned by POST /partner/files/upload-urls.","examples":["3f2504e0-4f89-41d3-9a0c-0305e82c3301"],"title":"Batch Id"},"description":"REQUIRED. The upload batch id returned by POST /partner/files/upload-urls."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerBatchStatus_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/queries":{"get":{"tags":["partner-api"],"summary":"List queries (partner API)","description":"Paginated list of the firm's job queries, filterable by client, job,\nresolution state and type. Requires the ``queries:read`` API-key scope.","operationId":"list_queries_api_v1_partner_queries_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional client UUID filter.","examples":["81bee014-b346-4256-837b-584a9e6f41da"],"title":"Client Uuid"},"description":"Optional client UUID filter."},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional job UUID filter.","examples":["6f9619ff-8b86-d011-b42d-00cf4fc964ff"],"title":"Job Uuid"},"description":"Optional job UUID filter."},{"name":"is_resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Optional resolution-state filter (true=resolved, false=open).","examples":[false],"title":"Is Resolved"},"description":"Optional resolution-state filter (true=resolved, false=open)."},{"name":"query_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"description":"Optional query-type filter.","examples":["missing_info"],"title":"Query Type"},"description":"Optional query-type filter."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number.","examples":[1],"default":1,"title":"Page"},"description":"1-based page number."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page (1–200).","examples":[50],"default":50,"title":"Page Size"},"description":"Rows per page (1–200)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerQueryList_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/queries/{query_uuid}":{"get":{"tags":["partner-api"],"summary":"Get one query with its thread","description":"Fetch one query with its response thread and attachments (404 if not the\nkey's firm's). Requires the ``queries:read`` API-key scope.","operationId":"get_query_api_v1_partner_queries__query_uuid__get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerQueryDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/partner/queries/{query_uuid}/response":{"put":{"tags":["partner-api"],"summary":"Add a response to a query","description":"Append a firm-user response (multipart; optional Zbox attachments) to a\nquery on behalf of ``responded_by``. Requires the ``queries:respond`` scope.","operationId":"respond_to_query_api_v1_partner_queries__query_uuid__response_put","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_respond_to_query_api_v1_partner_queries__query_uuid__response_put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PartnerQueryResponseOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/api-keys":{"get":{"tags":["integrations"],"summary":"List the firm's API keys","description":"List the firm's partner API keys (metadata only — never the secret or\nhash). Requires the ORG.PARTNER_API__MANAGE_API_KEYS permission.","operationId":"list_api_keys_api_v1_integrations_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ApiKeyOut__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["integrations"],"summary":"Create a partner API key","description":"Create a scoped partner API key for the firm. The full secret is returned\nexactly once here. Requires the ORG.PARTNER_API__MANAGE_API_KEYS permission.","operationId":"create_api_key_api_v1_integrations_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CreatedApiKey_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/integrations/api-keys/{key_uuid}":{"delete":{"tags":["integrations"],"summary":"Revoke a partner API key","description":"Revoke one of the firm's partner API keys by UUID. Requires the\nORG.PARTNER_API__MANAGE_API_KEYS permission.","operationId":"revoke_api_key_api_v1_integrations_api_keys__key_uuid__delete","parameters":[{"name":"key_uuid","in":"path","required":true,"schema":{"type":"string","title":"Key Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RevokedApiKeyAck_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/request-otp":{"post":{"tags":["questionnaire-recipient"],"summary":"Request an OTP via magic link","description":"Exchange a magic-link token for a pre-session and email an OTP to the\nparticipant. Throttled; an invalid token returns 401 without enumeration.","operationId":"request_otp_api_v1_questionnaire_r_request_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestOtpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RequestOtpResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/verify-otp":{"post":{"tags":["questionnaire-recipient"],"summary":"Verify the OTP and start a session","description":"Verify the emailed code and set the scoped recipient session cookie\n(httpOnly, SameSite=strict).","operationId":"verify_otp_route_api_v1_questionnaire_r_verify_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__questionnaire__schemas_recipient__VerifyOtpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/form":{"get":{"tags":["questionnaire-recipient"],"summary":"Get the questionnaire form","description":"Return the invitation's snapshot questions grouped by section, with saved\nanswers and files. Auth via the recipient session cookie.","operationId":"get_form_api_v1_questionnaire_r_form_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecipientFormResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/draft":{"put":{"tags":["questionnaire-recipient"],"summary":"Save draft answers","description":"Upsert draft answers (current owner only); a freshly sent invitation moves\nto in_progress.","operationId":"save_draft_api_v1_questionnaire_r_draft_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/submit":{"post":{"tags":["questionnaire-recipient"],"summary":"Submit the questionnaire","description":"Validate every required question is answered, then mark the invitation\nsubmitted (current owner only).","operationId":"submit_api_v1_questionnaire_r_submit_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/reassign":{"post":{"tags":["questionnaire-recipient"],"summary":"Reassign the questionnaire owner","description":"Hand ownership to another person; a brand-new participant is emailed a fresh\nmagic link.","operationId":"reassign_api_v1_questionnaire_r_reassign_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/reclaim":{"post":{"tags":["questionnaire-recipient"],"summary":"Reclaim questionnaire editing","description":"Take ownership back to the caller; a submitted invitation returns to\nin_progress.","operationId":"reclaim_api_v1_questionnaire_r_reclaim_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/files":{"post":{"tags":["questionnaire-recipient"],"summary":"Upload a file for an answer","description":"Upload one file via ZBox and attach it to the question's answer (current\nowner only), creating the answer row if needed.","operationId":"upload_file_api_v1_questionnaire_r_files_post","parameters":[{"name":"snapshot_question_uuid","in":"query","required":true,"schema":{"type":"string","description":"snapshot_question_uuid of the question to attach the file to; resolved unguarded (404 if unknown).","examples":["b1e2f3a4-5c6d-7e8f-9a0b-1c2d3e4f5061"],"title":"Snapshot Question Uuid"},"description":"snapshot_question_uuid of the question to attach the file to; resolved unguarded (404 if unknown)."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_v1_questionnaire_r_files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecipientUploadResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/files/{file_uuid}":{"delete":{"tags":["questionnaire-recipient"],"summary":"Delete a file","description":"Remove a file the current owner attached to an answer (current owner only).","operationId":"delete_file_api_v1_questionnaire_r_files__file_uuid__delete","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/files/{file_uuid}/view-url":{"get":{"tags":["questionnaire-recipient"],"summary":"Get the view URL for a file","description":"Return a browser-viewable URL for a file attached to this invitation's answer.","operationId":"get_file_view_url_api_v1_questionnaire_r_files__file_uuid__view_url_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_FileViewUrlResponse___2"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/r/logout":{"post":{"tags":["questionnaire-recipient"],"summary":"End the recipient session","description":"Drop the recipient's Redis session (if any) and clear the session cookie.","operationId":"logout_api_v1_questionnaire_r_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/master-groups":{"get":{"tags":["questionnaire"],"summary":"List Zato master questionnaire groups","description":"Return the Zato master questionnaire groups available for adoption.","operationId":"list_master_groups_api_v1_questionnaire_master_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MasterGroup__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups":{"get":{"tags":["questionnaire"],"summary":"List the firm's questionnaire templates","description":"Return the firm's questionnaire templates with section and question counts.","operationId":"list_groups_api_v1_questionnaire_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_EntityGroupSummary__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["questionnaire"],"summary":"Create a blank questionnaire template","description":"Create an empty firm-owned questionnaire template and return its UUID.","operationId":"create_group_api_v1_questionnaire_groups_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/adopt":{"post":{"tags":["questionnaire"],"summary":"Adopt a master questionnaire group","description":"Copy a Zato master group (sections + questions) into a firm-owned template.\nIdempotent — returns the existing copy's UUID if the firm already adopted it.","operationId":"adopt_group_api_v1_questionnaire_groups_adopt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdoptGroupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/duplicate":{"post":{"tags":["questionnaire"],"summary":"Duplicate a questionnaire template","description":"Deep-copy a firm template (sections + questions) under a new name and return\nthe new group's UUID.","operationId":"duplicate_group_api_v1_questionnaire_groups__group_uuid__duplicate_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGroupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GroupRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}":{"patch":{"tags":["questionnaire"],"summary":"Rename a questionnaire template","description":"Rename a firm questionnaire template; 404 if not found.","operationId":"rename_group_api_v1_questionnaire_groups__group_uuid__patch","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameGroupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["questionnaire"],"summary":"Delete a questionnaire template","description":"Hard-delete a firm template together with all its sections and questions.","operationId":"delete_group_api_v1_questionnaire_groups__group_uuid__delete","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["questionnaire"],"summary":"Get a template with its questions","description":"Return one firm template with its ordered sections and questions.","operationId":"get_group_api_v1_questionnaire_groups__group_uuid__get","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EntityGroupDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/sections":{"post":{"tags":["questionnaire"],"summary":"Add a section to a template","description":"Append a new section to a firm template and return the section's UUID.","operationId":"add_section_api_v1_questionnaire_groups__group_uuid__sections_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SectionRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/sections/{section_uuid}/copy-to-group":{"post":{"tags":["questionnaire"],"summary":"Copy a section between templates","description":"Clone a section (with its questions) into another firm template and return\nthe new section's UUID.","operationId":"copy_section_to_group_api_v1_questionnaire_sections__section_uuid__copy_to_group_post","parameters":[{"name":"section_uuid","in":"path","required":true,"schema":{"type":"string","title":"Section Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopySectionToGroupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SectionRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/sections/{section_uuid}":{"delete":{"tags":["questionnaire"],"summary":"Delete a template section","description":"Hard-delete a section and every question under it.","operationId":"delete_section_api_v1_questionnaire_sections__section_uuid__delete","parameters":[{"name":"section_uuid","in":"path","required":true,"schema":{"type":"string","title":"Section Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/sections/{section_uuid}/questions":{"post":{"tags":["questionnaire"],"summary":"Add a question to a section","description":"Create a question in the section from the given info payload and return its\nentity template UUID.","operationId":"add_question_api_v1_questionnaire_sections__section_uuid__questions_post","parameters":[{"name":"section_uuid","in":"path","required":true,"schema":{"type":"string","title":"Section Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddQuestionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TemplateRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/sections/{section_uuid}/questions/paste":{"post":{"tags":["questionnaire"],"summary":"Paste a copied question","description":"Clone a copied question's info into the target section and return the new\ntemplate UUID.","operationId":"paste_question_api_v1_questionnaire_sections__section_uuid__questions_paste_post","parameters":[{"name":"section_uuid","in":"path","required":true,"schema":{"type":"string","title":"Section Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddQuestionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TemplateRef_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/questions/{template_uuid}":{"delete":{"tags":["questionnaire"],"summary":"Delete a question","description":"Hard-delete a single firm question by its entity template UUID.","operationId":"delete_question_api_v1_questionnaire_questions__template_uuid__delete","parameters":[{"name":"template_uuid","in":"path","required":true,"schema":{"type":"string","title":"Template Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["questionnaire"],"summary":"Update a question","description":"Replace a firm-level question's info with body.questions[0]; only FIRM-type\nquestions may be edited here.","operationId":"update_question_api_v1_questionnaire_questions__template_uuid__patch","parameters":[{"name":"template_uuid","in":"path","required":true,"schema":{"type":"string","title":"Template Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuestionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/refresh/diff":{"get":{"tags":["questionnaire"],"summary":"Diff a template against its master","description":"Compute added / changed / removed question deltas between the firm copy and\nits Zato master source (read-only preview).","operationId":"refresh_diff_api_v1_questionnaire_groups__group_uuid__refresh_diff_get","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RefreshDiff_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/refresh/apply":{"post":{"tags":["questionnaire"],"summary":"Apply refresh-from-master changes","description":"Merge accepted master deltas into the firm copy (accept_all or an explicit\nUUID list) and return how many changes were applied.","operationId":"refresh_apply_api_v1_questionnaire_groups__group_uuid__refresh_apply_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RefreshApplyResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/client-copy/options":{"get":{"tags":["questionnaire"],"summary":"Prior-year options for a client's questionnaire copy","description":"Report whether the client already has a copy of this firm template for another\nfinancial year, so the editor can offer 'start from firm template' vs 'last year'.","operationId":"client_copy_options_api_v1_questionnaire_groups__group_uuid__client_copy_options_get","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}},{"name":"client_uuid","in":"query","required":true,"schema":{"type":"string","description":"Client the questionnaire is customized for.","title":"Client Uuid"},"description":"Client the questionnaire is customized for."},{"name":"financial_year","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Financial year of the copy about to be edited.","title":"Financial Year"},"description":"Financial year of the copy about to be edited."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClientCopyOptions_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/client-copy":{"post":{"tags":["questionnaire"],"summary":"Materialize a client's editable questionnaire copy","description":"Create (or fetch) the client's per-year copy of a firm template and return it\nwith its sections and questions. Customizing this copy never touches the firm\ntemplate or another client (Bug 7232).","operationId":"prepare_client_copy_api_v1_questionnaire_groups__group_uuid__client_copy_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareClientCopyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EntityGroupDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/groups/{group_uuid}/send":{"post":{"tags":["questionnaire"],"summary":"Send a questionnaire to a client","description":"Snapshot the template into a client invitation, mint the recipient's\nmagic-link token, and email it. Rejects a duplicate send for the same client\nand period.","operationId":"send_questionnaire_api_v1_questionnaire_groups__group_uuid__send_post","parameters":[{"name":"group_uuid","in":"path","required":true,"schema":{"type":"string","title":"Group Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__questionnaire__schemas__SendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_SendResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations":{"get":{"tags":["questionnaire"],"summary":"List questionnaire invitations","description":"Return the firm's questionnaire invitations, optionally filtered by client.","operationId":"list_invitations_api_v1_questionnaire_invitations_get","parameters":[{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter invitations to one client by client_uuid; omit for all.","examples":["9c2f1a7b-3d4e-5f60-7182-93a4b5c6d7e8"],"title":"Client Uuid"},"description":"Filter invitations to one client by client_uuid; omit for all."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_InvitationSummary__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations/{invitation_uuid}":{"get":{"tags":["questionnaire"],"summary":"Get invitation answers and history","description":"Return one invitation with its answers, attached files, participants, and\nownership trail.","operationId":"invitation_detail_api_v1_questionnaire_invitations__invitation_uuid__get","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InvitationDetail_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations/{invitation_uuid}/files/{file_uuid}/url":{"get":{"tags":["questionnaire"],"summary":"Get an answer file view URL","description":"Return a browser-viewable URL for a file uploaded against an answer.","operationId":"file_view_url_api_v1_questionnaire_invitations__invitation_uuid__files__file_uuid__url_get","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileUrlResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations/{invitation_uuid}/reopen":{"post":{"tags":["questionnaire"],"summary":"Reopen a submitted questionnaire","description":"Reopen a questionnaire for editing (optionally clearing saved answers) and\nemail the current owner.","operationId":"reopen_invitation_api_v1_questionnaire_invitations__invitation_uuid__reopen_post","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations/{invitation_uuid}/remind":{"post":{"tags":["questionnaire"],"summary":"Send a reminder email","description":"Email a reminder to the invitation's current owner.","operationId":"remind_invitation_api_v1_questionnaire_invitations__invitation_uuid__remind_post","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/questionnaire/invitations/{invitation_uuid}/resend":{"post":{"tags":["questionnaire"],"summary":"Re-send the invitation email","description":"Re-send the questionnaire email to the invitation's current owner.","operationId":"resend_invitation_api_v1_questionnaire_invitations__invitation_uuid__resend_post","parameters":[{"name":"invitation_uuid","in":"path","required":true,"schema":{"type":"string","title":"Invitation Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OkResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/workspace/search":{"get":{"tags":["workspace"],"summary":"Search clients and jobs","description":"Combined client+job search (partial + fuzzy) for the workspace selector,\nscoped to the caller's firm and access policy: Director (firm-wide bypass)\nsees all; everyone else sees a client/job only when it is BOTH in one of their\nbranches AND assigned to them (branch ∧ assignment).","operationId":"workspace_search_api_v1_workspace_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":128,"default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkspaceSearchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/batch":{"get":{"tags":["queries","queries-batch"],"summary":"List the batch buckets","description":"Return the firm's batch buckets — queued and already-pushed queries — fully\nserialized for the batch view.","operationId":"get_batch_buckets_api_v1_queries_batch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchBucketsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["queries","queries-batch"],"summary":"Create multiple queries at once","description":"Create each query in the payload and return the created UUIDs. Every create\ncommits individually and emits its own query_created decision event.","operationId":"batch_create_api_v1_queries_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchCreateOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/batch/flag":{"post":{"tags":["queries","queries-batch"],"summary":"Stage internal queries for the client","description":"Stage internal queries into the batch. Skips resolved / ignored / already-\nbatched queries; a pushed query may be re-staged only once the client replied.","operationId":"flag_batch_api_v1_queries_batch_flag_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUuidListIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchFlaggedOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/batch/move":{"post":{"tags":["queries","queries-batch"],"summary":"Move staged queries to batch","description":"Move queries into the Batch holding stage — marked pushed but still invisible\nto the client until the explicit /push step. Skips resolved/ignored/pushed.","operationId":"move_to_batch_api_v1_queries_batch_move_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUuidListIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchMovedOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/batch/push":{"post":{"tags":["queries","queries-batch"],"summary":"Send batched queries to the client","description":"Open (or re-open) a client visibility round per query — internal responses flip\nvisible and the query is marked pushed. Skips resolved/ignored/awaiting-client.","operationId":"push_to_client_api_v1_queries_batch_push_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUuidListIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchPushedOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/attachments/{file_uuid}/download":{"get":{"tags":["queries"],"summary":"Download a query attachment","description":"Serve an attachment's bytes same-origin (query tenancy checked first);\nS3 blobs are read server-side so the browser's blob XHR is never redirected\nto a CORS-blocked presigned URL.","operationId":"attachment_download_api_v1_queries__query_uuid__attachments__file_uuid__download_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Attachment bytes served same-origin.","content":{"application/json":{"schema":{}},"application/octet-stream":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/with-attachments":{"post":{"tags":["queries"],"summary":"Raise a query with attachments","description":"Create a query with 0..N attachments atomically — every file uploads first,\nthen the query row and file links commit together. Any failure rolls the submit\nback and soft-deletes the already-uploaded blobs.","operationId":"create_query_with_attachments_api_v1_queries_with_attachments_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_query_with_attachments_api_v1_queries_with_attachments_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/responses/with-attachments":{"post":{"tags":["queries"],"summary":"Add a response with attachments","description":"Add a thread response with 0..N attachments atomically — the response row and\nfile links commit together; a failure rolls back and soft-deletes the blobs.","operationId":"add_response_with_attachments_api_v1_queries__query_uuid__responses_with_attachments_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_response_with_attachments_api_v1_queries__query_uuid__responses_with_attachments_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResponseOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/assignees":{"get":{"tags":["queries","queries-investigation"],"summary":"List assignable investigators","description":"List internal users eligible for investigation assignment, optionally scoped\nto a query's job via query_uuid.","operationId":"list_assignees_api_v1_queries_assignees_get","parameters":[{"name":"query_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AssigneeListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/investigate":{"post":{"tags":["queries","queries-investigation"],"summary":"Assign a query investigator","description":"Assign an investigator to the query — until they reply, only they may respond.\nRejects resolved / ignored queries and ones currently awaiting the client.","operationId":"assign_investigation_api_v1_queries__query_uuid__investigate_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigateAssignIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["queries","queries-investigation"],"summary":"Clear a query's investigator","description":"Clear the query's investigator assignment; emits a decision event.","operationId":"clear_investigation_api_v1_queries__query_uuid__investigate_delete","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/subcontext-options":{"get":{"tags":["queries","queries"],"summary":"List sub-context options for a source","description":"Sub-context choices for the selected source + job (strict-with-fallback).\nWired sources: workpaper (applicable WPs), gl (job GL account codes).","operationId":"subcontext_options_api_v1_queries_subcontext_options_get","parameters":[{"name":"source_key","in":"query","required":true,"schema":{"type":"string","title":"Source Key"}},{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SubContextOptionsOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/sources":{"get":{"tags":["queries"],"summary":"List query sources","description":"Return the query source lookup rows for the raise-query dropdown.","operationId":"list_sources_api_v1_queries_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SourceListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries":{"get":{"tags":["queries"],"summary":"List queries with filters","description":"List the firm's queries matching the optional scope/status filters, plus a\ntotal count. Items carry source, job, client, and group display names.","operationId":"list_queries_api_v1_queries_get","parameters":[{"name":"job_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"}},{"name":"client_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},{"name":"group_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Uuid"}},{"name":"is_resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Resolved"}},{"name":"is_batch","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Batch"}},{"name":"is_ignored","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Ignored"}},{"name":"source_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Key"}},{"name":"query_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["queries"],"summary":"Raise a new query","description":"Create a query (always internal — client visibility comes via send-to-client).\nEmits a query_created decision event and a realtime frame to the firm.","operationId":"create_query_api_v1_queries_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}":{"get":{"tags":["queries"],"summary":"Get one query","description":"Return one firm-scoped query with its full serialized detail; 404 if unknown.","operationId":"get_query_api_v1_queries__query_uuid__get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["queries"],"summary":"Update query fields","description":"Update description / visibility / type / sub-context on a query. Emits a\nquery_updated decision event when anything actually changed.","operationId":"patch_query_api_v1_queries__query_uuid__patch","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["queries"],"summary":"Soft-delete a query","description":"Soft-delete a query (audit-logged); returns 204 with no body.","operationId":"delete_query_api_v1_queries__query_uuid__delete","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/resolve":{"post":{"tags":["queries"],"summary":"Resolve a query","description":"Mark the query resolved; emits a query_resolved decision event.","operationId":"resolve_query_api_v1_queries__query_uuid__resolve_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/reopen":{"post":{"tags":["queries"],"summary":"Reopen a resolved query","description":"Clear the resolved flag; emits a query_reopened decision event.","operationId":"reopen_query_api_v1_queries__query_uuid__reopen_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/ignore":{"post":{"tags":["queries"],"summary":"Ignore a query","description":"Mark the query ignored (triage); emits a query_ignored decision event.","operationId":"ignore_query_api_v1_queries__query_uuid__ignore_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/revert":{"post":{"tags":["queries"],"summary":"Revert a query's stage","description":"Un-ignore an ignored query, or move a non-ignored one back through the pipeline\n(to_internal=true forces a full reset to Internal).","operationId":"revert_query_api_v1_queries__query_uuid__revert_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"to_internal","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"To Internal"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/send-to-client":{"post":{"tags":["queries"],"summary":"Send one query to the client","description":"Open a client visibility round for one query — internal responses become\nclient-visible and the query is marked pushed. Rejects resolved / ignored /\nalready-awaiting-client queries.","operationId":"send_query_to_client_api_v1_queries__query_uuid__send_to_client_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/responses":{"get":{"tags":["queries"],"summary":"List a query's thread","description":"Return the query's response thread, paginated via limit/offset.","operationId":"list_responses_api_v1_queries__query_uuid__responses_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResponseListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["queries"],"summary":"Add a response to a query","description":"Append a message to the query thread and refresh its snapshot. While an\ninvestigator is assigned, only they may respond (their reply releases the lock).","operationId":"add_response_api_v1_queries__query_uuid__responses_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResponseOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/responses/{response_uuid}":{"patch":{"tags":["queries"],"summary":"Edit a response body","description":"Edit a response body (author-only); emits a query_response_edited event.","operationId":"edit_response_api_v1_queries__query_uuid__responses__response_uuid__patch","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"response_uuid","in":"path","required":true,"schema":{"type":"string","title":"Response Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsePatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResponseOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["queries"],"summary":"Delete a response","description":"Soft-delete a thread message (author-only) and refresh the query snapshot.","operationId":"delete_response_api_v1_queries__query_uuid__responses__response_uuid__delete","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"response_uuid","in":"path","required":true,"schema":{"type":"string","title":"Response Uuid"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/attachments":{"get":{"tags":["queries"],"summary":"List query attachments","description":"List all files linked to the query and its responses, with original file names\nand uploader display names.","operationId":"list_attachments_api_v1_queries__query_uuid__attachments_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AttachmentListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["queries"],"summary":"Upload a query attachment","description":"Upload one file via the ZBox spine and link it to the query (or to a specific\nresponse via response_uuid), then kick off best-effort auto-categorisation.","operationId":"upload_attachment_api_v1_queries__query_uuid__attachments_post","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_attachment_api_v1_queries__query_uuid__attachments_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AttachmentUploadOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/attachments/{file_uuid}/view-url":{"get":{"tags":["queries"],"summary":"Get attachment view URL","description":"Return a browser-viewable URL for an attachment (query tenancy checked first).","operationId":"attachment_view_url_api_v1_queries__query_uuid__attachments__file_uuid__view_url_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AttachmentViewUrlOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/attachments/{file_uuid}":{"delete":{"tags":["queries"],"summary":"Detach an attachment","description":"Unlink a file from the query (sets unlinked_at; the underlying blob is kept).","operationId":"detach_attachment_api_v1_queries__query_uuid__attachments__file_uuid__delete","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/queries/{query_uuid}/audit":{"get":{"tags":["queries"],"summary":"Get the query audit timeline","description":"Return recent query-domain decision events for the query's firm, newest first\n(up to `limit`).","operationId":"get_audit_api_v1_queries__query_uuid__audit_get","parameters":[{"name":"query_uuid","in":"path","required":true,"schema":{"type":"string","title":"Query Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuditListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}":{"get":{"tags":["wp-queries"],"summary":"List per-workpaper query candidates","description":"Missing-doc decisions + pending anomaly candidates for a job's workpapers.","operationId":"list_candidates_api_v1_wp_queries_jobs__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WpCandidatesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/candidates/discard":{"post":{"tags":["wp-queries"],"summary":"Discard a workpaper query candidate","description":"Mark a candidate discarded (materializes a row for a derived missing-doc).","operationId":"discard_candidate_api_v1_wp_queries_jobs__job_uuid__candidates_discard_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandidateDecisionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WpCandidateOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/candidates/mark-posted":{"post":{"tags":["wp-queries"],"summary":"Mark a candidate posted after raising its query","description":"Flag the candidate posted and link the created query's uuid.","operationId":"mark_candidate_posted_api_v1_wp_queries_jobs__job_uuid__candidates_mark_posted_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandidateDecisionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WpCandidateOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/workpapers/{wp_code}/analyze":{"post":{"tags":["wp-queries"],"summary":"Start a background workpaper-anomaly scan (via the Ziffy agent)","description":"Kick off the anomaly scan in the background (survives a refresh); poll the\nscans endpoint for status. Idempotent — a scan already running is a no-op.","operationId":"analyze_workpaper_api_v1_wp_queries_jobs__job_uuid__workpapers__wp_code__analyze_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ScanStartOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/scans":{"get":{"tags":["wp-queries"],"summary":"Per-workpaper anomaly-scan status for a job","description":"Latest scan status (running/done/failed) per workpaper for the job.","operationId":"list_scans_api_v1_wp_queries_jobs__job_uuid__scans_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ScanListOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/analyze":{"post":{"tags":["wp-queries"],"summary":"Generate anomaly query candidates across the job's workpapers","description":"Run the LLM anomaly detector across all the job's workpapers; persist + return candidates.","operationId":"analyze_job_api_v1_wp_queries_jobs__job_uuid__analyze_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AnalyzeAnomaliesOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/wp-queries/jobs/{job_uuid}/candidates/post":{"post":{"tags":["wp-queries"],"summary":"Post a candidate as a query (internal or external)","description":"Create the query (external ones are also sent to the client) and link the candidate.","operationId":"post_candidate_api_v1_wp_queries_jobs__job_uuid__candidates_post_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandidatePostIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WpCandidateOut_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}":{"get":{"tags":["supporting-docs"],"summary":"List a workpaper's supporting docs","description":"Supporting docs for a workpaper, GROUPED BY WpViewMap section: each section's placed files + a lazy\nper-section GL ledger; base + manually-linked-unplaced files fall into a 'General / Unfiled' group.","operationId":"list_supporting_docs_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SupportingDocSectionsResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/gl-value-scan":{"get":{"tags":["supporting-docs"],"summary":"Scan GL transactions by amount band","description":"GL transactions filtered by |amount| band, optionally restricted to one\nworkpaper's accounts (``wp_code``) or explicit ``account_code``s. Read-only.\n``wp_code=EXP&min_value=1000`` reproduces the expense-analysis / missing-doc\ncandidate scan. Returns matches (largest first) + a per-parent rollup; the\ncap is reported via ``truncated``.","operationId":"gl_value_scan_api_v1_supporting_docs_jobs__job_uuid__gl_value_scan_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"description":"Optional: restrict the scan to this workpaper's mapped accounts (e.g. the EXP expense-analysis scan). Omit to scan the whole GL.","examples":["EXP"],"title":"Wp Code"},"description":"Optional: restrict the scan to this workpaper's mapped accounts (e.g. the EXP expense-analysis scan). Omit to scan the whole GL."},{"name":"account_code","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Optional: restrict the scan to these explicit GL account codes (repeat the param). Omit to scan all accounts.","examples":[["6100","6200"]],"title":"Account Code"},"description":"Optional: restrict the scan to these explicit GL account codes (repeat the param). Omit to scan all accounts."},{"name":"min_value","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Optional lower bound on |amount| (inclusive). Omit for no lower bound.","examples":[1000],"title":"Min Value"},"description":"Optional lower bound on |amount| (inclusive). Omit for no lower bound."},{"name":"max_value","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Optional upper bound on |amount| (inclusive). Omit for no upper bound.","title":"Max Value"},"description":"Optional upper bound on |amount| (inclusive). Omit for no upper bound."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Max rows to return (1–1000). Defaults to 500; ``truncated`` flags an over-cap result.","default":500,"title":"Limit"},"description":"Max rows to return (1–1000). Defaults to 500; ``truncated`` flags an over-cap result."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlValueScanResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}/gl/{gl_key}":{"get":{"tags":["supporting-docs"],"summary":"Lazy-load a GL stub's transactions","description":"LAZY-load the GL transactions behind a GL-supporting stub (`file_uuid = gl:<wp>:<gl_key>`). Read-only —\nfetched only on view, NEVER runs automation (Z1's `lazy_load`).","operationId":"gl_supporting_data_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__gl__gl_key__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"gl_key","in":"path","required":true,"schema":{"type":"string","title":"Gl Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GlSupportingData_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/files/{file_uuid}/view-url":{"get":{"tags":["supporting-docs"],"summary":"Get a presigned file view URL","description":"Presigned GET URL (read-only). Viewing NEVER triggers re-automation.","operationId":"supporting_doc_view_url_api_v1_supporting_docs_files__file_uuid__view_url_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ViewUrlResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/files/{file_uuid}/extract":{"get":{"tags":["supporting-docs"],"summary":"Answer a question from one document","description":"Answer a free-text question from ONE document's content (PDF / image /\nWord / Excel). Read-only: the file is normalised and the question answered via\nai_gateway. Returns ``{file_name, query, answer}``.","operationId":"extract_from_file_api_v1_supporting_docs_files__file_uuid__extract_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Required free-text question to answer from the document's content (1–500 chars).","examples":["What is the closing balance?"],"title":"Query"},"description":"Required free-text question to answer from the document's content (1–500 chars)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileExtractAnswer_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/files/{file_uuid}/content":{"get":{"tags":["supporting-docs"],"summary":"Get a document's normalised content","description":"One document's NORMALISED content (markdown), no question — read-only, via\nai_gateway OCR. Use to pull a file's raw text/tables when a specific query isn't\nneeded. Returns ``{file_name, content, truncated}``.","operationId":"file_content_api_v1_supporting_docs_files__file_uuid__content_get","parameters":[{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FileContentResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}/attachable-files":{"get":{"tags":["supporting-docs"],"summary":"List files attachable to a workpaper","description":"The in-drawer Attach picker pool: the job's Zbox files minus the ones already attached to this workpaper\nand minus the job's own GL/TB ledgers. Read-only; searched client-side.","operationId":"attachable_files_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__attachable_files_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AttachableFilesResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/board":{"get":{"tags":["supporting-docs"],"summary":"List every workpaper's supporting docs (all-WP board)","description":"The 'zoom out to all workpapers' board — every workpaper with its real supporting files (GL stubs +\nledgers excluded). Read-only; feeds the in-drawer cross-WP move board.","operationId":"supporting_board_api_v1_supporting_docs_jobs__job_uuid__board_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BoardResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/files/{file_uuid}/reference":{"post":{"tags":["supporting-docs"],"summary":"Reference a file into another workpaper","description":"Reference a supporting file into another workpaper (drag A→B on the all-WP board) — a `wp_view_doc`\nplacement added to the target; the file STAYS on its home workpaper too (a reference, not a move). INERT:\nnever changes what feeds any workpaper's numbers. Emits a `supporting_doc_referenced` decision event.","operationId":"reference_in_wp_api_v1_supporting_docs_jobs__job_uuid__files__file_uuid__reference_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceInWpRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReferenceResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}/attach":{"post":{"tags":["supporting-docs"],"summary":"Attach a file to a workpaper","description":"Attach an existing Zbox file to the workpaper as supporting EVIDENCE — a base placement in `wp_view_doc`\n(idempotent, de-duped). INERT: attaching never triggers automation or feeds the run. Emits a\n`supporting_doc_attached` decision event.","operationId":"attach_supporting_doc_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__attach_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachSupportingDocRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AttachResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}/files/{file_uuid}":{"delete":{"tags":["supporting-docs"],"summary":"Detach a file from a workpaper","description":"Detach a supporting doc: remove its `wp_view_doc` placement (+ soft-unlink any legacy per-WP link) and\nemit a `supporting_doc_detached` decision event. Idempotent — no 404 if it was never attached. The file is\npreserved.","operationId":"detach_supporting_doc_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__files__file_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DetachResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["supporting-docs"],"summary":"Toggle a file's extract flag","description":"Toggle the INERT extract flag (persisted; does not run automation).","operationId":"toggle_extract_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__files__file_uuid__patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractToggleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExtractToggleResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/supporting-docs/jobs/{job_uuid}/workpapers/{wp_code}/gl/{file_uuid}/remap":{"put":{"tags":["supporting-docs"],"summary":"Re-map a GL account to a section's COA parent","description":"Re-map a GL-supporting account to the target section's COA parent — a `chart_of_accounts.parent_id`\nchange (NOT an inert placement): it changes what the workpaper computes on the next run and is CLIENT-scoped.\nGated on the COA-mapping permission, delegates to the same path the Mapping page uses.","operationId":"remap_gl_account_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__gl__file_uuid__remap_put","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemapGlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RemapGlResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["supporting-docs"],"summary":"Remove a GL account's COA mapping","description":"Remove a GL-supporting account's COA mapping — a `chart_of_accounts.parent_id` clear (NOT an inert\nplacement): it changes what the workpaper computes on the next run and is CLIENT-scoped. Gated on the same\nCOA-mapping permission as re-map, delegates to the same path the Mapping page uses to clear a mapping.","operationId":"demap_gl_account_api_v1_supporting_docs_jobs__job_uuid__workpapers__wp_code__gl__file_uuid__remap_delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"path","required":true,"schema":{"type":"string","title":"Wp Code"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DemapGlResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/suppressions/{job_uuid}":{"get":{"tags":["mj"],"summary":"List workpaper-effect suppressions for a job","description":"Every journal (and journal line) whose workpaper effect is currently removed.","operationId":"list_suppressions_api_v1_mj_suppressions__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuppressionListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/suppress":{"post":{"tags":["mj"],"summary":"Remove a journal's workpaper effect","description":"Stop a POSTED journal projecting into the workpapers. Its GL / trial-balance effect\nand Xero sync are unchanged. Idempotent; blocked on a signed-off job.","operationId":"suppress_journal_api_v1_mj_journals__job_uuid___mj_uuid__suppress_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SuppressRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuppressResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["mj"],"summary":"Restore a journal's workpaper effect","description":"Let the journal affect the workpapers again. Works even for a voided/deleted journal\n(the ownership check is skipped, Z1 parity). Idempotent; blocked on a signed-off job.","operationId":"unsuppress_journal_api_v1_mj_journals__job_uuid___mj_uuid__suppress_delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuppressResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/lines/{line_id}/suppress":{"post":{"tags":["mj"],"summary":"Remove one journal line's workpaper effect","description":"Stop ONE line of a posted journal projecting into the workpapers (the rest still do).\nSuppressing the whole journal supersedes any per-line suppression.","operationId":"suppress_journal_line_api_v1_mj_journals__job_uuid___mj_uuid__lines__line_id__suppress_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SuppressRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuppressResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["mj"],"summary":"Restore one journal line's workpaper effect","description":"Let one previously-suppressed journal line affect the workpapers again.","operationId":"unsuppress_journal_line_api_v1_mj_journals__job_uuid___mj_uuid__lines__line_id__suppress_delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}},{"name":"line_id","in":"path","required":true,"schema":{"type":"string","title":"Line Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuppressResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/sources":{"get":{"tags":["mj"],"summary":"List journal sources","description":"Firm-level lookup: journal sources for the manual-journal form dropdowns.","operationId":"list_journal_sources_api_v1_mj_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JournalSourceListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/types":{"get":{"tags":["mj"],"summary":"List journal types","description":"Firm-level lookup: journal types for a source, optionally narrowed by category.","operationId":"list_journal_types_api_v1_mj_types_get","parameters":[{"name":"source_id","in":"query","required":true,"schema":{"type":"integer","title":"Source Id"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JournalTypeListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/categories":{"get":{"tags":["mj"],"summary":"List journal categories","description":"Firm-level lookup: journal categories for a source.","operationId":"list_journal_categories_api_v1_mj_categories_get","parameters":[{"name":"source_id","in":"query","required":true,"schema":{"type":"integer","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_JournalCategoryListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/tracking-categories/{job_uuid}":{"get":{"tags":["mj"],"summary":"List Xero tracking categories","description":"ACTIVE Xero tracking categories (+ options) for the job's client org, used\nto tag journal lines. Empty list when the client has no Xero connection.","operationId":"list_tracking_categories_api_v1_mj_tracking_categories__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrackingCategoryListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/tax-rates/{job_uuid}":{"get":{"tags":["mj"],"summary":"List GST/tax rates for the job's client","description":"GST/tax-rate options for the job's client, for the manual-journal per-line\ntax picker: LIVE Xero ``/TaxRates`` for a connected client (ACTIVE, region-\ncorrect), else the seeded region set. Each item is ``{code, name, rate_percent}``.","operationId":"list_tax_rates_for_job_api_v1_mj_tax_rates__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TaxRateListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}":{"get":{"tags":["mj"],"summary":"List a job's manual journals","description":"The job's manual journals (header + summed debit/credit + Xero sync state).\n\n``wp_code`` scopes the list to a single workpaper (Z1 OR-rule: matching\n``workpaper_name`` OR any line's account code in the WP's account set). Omit\nit for the full job list (the standalone Manual Journals dashboard).","operationId":"list_manual_journals_api_v1_mj_journals__job_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualJournalListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["mj"],"summary":"Create or post a manual journal","description":"Create / post a manual journal. JSON body (no files) or multipart/form-data\n(scalar fields + `attachment` parts → S3). Status is derived from\ncompleteness: balanced + every line coded → 'posted', else 'incomplete'.","operationId":"create_manual_journal_api_v1_mj_journals__job_uuid__post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualJournalCreateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"content":{"application/json":{"schema":{"description":"Create-journal payload. The form-data path (with attachments) maps onto\nthis same shape; the JSON path posts it directly.","properties":{"source_id":{"description":"Journal source id (from GET /mj/sources). Required.","examples":[1],"title":"Source Id","type":"integer"},"journal_type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Journal Type"},"narration":{"description":"Journal narration. Required and must be non-empty.","examples":["Reclass December accruals"],"title":"Narration","type":"string"},"date":{"description":"Journal date, YYYY-MM-DD. Required.","examples":["2026-06-30"],"title":"Date","type":"string"},"auto_reversing_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Reversing Date"},"default_narration_to_journal_line":{"default":false,"title":"Default Narration To Journal Line","type":"boolean"},"show_journal_on_cash_basis":{"description":"Reporting basis — \"cash\" or \"accrual\". Required.","examples":["accrual"],"title":"Show Journal On Cash Basis","type":"string"},"line_amount_types":{"default":"Inclusive","title":"Line Amount Types","type":"string"},"gl_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Code"},"autocoding_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autocoding Code"},"workpaper_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Category"},"notes":{"anyOf":[{"maxLength":100000,"type":"string"},{"type":"null"}],"title":"Notes"},"journal_line_items":{"description":"Journal lines (>=1 required; debits must equal credits and every line needs an account code to post).","items":{"description":"One journal line. Mirrors the Z1 required line fields.","properties":{"account":{"title":"Account","type":"string"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"tax_rate":{"title":"Tax Rate","type":"string"},"debit":{"default":0.0,"title":"Debit","type":"number"},"credit":{"default":0.0,"title":"Credit","type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tracking":{"items":{"description":"One Xero tracking tag on a line: a category name + the chosen option name\n(e.g. category='Department', option='Sales'). Xero allows up to 2 per line.\n\nThe Xero GUIDs are carried too when known (``category_id``/``option_id``) so\nsync can post by stable ID — rename-proof against later edits in Xero. Names\nremain the human-readable fallback for older rows / hand-crafted payloads.","properties":{"category":{"title":"Category","type":"string"},"option":{"title":"Option","type":"string"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"option_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Option Id"}},"required":["category","option"],"title":"TrackingTag","type":"object"},"maxItems":2,"title":"Tracking","type":"array"}},"required":["account","tax_rate"],"title":"JournalLineItem","type":"object"},"title":"Journal Line Items","type":"array"},"file_uuids":{"items":{"type":"string"},"title":"File Uuids","type":"array"}},"required":["source_id","narration","date","show_journal_on_cash_basis"],"title":"ManualJournalCreateRequest","type":"object"}}},"description":"Send a JSON body (no files), OR multipart/form-data with the same scalar fields plus `attachment` file parts and `journal_line_items` as a JSON-string field."}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/post-xero":{"post":{"tags":["mj"],"summary":"Post a journal to Xero","description":"Post a complete manual journal to the client's connected Xero org.\nIdempotent — re-posting an already-posted journal returns its Xero id.","operationId":"post_manual_journal_to_xero_api_v1_mj_journals__job_uuid___mj_uuid__post_xero_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PostToXeroResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/sync-xero":{"post":{"tags":["mj"],"summary":"Sync pending journals to Xero","description":"Partner sync (Z1 parity): push the pending journals on the job to Xero —\ncreate the complete ones not yet there, void the ones voided locally. An\noptional ``manual_journal_uuids`` body narrows the push to the user-ticked\njournals (the review screen's checkboxes); omitted → push all pending.\nAfter push: fold MJ→TB and recompute workpapers (Balance-per-GL updates).","operationId":"sync_manual_journals_to_xero_api_v1_mj_journals__job_uuid__sync_xero_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SyncToXeroRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncToXeroResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/sync-local":{"post":{"tags":["mj"],"summary":"Sync journals locally","description":"Sync with Zato (local-only, no Xero): fold posted MJ effects into trial_balance\nand recompute workpapers. Balance-per-GL updates to reflect all posted MJs.\nUse this for non-Xero jobs or to manually refresh WPs after MJ changes.","operationId":"sync_local_manual_journals_api_v1_mj_journals__job_uuid__sync_local_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncLocalResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/import-xero":{"post":{"tags":["mj"],"summary":"Import manual journals from Xero","description":"Import manual journals from Xero (Z1 import_journals_from_partner parity).\nFetches POSTED Xero MJs for the job's FY window, deduplicates against existing\nlocal MJs, inserts new ones and updates changed ones. After import: folds MJ→TB\nand recomputes workpapers.","operationId":"import_manual_journals_from_xero_api_v1_mj_journals__job_uuid__import_xero_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ImportXeroResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/sync-from-xero":{"post":{"tags":["mj"],"summary":"Sync selected resources from Xero","description":"Unified \"Sync from Xero\": fetch the requested resources (default CoA +\njournals + Trial Balance) in one go via the shared orchestrator, then fold\nMJ→TB and recompute workpapers once. The orchestrator reuses each resource's\nexisting sync function in CoA→journals→TB order.","operationId":"sync_manual_journals_from_xero_api_v1_mj_journals__job_uuid__sync_from_xero_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SyncFromXeroRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncFromXeroResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/void":{"post":{"tags":["mj"],"summary":"Void a manual journal","description":"Void a manual journal locally. If it was already posted to Xero, the void is\nqueued and pushed on the next \"Sync with Xero\" (Z1 deferred-sync model).","operationId":"void_manual_journal_api_v1_mj_journals__job_uuid___mj_uuid__void_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VoidResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}":{"get":{"tags":["mj"],"summary":"Get a manual journal","description":"One manual journal — header + every line — for the detail / edit view.","operationId":"get_manual_journal_api_v1_mj_journals__job_uuid___mj_uuid__get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualJournalDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["mj"],"summary":"Edit a manual journal","description":"Full-replace edit (JSON): replaces every line + header fields, recomputes\nstatus from completeness. A journal already in Xero is flagged for an UPDATE on\nthe next sync. Blocked on a voided/reversal journal or a signed-off job.","operationId":"edit_manual_journal_api_v1_mj_journals__job_uuid___mj_uuid__patch","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualJournalUpdateResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"content":{"application/json":{"schema":{"description":"Full-replace edit payload — same shape as create (header + ALL lines). A\nPATCH replaces every line and recomputes status from completeness.","properties":{"source_id":{"description":"Journal source id (from GET /mj/sources). Required.","examples":[1],"title":"Source Id","type":"integer"},"journal_type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Journal Type"},"narration":{"description":"Journal narration. Required and must be non-empty.","examples":["Reclass December accruals"],"title":"Narration","type":"string"},"date":{"description":"Journal date, YYYY-MM-DD. Required.","examples":["2026-06-30"],"title":"Date","type":"string"},"auto_reversing_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Reversing Date"},"default_narration_to_journal_line":{"default":false,"title":"Default Narration To Journal Line","type":"boolean"},"show_journal_on_cash_basis":{"description":"Reporting basis — \"cash\" or \"accrual\". Required.","examples":["accrual"],"title":"Show Journal On Cash Basis","type":"string"},"line_amount_types":{"default":"Inclusive","title":"Line Amount Types","type":"string"},"gl_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Code"},"autocoding_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autocoding Code"},"workpaper_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Category"},"notes":{"anyOf":[{"maxLength":100000,"type":"string"},{"type":"null"}],"title":"Notes"},"journal_line_items":{"description":"Journal lines (>=1 required; debits must equal credits and every line needs an account code to post).","items":{"description":"One journal line. Mirrors the Z1 required line fields.","properties":{"account":{"title":"Account","type":"string"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"tax_rate":{"title":"Tax Rate","type":"string"},"debit":{"default":0.0,"title":"Debit","type":"number"},"credit":{"default":0.0,"title":"Credit","type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tracking":{"items":{"description":"One Xero tracking tag on a line: a category name + the chosen option name\n(e.g. category='Department', option='Sales'). Xero allows up to 2 per line.\n\nThe Xero GUIDs are carried too when known (``category_id``/``option_id``) so\nsync can post by stable ID — rename-proof against later edits in Xero. Names\nremain the human-readable fallback for older rows / hand-crafted payloads.","properties":{"category":{"title":"Category","type":"string"},"option":{"title":"Option","type":"string"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"option_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Option Id"}},"required":["category","option"],"title":"TrackingTag","type":"object"},"maxItems":2,"title":"Tracking","type":"array"}},"required":["account","tax_rate"],"title":"JournalLineItem","type":"object"},"title":"Journal Line Items","type":"array"},"file_uuids":{"items":{"type":"string"},"title":"File Uuids","type":"array"}},"required":["source_id","narration","date","show_journal_on_cash_basis"],"title":"ManualJournalUpdateRequest","type":"object"}}},"description":"Full-replace edit — send the COMPLETE journal (all header fields + every line); this is not a partial patch."}},"delete":{"tags":["mj"],"summary":"Delete a voided journal","description":"Hard-delete a VOIDED manual journal (+ its reversal children + lines).\nOnly a voided journal can be deleted (void it first).","operationId":"delete_manual_journal_api_v1_mj_journals__job_uuid___mj_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeleteResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/restore":{"post":{"tags":["mj"],"summary":"Restore a voided journal","description":"Restore (un-void) a voided journal — status returns to posted/incomplete\n(a reversal child to 'reversal'); a not-yet-synced Xero VOID is cancelled.","operationId":"restore_manual_journal_api_v1_mj_journals__job_uuid___mj_uuid__restore_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RestoreResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/mj/journals/{job_uuid}/{mj_uuid}/attachments/{file_uuid}":{"delete":{"tags":["mj"],"summary":"Remove an attachment from a manual journal","description":"Remove one supporting file from a manual journal (soft-delete → recycled in\nZBox). The journal's lines and balances are unaffected; blocked on a signed-off job.","operationId":"delete_manual_journal_attachment_api_v1_mj_journals__job_uuid___mj_uuid__attachments__file_uuid__delete","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}},{"name":"mj_uuid","in":"path","required":true,"schema":{"type":"string","title":"Mj Uuid"}},{"name":"file_uuid","in":"path","required":true,"schema":{"type":"string","title":"File Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DeleteResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/company-office/search":{"get":{"tags":["company-office"],"summary":"Search the NZ Companies Office register","description":"Search the NZ Companies Office register by name. Returns the matching\ncompanies (no persistence — the user picks one in the drawer).","operationId":"search_company_office_api_v1_company_office_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Company name to search","title":"Q"},"description":"Company name to search"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CompanyOfficeSearchResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/company-office/details/{nzbn}":{"get":{"tags":["company-office"],"summary":"Get company details by NZBN","description":"Fetch the full entity document for one NZBN.","operationId":"company_office_details_api_v1_company_office_details__nzbn__get","parameters":[{"name":"nzbn","in":"path","required":true,"schema":{"type":"string","title":"Nzbn"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CompanyOfficeDetailResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/templates":{"get":{"tags":["reporting"],"summary":"List report templates","description":"List report types available to the firm.","operationId":"list_templates_api_v1_reporting_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TemplateListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/jobs/{job_uuid}/reports":{"post":{"tags":["reporting"],"summary":"Create and assemble a report","description":"Create a report + dispatch the **assemble** run. Returns ``202 {run_id, report_uuid}``.","operationId":"create_report_api_v1_reporting_jobs__job_uuid__reports_post","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AssembleAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["reporting"],"summary":"List a job's reports","description":"List reports on a job.","operationId":"list_reports_api_v1_reporting_jobs__job_uuid__reports_get","parameters":[{"name":"job_uuid","in":"path","required":true,"schema":{"type":"string","title":"Job Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReportListResponse_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}":{"get":{"tags":["reporting"],"summary":"Get report detail","description":"Report detail (status, template, balance, warnings).","operationId":"get_report_api_v1_reporting_reports__report_uuid__get","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReportSummary_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/data":{"get":{"tags":["reporting"],"summary":"Get the report data tree","description":"The reviewable data tree — sections + lines + AI notes.","operationId":"get_report_data_api_v1_reporting_reports__report_uuid__data_get","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReportData_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/lines/{line_key}":{"patch":{"tags":["reporting"],"summary":"Override a report line","description":"Override a line's value / inclusion / display group — one row + one\n``decision_events`` row. Fields are partial: omitted fields stay unchanged.","operationId":"override_line_api_v1_reporting_reports__report_uuid__lines__line_key__patch","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}},{"name":"line_key","in":"path","required":true,"schema":{"type":"string","title":"Line Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineOverrideIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LineDTO_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/sections/{section_key}/lines":{"patch":{"tags":["reporting"],"summary":"Rearrange a section's lines","description":"Persist the reviewer's line arrangement for one section (``sort_override`` =\nposition in the submitted list) — survives reassembles.","operationId":"reorder_section_lines_api_v1_reporting_reports__report_uuid__sections__section_key__lines_patch","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}},{"name":"section_key","in":"path","required":true,"schema":{"type":"string","title":"Section Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinesReorderIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LinesReorderResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/sections/{section_key}":{"patch":{"tags":["reporting"],"summary":"Update a report section","description":"Include/exclude/reorder a section, or override its title.","operationId":"patch_section_api_v1_reporting_reports__report_uuid__sections__section_key__patch","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}},{"name":"section_key","in":"path","required":true,"schema":{"type":"string","title":"Section Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectionPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SectionPatchResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/preview":{"post":{"tags":["reporting"],"summary":"Preview the report PDF","description":"Render a paginated PDF preview of the current tree (same artifact as Download).","operationId":"preview_report_api_v1_reporting_reports__report_uuid__preview_post","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"200":{"description":"Rendered PDF preview (inline).","content":{"application/json":{"schema":{}},"application/pdf":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/reassemble":{"post":{"tags":["reporting"],"summary":"Reassemble a report","description":"Reset and re-dispatch the assemble pipeline on an existing report (preserves UUID +\nreviewer overrides). Use this instead of creating a duplicate report.","operationId":"reassemble_report_api_v1_reporting_reports__report_uuid__reassemble_post","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AssembleAccepted_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/generate":{"post":{"tags":["reporting"],"summary":"Generate the report","description":"Check finalize gates; on pass, dispatch the **render** run.","operationId":"generate_report_api_v1_reporting_reports__report_uuid__generate_post","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FinalizeResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/download":{"get":{"tags":["reporting"],"summary":"Get the report download URL","description":"Resolve the self-served stream URL + filename for the rendered artifact.","operationId":"download_report_api_v1_reporting_reports__report_uuid__download_get","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DownloadUrl_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/reporting/reports/{report_uuid}/file":{"get":{"tags":["reporting"],"summary":"Stream the report PDF","description":"Stream the stored PDF bytes (local-disk or S3 backend).","operationId":"report_file_api_v1_reporting_reports__report_uuid__file_get","parameters":[{"name":"report_uuid","in":"path","required":true,"schema":{"type":"string","title":"Report Uuid"}}],"responses":{"200":{"description":"Stored report PDF bytes (inline).","content":{"application/json":{"schema":{}},"application/pdf":{}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/manual/search":{"get":{"tags":["knowledge"],"summary":"Search the product manual KB","description":"Semantic search over the ingested Ziffy product manual KB.","operationId":"search_manual_api_v1_knowledge_manual_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Required. The natural-language search query to run semantically over the ingested Ziffy product manual KB.","examples":["How do I resync the manual?"],"title":"Q"},"description":"Required. The natural-language search query to run semantically over the ingested Ziffy product manual KB."},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Optional. Max number of passages to return; falls back to the configured default top-k when omitted.","examples":[5],"title":"K"},"description":"Optional. Max number of passages to return; falls back to the configured default top-k when omitted."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ManualHit__"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/workpapers/supporting-docs-info":{"get":{"tags":["knowledge"],"summary":"Get workpaper supporting-docs reference","description":"Static per-workpaper reference: which source documents a workpaper needs\n(formats, expected fields) and when to raise a missing-document query\n(``remarks``). Omit wp_code for a compact index; pass it for the full entry.","operationId":"workpaper_supporting_docs_info_api_v1_knowledge_workpapers_supporting_docs_info_get","parameters":[{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"description":"Optional. Workpaper code (e.g. FIA). Omit for a compact index of all workpapers; pass it for the full single-workpaper entry.","examples":["FIA"],"title":"Wp Code"},"description":"Optional. Workpaper code (e.g. FIA). Omit for a compact index of all workpapers; pass it for the full single-workpaper entry."},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4},{"type":"null"}],"description":"Country book to read from; omit for the active portal's country.","examples":["nz"],"title":"Country"},"description":"Country book to read from; omit for the active portal's country."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SupportingDocsInfo_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/workpapers/query-templates":{"get":{"tags":["knowledge"],"summary":"Get client query templates","description":"Static client query (PBC) templates to request a workpaper's missing\nsupporting documents. Omit wp_code for a compact index; pass it for the\ntemplate(s).","operationId":"workpaper_query_templates_api_v1_knowledge_workpapers_query_templates_get","parameters":[{"name":"wp_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"description":"Optional. Workpaper code (e.g. FIA). Omit for a compact index of all workpapers; pass it for that workpaper's query template(s).","examples":["FIA"],"title":"Wp Code"},"description":"Optional. Workpaper code (e.g. FIA). Omit for a compact index of all workpapers; pass it for that workpaper's query template(s)."},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4},{"type":"null"}],"description":"Country book to read from; omit for the active portal's country.","examples":["nz"],"title":"Country"},"description":"Country book to read from; omit for the active portal's country."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_QueryTemplatesInfo_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/web-search":{"get":{"tags":["knowledge"],"summary":"Web search for regulatory questions","description":"Web search for accounting standards / tax / regulatory questions (NZ: IRD,\nXRB, CA ANZ). Goes through the sanctioned SerpAPI egress module; degrades to\nempty results when search isn't configured (no key). Returns\n``{query, results:[{title, url, snippet}]}``.","operationId":"web_search_api_v1_knowledge_web_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"description":"Required. The regulatory / accounting-standards / tax question to search the web for (NZ: IRD, XRB, CA ANZ).","examples":["IRD provisional tax due dates 2026"],"title":"Q"},"description":"Required. The regulatory / accounting-standards / tax question to search the web for (NZ: IRD, XRB, CA ANZ)."},{"name":"count","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Optional. Number of results to return (1–10); defaults to 4.","examples":[4],"default":4,"title":"Count"},"description":"Optional. Number of results to return (1–10); defaults to 4."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__envelope_models__Envelope_WebSearchResponse___2"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/manual/status":{"get":{"tags":["knowledge"],"summary":"Get the manual KB sync status","description":"Latest KB revision metadata — used by admin tooling to check sync state.","operationId":"manual_status_api_v1_knowledge_manual_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ManualRevisionStatus_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/knowledge/manual/resync":{"post":{"tags":["knowledge"],"summary":"Force a manual KB re-sync","description":"Force-trigger a manual KB re-sync (deduped by hash; no-op if unchanged).","operationId":"resync_manual_api_v1_knowledge_manual_resync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResyncResult_"}}}},"401":{"description":"No or invalid session (UNAUTHORIZED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — PERMISSION_DENIED (missing scope) or OBJECT_FORBIDDEN (object-level access denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/healthz":{"get":{"tags":["health"],"summary":"Liveness probe","description":"Unauthenticated liveness probe — returns `{\"ok\": true}` when the edge process is up.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}}},"components":{"schemas":{"AcBulkUpdateResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"updated":{"type":"integer","title":"Updated","default":0}},"type":"object","required":["ac_job_uuid"],"title":"AcBulkUpdateResponse","description":"Ack for a bulk tax-override / tracking update (POST .../tax-bulk · .../tracking-bulk)\n— count of lines updated (no metric recompute)."},"AcJobListItem":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date"},"status":{"type":"string","title":"Status"},"region":{"type":"string","title":"Region"},"bank_row_count":{"type":"integer","title":"Bank Row Count","default":0},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"feed_meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Feed Meta"},"coa_bank_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Bank Account Uuid"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","required":["ac_job_uuid","status","region"],"title":"AcJobListItem","description":"One autocoding run in the list view — AcJobOut plus the joined client name."},"AcResultLineOut":{"properties":{"ac_result_id":{"type":"integer","title":"Ac Result Id"},"bs_index":{"type":"integer","title":"Bs Index"},"row_data":{"additionalProperties":true,"type":"object","title":"Row Data"},"gl_matched_account_codes":{"type":"string","title":"Gl Matched Account Codes","default":""},"gl_matched_indices":{"type":"string","title":"Gl Matched Indices","default":""},"gl_matched_word":{"type":"string","title":"Gl Matched Word","default":""},"gl_column_matched":{"type":"string","title":"Gl Column Matched","default":""},"match_type":{"type":"string","title":"Match Type","default":""},"match_strength":{"type":"number","title":"Match Strength","default":0.0},"message":{"type":"string","title":"Message","default":""},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"alternatives":{"items":{"type":"string"},"type":"array","title":"Alternatives"},"tax_type_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type Override"},"tracking":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tracking"},"linked_account_codes":{"type":"string","title":"Linked Account Codes","default":""},"linked_gl_indices":{"type":"string","title":"Linked Gl Indices","default":""},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"query_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Uuid Ref"},"pending":{"type":"boolean","title":"Pending","default":false},"pending_to_code":{"type":"string","title":"Pending To Code","default":""},"pending_method":{"type":"string","title":"Pending Method","default":""}},"type":"object","required":["ac_result_id","bs_index"],"title":"AcResultLineOut"},"AcResultsResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"unique_account_codes":{"items":{"type":"string"},"type":"array","title":"Unique Account Codes"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"bank_row_count":{"type":"integer","title":"Bank Row Count","default":0},"pending_count":{"type":"integer","title":"Pending Count","default":0},"lines":{"items":{"$ref":"#/components/schemas/AcResultLineOut"},"type":"array","title":"Lines"}},"type":"object","required":["ac_job_uuid"],"title":"AcResultsResponse"},"AcRunStatusResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"status":{"type":"string","title":"Status"},"is_running":{"type":"boolean","title":"Is Running","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"bank_row_count":{"type":"integer","title":"Bank Row Count","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["ac_job_uuid","status"],"title":"AcRunStatusResponse"},"AcceptInviteRequest":{"properties":{"token":{"type":"string","maxLength":512,"minLength":8,"title":"Token","description":"Required. The opaque invitation token from the invite email link.","examples":["inv_9f3c2a7b8e10c4d5"]},"email":{"type":"string","format":"email","title":"Email","description":"Required. The invited email address (must match the invitation).","examples":["newuser@acme.co.nz"]},"new_password":{"anyOf":[{"type":"string","maxLength":128,"minLength":8},{"type":"null"}],"title":"New Password","description":"Required ONLY for native users (org with 'cognito' in allowed_providers) — sets their password and stages OTP. Omit for federated invitees, who instead get a redirect to /auth/login to sign in via their IdP.","examples":["N3w!Secur3Pass"]}},"type":"object","required":["token","email"],"title":"AcceptInviteRequest"},"AcceptInviteResponse":{"properties":{"mode":{"type":"string","title":"Mode"},"email_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Hint"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Url"},"persona":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona"},"firm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Uuid"},"is_existing_user":{"type":"boolean","title":"Is Existing User","default":false}},"type":"object","required":["mode"],"title":"AcceptInviteResponse"},"AccountTransactionsOut":{"properties":{"accountCode":{"type":"string","title":"Accountcode"},"transactions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transactions"},"page":{"type":"integer","title":"Page"},"pageCount":{"type":"integer","title":"Pagecount"},"size":{"type":"integer","title":"Size"},"total":{"type":"integer","title":"Total"},"accountTotal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accounttotal"}},"type":"object","required":["accountCode","page","pageCount","size","total"],"title":"AccountTransactionsOut","description":"Payload of ``GET /jobs/{job}/{code}/gl-account-transactions`` — one account's\npaginated ledger (transaction rows are engine-shaped, documented loosely)."},"AccountTypeOut":{"properties":{"account_type_id":{"type":"integer","title":"Account Type Id"},"type_name":{"type":"string","title":"Type Name"},"class_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Name"}},"type":"object","required":["account_type_id","type_name"],"title":"AccountTypeOut"},"AccountTypesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountTypeOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AccountTypesResponse","description":"`GET /coa/account-types` — the Zato type taxonomy for the resolve dropdown."},"AccountViewRow":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"gl_bal":{"type":"number","title":"Gl Bal","default":0.0},"workpapers":{"items":{"$ref":"#/components/schemas/AccountWorkpaperRef"},"type":"array","title":"Workpapers"},"manual_journals":{"additionalProperties":{"type":"integer"},"type":"object","title":"Manual Journals"}},"type":"object","title":"AccountViewRow","description":"One account in the \"By Account Code\" view (its workpaper + MJ counts nested)."},"AccountWorkpaperRef":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"wp_bal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wp Bal"},"variance":{"type":"number","title":"Variance","default":0.0},"reconciled":{"type":"boolean","title":"Reconciled","default":false}},"type":"object","required":["wp_code","wp_name"],"title":"AccountWorkpaperRef","description":"The workpaper an account maps to, nested in the By-Account view."},"ActionCard":{"properties":{"action_name":{"type":"string","title":"Action Name"},"title":{"type":"string","title":"Title"},"token":{"type":"string","title":"Token","default":""},"fields":{"items":{"$ref":"#/components/schemas/ActionField"},"type":"array","title":"Fields"},"missing_required":{"items":{"type":"string"},"type":"array","title":"Missing Required"},"line_items":{"items":{"$ref":"#/components/schemas/ActionLineItem"},"type":"array","title":"Line Items"},"account_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Account Options"},"mapping_items":{"items":{"$ref":"#/components/schemas/ActionMappingItem"},"type":"array","title":"Mapping Items"},"parent_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Parent Options"},"edit_items":{"items":{"$ref":"#/components/schemas/ActionEditItem"},"type":"array","title":"Edit Items"}},"type":"object","required":["action_name","title"],"title":"ActionCard","description":"A pending write-action. Text mode renders it as a Confirm card; voice mode\ncollects fields conversationally and executes directly (no token needed)."},"ActionConfirmRequest":{"properties":{"action_name":{"type":"string","maxLength":64,"minLength":1,"title":"Action Name","description":"The action being confirmed; must match the action_name baked into the signed token.","examples":["raise_manual_journal"]},"token":{"type":"string","maxLength":1024,"minLength":1,"title":"Token","description":"The signed, single-use action token from the ActionCard (pins firm/user/scope; re-verified at confirm).","examples":["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."]},"values":{"additionalProperties":true,"type":"object","title":"Values","description":"The user-edited card field values (keys per the action's fields). Empty when the action has no editable fields."},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ActionLineItem"},"type":"array","maxItems":200},{"type":"null"}],"title":"Line Items","description":"Required for a manual-journal card (omit/None for every other action): the user-edited journal lines, re-validated at confirm (≥2 balanced lines, accounts in the CoA)."},"mapping_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ActionMappingItem"},"type":"array","maxItems":1000},{"type":"null"}],"title":"Mapping Items","description":"Required for a map-accounts card (omit/None otherwise): the user-edited account→parent rows; only rows whose id is in the token's id set are applied."},"edit_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ActionEditItem"},"type":"array","maxItems":1000},{"type":"null"}],"title":"Edit Items","description":"Required for an edit_workpaper card (omit/None otherwise): the user-edited cell rows; only rows whose field_id is in the token's set are applied."}},"type":"object","required":["action_name","token"],"title":"ActionConfirmRequest","description":"The browser's Confirm of a pending write-action: the signed token from the\nActionCard + the (user-edited) field values."},"ActionEditItem":{"properties":{"field_id":{"type":"string","maxLength":128,"title":"Field Id","default":""},"row_id":{"type":"string","maxLength":64,"title":"Row Id","default":""},"col":{"type":"string","maxLength":64,"title":"Col","default":""},"label":{"type":"string","maxLength":300,"title":"Label","default":""},"current_value":{"type":"string","maxLength":300,"title":"Current Value","default":""},"value":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Value"}},"type":"object","title":"ActionEditItem","description":"One editable cell on a workpaper-edit card. ``field_id`` = ``\"<row_id>~<col>\"`` is the\nIMMUTABLE cell identity — it is what the SIGNED token pins and what a confirm is matched\nagainst; it is NEVER trusted from the request to widen scope (the execute derives the\naddressed ``row_id``/``col`` from ``field_id``, not from these echoed fields). ``row_id`` /\n``col`` / ``label`` / ``current_value`` are read-only display, resolved server-side from the\nstored workpaper VIEW. ``value`` is the EDITABLE new value the accountant types; it rides\nback in ``ActionConfirmRequest.edit_items`` and is re-validated at confirm — the token pins\nonly the scope (job) + wp_code + the field_id SET, never the typed values."},"ActionField":{"properties":{"name":{"type":"string","title":"Name"},"label":{"type":"string","title":"Label"},"type":{"type":"string","title":"Type","default":"text"},"required":{"type":"boolean","title":"Required","default":false},"options":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Options"},"value":{"anyOf":[{},{"type":"null"}],"title":"Value"},"help":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Help"},"max_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Length"}},"type":"object","required":["name","label"],"title":"ActionField","description":"One editable field on a write-action card (voice/agentic write actions)."},"ActionLineItem":{"properties":{"account":{"type":"string","maxLength":64,"title":"Account","default":""},"account_name":{"type":"string","maxLength":200,"title":"Account Name","default":""},"debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Debit"},"credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit"},"description":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Description"}},"type":"object","title":"ActionLineItem","description":"One editable journal line on a manual-journal card. ``account`` is the GL code;\n``account_name`` is resolved server-side for display (ignored on the way back in).\nA line is a debit OR a credit. The user can edit accounts/amounts and add/remove\nlines on the card, so the lines are NOT baked into the signed token — they come back\nin ``ActionConfirmRequest.line_items`` and are re-validated at confirm."},"ActionMappingItem":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id","default":""},"account":{"type":"string","maxLength":128,"title":"Account","default":""},"account_name":{"type":"string","maxLength":200,"title":"Account Name","default":""},"parent_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Parent Key"},"current_parent":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Current Parent"}},"type":"object","title":"ActionMappingItem","description":"One editable row on an account→chart-parent mapping card (COA client-level or TB\njob-level). ``id`` is the account identifier — ``account_uuid`` for COA, ``str(coa_tb_id)``\nfor TB — used only to display/echo the row and to match it against the SIGNED token's\nid set at confirm; it is NEVER trusted from the request to widen scope. ``account`` /\n``account_name`` / ``current_parent`` are read-only display (resolved server-side).\n``parent_key`` is the EDITABLE target the user picks from the dropdown; it rides back in\n``ActionConfirmRequest.mapping_items`` and is re-validated (must be a real chart parent)\nat confirm — the token only pins the scope + id set, never the chosen parents."},"ActionResult":{"properties":{"action_name":{"type":"string","title":"Action Name"},"title":{"type":"string","title":"Title"},"result":{"additionalProperties":true,"type":"object","title":"Result"}},"type":"object","required":["action_name","title"],"title":"ActionResult","description":"The outcome of a confirmed write-action (the created/updated entity)."},"ActiveRun":{"properties":{"source_file_uuid":{"type":"string","title":"Source File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"status":{"type":"string","title":"Status","default":"running"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"}},"type":"object","required":["source_file_uuid"],"title":"ActiveRun","description":"An in-progress split — surfaced so the UI shows 'still splitting X…' even after a\npage refresh (the source has no split documents yet, so it isn't in /documents)."},"ActiveRunsResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/ActiveRun"},"type":"array","title":"Runs"}},"type":"object","title":"ActiveRunsResponse"},"ActivityEventOut":{"properties":{"event_uuid":{"type":"string","title":"Event Uuid"},"at":{"type":"string","format":"date-time","title":"At"},"domain":{"type":"string","title":"Domain"},"verb":{"type":"string","title":"Verb"},"level":{"type":"string","title":"Level"},"severity":{"type":"string","title":"Severity"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"actor_kind":{"type":"string","title":"Actor Kind"},"actor_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Label"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"cursor":{"type":"integer","title":"Cursor"}},"type":"object","required":["event_uuid","at","domain","verb","level","severity","actor_kind","cursor"],"title":"ActivityEventOut"},"ActivityListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ActivityEventOut"},"type":"array","title":"Items"},"next_before_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Before Id"}},"type":"object","required":["items"],"title":"ActivityListResponse"},"AddClientsToGroupRequest":{"properties":{"client_uuids":{"items":{"type":"string"},"type":"array","title":"Client Uuids","description":"client_uuids to assign to the group. Required; each must belong to the caller's firm. An empty list is a no-op (0 updated).","examples":[["a1b2c3d4-1111-2222-3333-444455556666"]]}},"type":"object","required":["client_uuids"],"title":"AddClientsToGroupRequest"},"AddDocumentRequest":{"properties":{"page_range":{"type":"string","title":"Page Range","description":"Pages to carve from the bunch source into a NEW document, e.g. '4-5' (supports non-contiguous '1-3,5'). Required.","examples":["4-5"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Category for the new document (one of GET /categories). Defaults to 'Others' when omitted.","examples":["Receipt"]},"supplier_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier Name","description":"Supplier name for the new document. Optional.","examples":["Beta Supplies"]}},"type":"object","required":["page_range"],"title":"AddDocumentRequest"},"AddQuestionRequest":{"properties":{"info":{"additionalProperties":true,"type":"object","title":"Info","description":"Question config object stored as questionnaire_template_info (question_name/description, question_type, is_required, options, …).","examples":[{"is_required":true,"question_name":"Total revenue","question_type":"TEXTBOX"}]}},"type":"object","required":["info"],"title":"AddQuestionRequest"},"AddSectionOut":{"properties":{"created_keys":{"items":{"type":"string"},"type":"array","title":"Created Keys"},"section":{"type":"integer","title":"Section"}},"type":"object","required":["created_keys","section"],"title":"AddSectionOut"},"AddSectionRequest":{"properties":{"section_name":{"type":"string","title":"Section Name","description":"Name of the new section; a blank value falls back to \"New section\".","examples":["Income & Revenue"]}},"type":"object","required":["section_name"],"title":"AddSectionRequest"},"AdoptGroupRequest":{"properties":{"source_group_id":{"type":"integer","title":"Source Group Id","description":"questionnaire_group_id of the Zato master group to adopt (from GET /questionnaire/master-groups). Passed to adopt_master_group unguarded.","examples":[42]},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year","description":"Optional financial year to tag the adopted firm copy with.","examples":["2025-2026"]}},"type":"object","required":["source_group_id"],"title":"AdoptGroupRequest"},"AgentClientDetail":{"properties":{"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Code"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"entity_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Entity Type Id Ref"}},"type":"object","title":"AgentClientDetail","description":"``get_client_detail`` payload for the in-scope client. Every field is\noptional — an empty object is returned when the pinned client isn't found."},"AgentClientsList":{"properties":{"clients":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clients"},"total":{"type":"integer","title":"Total","default":0},"showing":{"type":"integer","title":"Showing","default":0}},"type":"object","title":"AgentClientsList","description":"``list_clients`` payload: access-tier-filtered client rows (client_uuid,\nclient_name, status, jobs_count, branch_name) + total/showing counts."},"AgentFirmOverview":{"properties":{"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"firm_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Type"},"number_of_jobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Number Of Jobs"},"onboard_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Onboard Date"},"contact_info":{"additionalProperties":true,"type":"object","title":"Contact Info"}},"type":"object","title":"AgentFirmOverview","description":"``get_firm_overview`` payload. Every field is optional — the tool returns an\nempty object when the caller has no firm in context."},"AgentJobDetail":{"properties":{"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"status_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Id Ref"},"client_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id Ref"}},"type":"object","title":"AgentJobDetail","description":"``get_job_detail`` payload for the in-scope job. Every field is optional —\nan empty object is returned when the pinned job isn't found."},"AgentJobsList":{"properties":{"jobs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Jobs"},"total":{"type":"integer","title":"Total","default":0},"showing":{"type":"integer","title":"Showing","default":0}},"type":"object","title":"AgentJobsList","description":"``list_jobs`` payload: access-tier-filtered job rows (job_uuid, job_name,\njob_code, period) + total/showing counts."},"AgentManualJournalsList":{"properties":{"journals":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Journals"},"count":{"type":"integer","title":"Count","default":0}},"type":"object","title":"AgentManualJournalsList","description":"``list_manual_journals`` payload: the in-scope job's manual journal rows\n(narration, date, status, source, debit/credit totals, Xero sync state)."},"AgentMemoryRecords":{"properties":{"firm":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Firm"},"client":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Client"},"job":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Job"},"user":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"User"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["firm","client","job","user"],"title":"AgentMemoryRecords","description":"DEV-ONLY stored-memory inspector payload (``agent_recall.agent_recall``):\nper-grain buckets of engine-owned record dicts, plus an ``error`` note when the\nbest-effort read degrades. Buckets are always present; ``error`` only on failure."},"AgentPermissionsView":{"properties":{"persona":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"user_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Type"},"portal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"}},"type":"object","title":"AgentPermissionsView","description":"``get_my_permissions`` payload: the caller's persona/role/user-type/portal\nand their sorted permission list."},"AgentRecentActivity":{"properties":{"scope":{"type":"string","title":"Scope"},"events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Events"}},"type":"object","required":["scope"],"title":"AgentRecentActivity","description":"``get_recent_activity`` payload: the scope label (\"client\"/\"firm\") and the\nrecent activity rows (event_uuid, at, verb, summary, actor_label)."},"AgentUsersList":{"properties":{"users":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Users"},"count":{"type":"integer","title":"Count","default":0}},"type":"object","title":"AgentUsersList","description":"``list_users`` payload: the firm's user rows + a count (each row carries\nuser_uuid/email/full_name/role/branch fields; kept loose)."},"AiNoteDTO":{"properties":{"section_key":{"type":"string","title":"Section Key"},"observation":{"type":"string","title":"Observation"},"seq":{"type":"integer","title":"Seq","default":0},"source":{"type":"string","title":"Source","default":"ziffy"},"model_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Version"},"finding_status":{"type":"string","title":"Finding Status","default":"draft"}},"type":"object","required":["section_key","observation"],"title":"AiNoteDTO"},"AiTagApplyEdit":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"role":{"type":"string","enum":["client","job","fiscal_year","source","ignore"],"title":"Role"},"target_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Uuid"}},"type":"object","required":["folder_id","role"],"title":"AiTagApplyEdit","description":"One human-reviewed folder role from the review step. `target_uuid` is the Zato\nclient/job the user (or the AI) matched, when known (client/job roles only)."},"AiTagApplyRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"run_id":{"type":"string","title":"Run Id"},"edits":{"items":{"$ref":"#/components/schemas/AiTagApplyEdit"},"type":"array","title":"Edits"}},"type":"object","required":["provider","run_id"],"title":"AiTagApplyRequest","description":"Persist the human-confirmed folder structure before auto-map. The edits overlay\nthe run's stored proposals (which carry parent_id/depth) by folder_id; a folder not\nin the proposals is resolved from the run's walked tree, so a newly-added folder is\nsupported too."},"AiTagApplyResponse":{"properties":{"marks":{"type":"integer","title":"Marks"},"tags":{"type":"integer","title":"Tags"}},"type":"object","required":["marks","tags"],"title":"AiTagApplyResponse"},"AiTagDispatchResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","status"],"title":"AiTagDispatchResponse","description":"202 ack — the run executes off the edge loop; poll the run / proposals by id."},"AiTagProposal":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"folder_label":{"type":"string","title":"Folder Label"},"role":{"type":"string","enum":["client","job","fiscal_year","source","ignore"],"title":"Role"},"target_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Uuid"},"target_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Label"},"fiscal_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"}},"type":"object","required":["folder_id","folder_label","role"],"title":"AiTagProposal","description":"One LLM per-folder proposal, seeding the review drawer. `role` client/job →\na client/job tag (confirm via save_tags); fiscal_year/source → a structure mark.\n`target_uuid`/`target_label` only apply to client/job roles."},"AiTagProposalsResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"proposals":{"items":{"$ref":"#/components/schemas/AiTagProposal"},"type":"array","title":"Proposals"},"truncated":{"type":"boolean","title":"Truncated","default":false},"classification":{"anyOf":[{"$ref":"#/components/schemas/StructureClassification"},{"type":"null"}]}},"type":"object","required":["run_id","status"],"title":"AiTagProposalsResponse","description":"The completed run's proposals (read once the run banner reports done). `status`\nmirrors the run lifecycle; `proposals` is empty until it completes. `truncated`\nflags that the folder tree was sampled (too large to send whole). `classification`\nis the structured-vs-unstructured verdict + level chain, derived from the proposals."},"AiTagRequest":{"properties":{"provider":{"type":"string","title":"Provider"}},"type":"object","required":["provider"],"title":"AiTagRequest","description":"Kick off an AI auto-tag run for one folder provider."},"AkahuAccountBalanceSchema":{"properties":{"balance_uuid":{"type":"string","title":"Balance Uuid"},"bank_account_id_ref":{"type":"integer","title":"Bank Account Id Ref"},"balance_date":{"type":"string","format":"date","title":"Balance Date"},"closing_balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Closing Balance"},"opening_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Opening Balance"},"total_credits":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Credits"},"total_debits":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Debits"},"transaction_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transaction Count"},"calculation_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calculation Method"},"calculation_metadata":{"additionalProperties":true,"type":"object","title":"Calculation Metadata"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"status":{"type":"string","title":"Status"},"is_verified":{"type":"boolean","title":"Is Verified"}},"type":"object","required":["balance_uuid","bank_account_id_ref","balance_date","closing_balance","calculation_metadata","status","is_verified"],"title":"AkahuAccountBalanceSchema"},"AkahuActionResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"AkahuActionResponse","description":"Bare ``{status, message}`` ack returned by the disconnect / send-link\nactions. This module predates the shared ``{data, meta, errors}`` envelope and\nthese handlers return a raw dict, so the documented shape is the bare ack\n(not wrapped in ``Envelope[...]``)."},"AkahuBalanceRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the client whose connected accounts to compute closing balances for. Required.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"]},"job_uuid":{"type":"string","title":"Job Uuid","description":"UUID of the job the balances are computed against. Required — the backend resolves it via jobs.get_for_firm and raises if not found.","examples":["f9e8d7c6-b5a4-3210-fedc-ba9876543210"]},"balance_date":{"type":"string","format":"date","title":"Balance Date","description":"Date (YYYY-MM-DD) to compute the closing balance as of. Required.","examples":["2026-03-31"]}},"type":"object","required":["client_uuid","job_uuid","balance_date"],"title":"AkahuBalanceRequest"},"AkahuBalanceResponse":{"properties":{"status":{"type":"string","title":"Status"},"balances":{"items":{"$ref":"#/components/schemas/AkahuAccountBalanceSchema"},"type":"array","title":"Balances"}},"type":"object","required":["status","balances"],"title":"AkahuBalanceResponse"},"AkahuBankAccountSchema":{"properties":{"bank_account_uuid":{"type":"string","title":"Bank Account Uuid"},"external_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Account Id"},"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Name"},"bank_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Logo Url"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number"},"account_number_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number Formatted"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"account_holder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Holder Name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"current_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Current Balance"},"available_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Available Balance"},"balance_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Balance Updated At"},"status":{"type":"string","title":"Status"},"is_primary":{"type":"boolean","title":"Is Primary"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"connection_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Type"}},"type":"object","required":["bank_account_uuid","status","is_primary"],"title":"AkahuBankAccountSchema"},"AkahuConnectRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the client to connect to Akahu. Required — the OAuth authorize URL is built from it unconditionally.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"]}},"type":"object","required":["client_uuid"],"title":"AkahuConnectRequest"},"AkahuConnectResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["authorize_url"],"title":"AkahuConnectResponse"},"AkahuConnectionSchema":{"properties":{"credential_uuid":{"type":"string","title":"Credential Uuid"},"provider_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider User Email"},"status":{"type":"string","title":"Status"},"accounts":{"items":{"$ref":"#/components/schemas/AkahuBankAccountSchema"},"type":"array","title":"Accounts"}},"type":"object","required":["credential_uuid","status","accounts"],"title":"AkahuConnectionSchema","description":"One Akahu connection (one email / user access token) and its accounts.\n\nA client can authorise accounts under several Akahu identities; each is a\nseparate connection with its own revoke control."},"AkahuSendLinkRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the client the authorization link is for. Required — resolved to the firm's client before the email is sent.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"]},"email":{"type":"string","title":"Email","description":"Recipient email address the Akahu authorization link is sent to. Required — passed straight to the transactional mailer.","examples":["owner@example.com"]},"authorize_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorize Url","description":"Optional pre-generated authorization URL. Omit it and the backend mints the Consumer Information page link itself (the accountant only sends the email and never opens the link); pass one only for back-compat.","examples":["https://oauth.akahu.io/?client_id=app_token_xxx"]}},"type":"object","required":["client_uuid","email"],"title":"AkahuSendLinkRequest"},"AkahuStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"provider_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider User Email"},"accounts":{"items":{"$ref":"#/components/schemas/AkahuBankAccountSchema"},"type":"array","title":"Accounts"},"connections":{"items":{"$ref":"#/components/schemas/AkahuConnectionSchema"},"type":"array","title":"Connections","default":[]}},"type":"object","required":["status","accounts"],"title":"AkahuStatusResponse"},"AkahuSyncRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the client whose Akahu bank accounts to refresh. Required — resolved to the firm's client before syncing.","examples":["c1a2b3d4-e5f6-7890-abcd-1234567890ab"]}},"type":"object","required":["client_uuid"],"title":"AkahuSyncRequest"},"AnalyzeAnomaliesOut":{"properties":{"candidates":{"items":{"$ref":"#/components/schemas/WpCandidateOut"},"type":"array","title":"Candidates"}},"type":"object","required":["candidates"],"title":"AnalyzeAnomaliesOut"},"AnalyzeRequest":{"properties":{"benchmark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Benchmark","description":"Materiality benchmark — one of revenue | pbt | expenses | assets | equity. Optional override; engine defaults to 'revenue'.","examples":["revenue"]},"om_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.01},{"type":"null"}],"title":"Om Pct","description":"Overall Materiality as a percent of the benchmark (0.01–100). Optional override; engine picks the ISA-320 default for the benchmark.","examples":[1.0]},"pm_factor":{"anyOf":[{"type":"number","maximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Pm Factor","description":"Performance Materiality factor as a 0-1 fraction of OM (e.g. 0.5). Optional override; engine default 0.5.","examples":[0.5]},"ct_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.1},{"type":"null"}],"title":"Ct Pct","description":"Clearly-Trivial threshold as a percent (0.1–100). Optional override; engine default 5.","examples":[5.0]},"move_pct":{"anyOf":[{"type":"number","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Move Pct","description":"Year-on-year movement threshold percent that flags a swing (0–1000). Optional override; engine default 25.","examples":[25.0]},"pl_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pl Only","description":"When true, restrict the analysis to P&L accounts only. Optional; engine default false.","examples":[false]},"include_rules":{"type":"boolean","title":"Include Rules","description":"Run the firm-rules (GL Rules Builder conditions) pass alongside the statistical detectors. Optional; defaults to true.","default":true,"examples":[true]},"gst_registered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gst Registered","description":"Override the client's GST registration flag for the firm-rules pass. Optional; defaults to true when the rules pass runs.","examples":[true]}},"type":"object","title":"AnalyzeRequest","description":"Config overrides for one analysis run.\n\nEvery field is an OPTIONAL override — omit any (or POST an empty body) and the\nengine applies its ISA-320 defaults (GL_Scrutiny.md §10). Only explicitly-set\nvalues are forwarded (see ``config_dict``)."},"AnswerOut":{"properties":{"snapshot_question_uuid":{"type":"string","title":"Snapshot Question Uuid"},"section_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Name"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"question_type":{"type":"string","title":"Question Type"},"value":{"anyOf":[{},{"type":"null"}],"title":"Value"},"additional_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Response"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments"},"files":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Files","default":[]}},"type":"object","required":["snapshot_question_uuid","question_type"],"title":"AnswerOut"},"ApiKeyOut":{"properties":{"key_uuid":{"type":"string","title":"Key Uuid"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"is_revoked":{"type":"boolean","title":"Is Revoked"}},"type":"object","required":["key_uuid","name","key_prefix","scopes","is_revoked"],"title":"ApiKeyOut"},"ApprovalActionIn":{"properties":{"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Optional reviewer note recorded with the approve/unapprove/reject action.","examples":["Looks good — approved."]}},"type":"object","title":"ApprovalActionIn"},"ApproveAccountOut":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"approved":{"type":"boolean","title":"Approved"}},"type":"object","required":["account_uuid","approved"],"title":"ApproveAccountOut","description":"`POST .../accounts/{uuid}/approve` — single-account approve ack."},"ApproveAllOut":{"properties":{"run_id":{"type":"string","title":"Run Id"},"memory_upserts":{"type":"integer","title":"Memory Upserts"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"}},"type":"object","required":["run_id","memory_upserts","job_uuid_ref"],"title":"ApproveAllOut"},"Ask":{"properties":{"options":{"items":{"$ref":"#/components/schemas/AskOption"},"type":"array","maxItems":12,"title":"Options"},"multi_select":{"type":"boolean","title":"Multi Select","default":false},"allow_text":{"type":"boolean","title":"Allow Text","default":false},"placeholder":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Placeholder"}},"type":"object","title":"Ask","description":"A human-in-the-loop prompt: Ziffy is asking the user to choose/answer. The\nquestion text rides in ``AskResponse.answer``; this carries the input controls."},"AskOption":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"value":{"type":"string","maxLength":400,"minLength":1,"title":"Value"}},"type":"object","required":["label","value"],"title":"AskOption","description":"One clickable choice in a HITL prompt. ``label`` is shown; ``value`` is sent\nback as the user's next message (defaults to the label)."},"AskRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question","description":"The user's question or command for Ziffy.","examples":["Summarise the open jobs for client ACME."]},"history":{"items":{"$ref":"#/components/schemas/Turn"},"type":"array","maxItems":20,"title":"History","description":"Recent prior turns replayed for conversational context; trimmed to the last 20 (the service uses the last 10)."},"client_uuid":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Uuid","description":"Active workspace client scope; pins Ziffy to this client so grounded answers never mix another client's data. Omit for firm-wide scope.","examples":["b3f1c2d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"]},"job_uuid":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Job Uuid","description":"Active workspace job scope; pins Ziffy to this job (which also pins its client). Omit for client-only or firm-wide scope.","examples":["a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d"]},"session_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Session Id","description":"Existing chat thread to append to. Omit to start a fresh session (its id is returned in the response)."},"voice_mode":{"type":"boolean","title":"Voice Mode","description":"When true, Ziffy replies in a short, spoken/voice-friendly style (forwarded to the agent's system prompt).","default":false},"transient":{"type":"boolean","title":"Transient","description":"When true, answer the request without saving it to Ziffy chat history. Used for modal-only drafts/actions.","default":false},"context_hint":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Context Hint","description":"Voice mode: a brief app-location hint prepended to the prompt so Ziffy answers contextually without a tool round-trip."},"page_data":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Page Data","description":"Voice mode: the visible screen data prepended to the prompt (paired with context_hint)."}},"type":"object","required":["question"],"title":"AskRequest"},"AskResponse":{"properties":{"answer":{"type":"string","title":"Answer"},"response_id":{"type":"string","title":"Response Id","default":""},"model_id":{"type":"string","title":"Model Id"},"elapsed_ms":{"type":"number","title":"Elapsed Ms"},"fallback_used":{"type":"boolean","title":"Fallback Used","default":false},"tools_used":{"items":{"type":"string"},"type":"array","title":"Tools Used"},"ask":{"anyOf":[{"$ref":"#/components/schemas/Ask"},{"type":"null"}]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"action":{"anyOf":[{"$ref":"#/components/schemas/ActionCard"},{"type":"null"}]},"navigation":{"anyOf":[{"$ref":"#/components/schemas/NavigationCard"},{"type":"null"}]},"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanView"},{"type":"null"}]},"suggestions":{"items":{"$ref":"#/components/schemas/Suggestion"},"type":"array","title":"Suggestions"}},"type":"object","required":["answer","model_id","elapsed_ms"],"title":"AskResponse"},"AssembleAccepted":{"properties":{"run_id":{"type":"string","title":"Run Id"},"report_uuid":{"type":"string","title":"Report Uuid"},"status":{"type":"string","title":"Status"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"}},"type":"object","required":["run_id","report_uuid","status","job_uuid_ref"],"title":"AssembleAccepted"},"AssignRequest":{"properties":{"user_uuid":{"type":"string","title":"User Uuid","description":"UUID of the firm teammate to assign; must belong to the caller's firm (else 404). Required.","examples":["3f1c9a7e-8b2d-4e5a-9c10-2b6f4d8e1a90"]},"type":{"type":"string","title":"Type","description":"Assignment role. Optional; defaults to 'member', and any unrecognised value is coerced to 'member'. Client assignments accept: member, manager, partner. Job assignments accept: member, manager, reviewer, preparer.","default":"member","examples":["member"]}},"type":"object","required":["user_uuid"],"title":"AssignRequest"},"AssignRequestPayload":{"properties":{"assignee_user_uuid":{"type":"string","title":"Assignee User Uuid","description":"UUID of the support user to assign this request to. The user's role must be valid for the request type (organization requests → support_manager; job requests → support_admin/manager/account_owner), else the request is rejected with a validation error.","examples":["9f1c2e7a-4b6d-4c2e-8a1f-2d3e4f5a6b7c"]}},"type":"object","required":["assignee_user_uuid"],"title":"AssignRequestPayload"},"AssigneeListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AssigneeOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AssigneeListOut","description":"``GET /queries/assignees`` payload — users eligible to investigate."},"AssigneeOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["user_id"],"title":"AssigneeOut","description":"An internal user eligible to investigate a query."},"AttachResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"wp_code":{"type":"string","title":"Wp Code"},"attached":{"type":"boolean","title":"Attached"}},"type":"object","required":["file_uuid","wp_code","attached"],"title":"AttachResult","description":"Ack for attaching a file to a workpaper as supporting evidence."},"AttachSupportingDocRequest":{"properties":{"file_uuid":{"type":"string","title":"File Uuid","description":"UUID of the existing Zbox file to attach to the workpaper as supporting evidence. Required.","examples":["f-9a2c1e"]}},"type":"object","required":["file_uuid"],"title":"AttachSupportingDocRequest","description":"Attach an existing Zbox file to a workpaper as supporting evidence."},"AttachableFile":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"}},"type":"object","required":["file_uuid","file_name"],"title":"AttachableFile","description":"A job Zbox file offered in the in-drawer Attach picker (all job files minus the ones already attached to\nthis workpaper + the job's own GL/TB ledgers). ``wp_code`` is the file's categorised workpaper, if any."},"AttachableFilesResponse":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"files":{"items":{"$ref":"#/components/schemas/AttachableFile"},"type":"array","title":"Files","default":[]}},"type":"object","required":["wp_code"],"title":"AttachableFilesResponse","description":"The Attach picker pool for a workpaper (searched client-side)."},"AttachmentListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AttachmentOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AttachmentListOut","description":"``GET /queries/{uuid}/attachments`` payload — files on the query + its thread."},"AttachmentOut":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"target_type":{"type":"string","title":"Target Type"},"response_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Uuid"},"linked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked At"},"linked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked By"},"linked_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked By Name"}},"type":"object","required":["file_uuid","file_name","target_type","response_uuid","linked_at","linked_by","linked_by_name"],"title":"AttachmentOut","description":"One attachment linked to a query or one of its thread responses."},"AttachmentUploadOut":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"target_type":{"type":"string","title":"Target Type"},"target_uuid":{"type":"string","title":"Target Uuid"}},"additionalProperties":true,"type":"object","required":["file_uuid","target_type","target_uuid"],"title":"AttachmentUploadOut","description":"``POST /queries/{uuid}/attachments`` payload — the uploaded file merged with\nits link target. Carries the ZBox upload fields (``file_uuid``, ``file_name`` …);\nadditional ZBox-owned keys pass through (``extra='allow'``)."},"AttachmentViewUrlOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"AttachmentViewUrlOut","description":"``GET /queries/{uuid}/attachments/{file_uuid}/view-url`` payload."},"AuditEventOut":{"properties":{"event_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Uuid"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"decision_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Type"},"actor_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Kind"},"actor_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Uuid"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"After"}},"type":"object","required":["event_uuid","at","decision_type","actor_kind","actor_uuid","source","before","after"],"title":"AuditEventOut","description":"One query-domain decision event in the audit timeline."},"AuditItemOut":{"properties":{"coa_mapping_audit_id":{"type":"integer","title":"Coa Mapping Audit Id"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"by_user_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"By User Uuid Ref"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Name"},"old_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Parent Key"},"new_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Parent Key"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["coa_mapping_audit_id"],"title":"AuditItemOut","description":"One `GET /coa/audit` row (``at`` serialized to ISO-8601 or null)."},"AuditListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditEventOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AuditListOut","description":"``GET /queries/{uuid}/audit`` payload — recent decision events, newest first."},"AuditQueryOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditItemOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AuditQueryOut","description":"`GET /coa/audit` — the append-only audit trail."},"AuditedMapping":{"properties":{"account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Uuid"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"predicted_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Parent Key"},"predicted_parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Parent Name"},"current_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Parent Key"},"audited_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audited Parent Key"},"audited_parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audited Parent Name"},"audit_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Reason"},"audit_unresolved":{"type":"boolean","title":"Audit Unresolved","default":false},"similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"},"confidence_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Tier"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","title":"AuditedMapping"},"AutoJournalDispatch":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status","default":"dispatched"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"},"wp_code":{"type":"string","title":"Wp Code"}},"type":"object","required":["run_id","job_uuid_ref","wp_code"],"title":"AutoJournalDispatch","description":"202 response for the Auto Journals suggest trigger — the run to watch. Ziffy\ndrafts the journals off the edge loop; each drafted journal streams back over the\n``user:<id>`` WS lane as a ``journal_draft`` frame."},"AutoMapClientsResponse":{"properties":{"matched":{"type":"integer","title":"Matched"},"total_clients":{"type":"integer","title":"Total Clients"},"total_entities":{"type":"integer","title":"Total Entities"}},"type":"object","required":["matched","total_clients","total_entities"],"title":"AutoMapClientsResponse","description":"Exact-name auto-map result counts."},"AutoMapFuzzyResponse":{"properties":{"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"matches":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Matches","default":[]}},"type":"object","required":["created","updated"],"title":"AutoMapFuzzyResponse","description":"Fuzzy auto-map result — created/updated counts plus the suggested matches\n(each match is an open dict: fyi_entity_id/name, zato_client_uuid/name, confidence)."},"AutomapStatusOut":{"properties":{"running":{"type":"boolean","title":"Running"}},"type":"object","required":["running"],"title":"AutomapStatusOut","description":"`GET /coa/clients/{uuid}/automap-status` — is the agent running right now?"},"AvatarRemovedResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["ok"],"title":"AvatarRemovedResponse","description":"Acknowledgement for avatar removal."},"AvatarUrlResponse":{"properties":{"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["avatar_url"],"title":"AvatarUrlResponse","description":"The caller's avatar URL — null when no avatar is set."},"BankAccountItem":{"properties":{"account_id":{"type":"string","title":"Account Id"},"bank_account_uuid":{"type":"string","title":"Bank Account Uuid","default":""},"name":{"type":"string","title":"Name","default":""},"bank_name":{"type":"string","title":"Bank Name","default":""},"account_number":{"type":"string","title":"Account Number","default":""},"currency":{"type":"string","title":"Currency","default":""},"provider":{"type":"string","title":"Provider","default":""},"coa_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Account Uuid"},"coa_code":{"type":"string","title":"Coa Code","default":""},"coa_name":{"type":"string","title":"Coa Name","default":""}},"type":"object","required":["account_id"],"title":"BankAccountItem"},"BankFeedAccountSchema":{"properties":{"bank_account_uuid":{"type":"string","title":"Bank Account Uuid"},"external_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Connection Id"},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"},"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Name"},"bank_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Logo Url"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number"},"account_number_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number Formatted"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"account_holder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Holder Name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"current_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Current Balance"},"available_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Available Balance"},"balance_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Balance Updated At"},"status":{"type":"string","title":"Status"},"is_primary":{"type":"boolean","title":"Is Primary"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"latest_transaction":{"anyOf":[{"$ref":"#/components/schemas/LatestTransactionSchema"},{"type":"null"}]},"coa_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Account Uuid"}},"type":"object","required":["bank_account_uuid","status","is_primary"],"title":"BankFeedAccountSchema","description":"Provider-agnostic bank account (akahu/basiq/…) for the client Overview's\nConnected Bank Accounts, with its single latest transaction."},"BankFeedPreviewRequest":{"properties":{"client_uuid":{"type":"string","minLength":1,"title":"Client Uuid","description":"Client whose connected bank feed to preview.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Provider external account id; null ⇒ all connected accounts.","examples":["acc_1234567890"]},"start":{"type":"string","title":"Start","description":"Range start date, inclusive (YYYY-MM-DD).","examples":["2026-03-01"]},"end":{"type":"string","title":"End","description":"Range end date, inclusive (YYYY-MM-DD).","examples":["2026-03-31"]},"region":{"type":"string","title":"Region","description":"Region/country code; defaults to the portal country.","examples":["nz"]}},"type":"object","required":["client_uuid","start","end"],"title":"BankFeedPreviewRequest","description":"Count the posted transactions a feed pull WOULD return for the range — a pre-run preview\n(no run is created). Re-pulls live each time, so it doubles as the 'Re-pull' refresh."},"BankFeedPreviewResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"count":{"type":"integer","title":"Count","default":0},"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"}},"type":"object","required":["client_uuid","start","end"],"title":"BankFeedPreviewResponse"},"BankFeedRunRequest":{"properties":{"client_uuid":{"type":"string","minLength":1,"title":"Client Uuid","description":"Client whose connected bank feed to pull.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Provider external account id; null ⇒ all connected accounts.","examples":["acc_1234567890"]},"start":{"type":"string","title":"Start","description":"Range start date, inclusive (YYYY-MM-DD).","examples":["2026-03-01"]},"end":{"type":"string","title":"End","description":"Range end date, inclusive (YYYY-MM-DD).","examples":["2026-03-31"]},"region":{"type":"string","title":"Region","description":"Region/country code; defaults to the portal country.","examples":["nz"]},"use_stored_gl":{"type":"boolean","title":"Use Stored Gl","default":true},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional run name."}},"type":"object","required":["client_uuid","start","end"],"title":"BankFeedRunRequest","description":"Pull a date range of transactions from the client's connected bank and autocode them."},"BankFeedRunResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"status":{"type":"string","title":"Status","default":"pending"}},"type":"object","required":["ac_job_uuid"],"title":"BankFeedRunResponse","description":"The created autocoding run from a live feed pull. The feed flow has no\nuploaded GL/bank file, so this is just the run handle the UI navigates to."},"BankRowsIngestRequest":{"properties":{"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Client to code against. Required in practice for this path — it has no uploaded GL, so a client must be selected to source the ledger corpus.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]},"region":{"type":"string","title":"Region","description":"Region/country code; defaults to the portal country.","examples":["nz"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional run name."},"use_stored_gl":{"type":"boolean","title":"Use Stored Gl","default":true},"bank_rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Bank Rows","description":"The structured bank rows to code (must be present and non-empty).","examples":[[{"Amount":-42.5,"Date":"2026-03-01","Payee":"Amazon"}]]},"bank_columns":{"items":{"type":"string"},"type":"array","title":"Bank Columns","description":"Column order for the rows; defaults to the first row's keys.","examples":[["Date","Payee","Amount"]]}},"type":"object","required":["bank_rows"],"title":"BankRowsIngestRequest","description":"A structured bank feed (e.g. Xero/API) — no PDF/CSV. Rows are coded by the same\ncascade; the GL comes from the client's stored ledger and/or an attached file later."},"BankTransactionItem":{"properties":{"external_transaction_id":{"type":"string","title":"External Transaction Id"},"post_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Post Date"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"merchant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Name"},"amount":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Balance"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["external_transaction_id"],"title":"BankTransactionItem","description":"One stored bank transaction line for the listing."},"BasiqBankAccountSchema":{"properties":{"bank_account_uuid":{"type":"string","title":"Bank Account Uuid"},"external_connection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Connection Id"},"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Name"},"bank_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Logo Url"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number"},"account_number_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Number Formatted"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"account_holder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Holder Name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"current_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Current Balance"},"available_balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Available Balance"},"balance_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Balance Updated At"},"status":{"type":"string","title":"Status"},"is_primary":{"type":"boolean","title":"Is Primary"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["bank_account_uuid","status","is_primary"],"title":"BasiqBankAccountSchema"},"BasiqConnectResponse":{"properties":{"consent_url":{"type":"string","title":"Consent Url"}},"type":"object","required":["consent_url"],"title":"BasiqConnectResponse"},"BasiqStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"provider_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider User Email"},"accounts":{"items":{"$ref":"#/components/schemas/BasiqBankAccountSchema"},"type":"array","title":"Accounts"}},"type":"object","required":["status","accounts"],"title":"BasiqStatusResponse"},"BatchBucketsOut":{"properties":{"queued":{"items":{"$ref":"#/components/schemas/QueryOut"},"type":"array","title":"Queued"},"pushed":{"items":{"$ref":"#/components/schemas/QueryOut"},"type":"array","title":"Pushed"}},"type":"object","required":["queued","pushed"],"title":"BatchBucketsOut"},"BatchCreateIn":{"properties":{"queries":{"items":{"$ref":"#/components/schemas/QueryCreateIn"},"type":"array","minItems":1,"title":"Queries"}},"type":"object","required":["queries"],"title":"BatchCreateIn"},"BatchCreateOut":{"properties":{"created":{"items":{"type":"string"},"type":"array","title":"Created"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["created","count"],"title":"BatchCreateOut","description":"``POST /queries/batch`` payload — the created query UUIDs + count."},"BatchFlaggedOut":{"properties":{"updated":{"items":{"type":"string"},"type":"array","title":"Updated"}},"type":"object","required":["updated"],"title":"BatchFlaggedOut","description":"``POST /queries/batch/flag`` payload — the query UUIDs staged for the client."},"BatchMovedOut":{"properties":{"moved":{"items":{"type":"string"},"type":"array","title":"Moved"}},"type":"object","required":["moved"],"title":"BatchMovedOut","description":"``POST /queries/batch/move`` payload — the query UUIDs moved to the batch stage."},"BatchPushedOut":{"properties":{"pushed":{"items":{"type":"string"},"type":"array","title":"Pushed"}},"type":"object","required":["pushed"],"title":"BatchPushedOut","description":"``POST /queries/batch/push`` payload — the query UUIDs sent to the client."},"BatchUuidListIn":{"properties":{"query_uuids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Query Uuids"}},"type":"object","required":["query_uuids"],"title":"BatchUuidListIn"},"BoardResponse":{"properties":{"workpapers":{"items":{"$ref":"#/components/schemas/BoardWorkpaper"},"type":"array","title":"Workpapers","default":[]}},"type":"object","title":"BoardResponse","description":"The 'zoom out to all workpapers' board — every WP with its real supporting files, for cross-WP moves."},"BoardWorkpaper":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"name":{"type":"string","title":"Name"},"sections":{"items":{"$ref":"#/components/schemas/SupportingDocSection"},"type":"array","title":"Sections","default":[]},"primary_section_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Section Key"},"primary_section_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Section Label"}},"type":"object","required":["wp_code","name"],"title":"BoardWorkpaper","description":"One workpaper on the all-WP board — its files + GL account stubs GROUPED BY section (the SAME\n``SupportingDocSection`` shape the This-workpaper list uses, so both tabs render identically). A file whose\nhome WP differs is a cross-WP reference (the FE derives the \"ref\" tag from the row's own ``wp_code``)."},"Body_add_response_with_attachments_api_v1_client_me_queries__query_uuid__responses_with_attachments_post":{"properties":{"body":{"type":"string","title":"Body","description":"The reply text to post to the query thread.","examples":["Please find the requested bank statements attached."]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional file attachments to include with the reply. Every file uploads and links transactionally, or the whole reply is rolled back. Omit for a text-only reply.","default":[]}},"type":"object","required":["body"],"title":"Body_add_response_with_attachments_api_v1_client_me_queries__query_uuid__responses_with_attachments_post"},"Body_add_response_with_attachments_api_v1_queries__query_uuid__responses_with_attachments_post":{"properties":{"body":{"type":"string","title":"Body"},"kind":{"type":"string","title":"Kind","default":"comment"},"is_client_visible":{"type":"boolean","title":"Is Client Visible","default":false},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","required":["body"],"title":"Body_add_response_with_attachments_api_v1_queries__query_uuid__responses_with_attachments_post"},"Body_create_client_api_v1_clients_post":{"properties":{"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"client_mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Mobile Number"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date"},"is_xero":{"type":"boolean","title":"Is Xero","default":false},"is_farming":{"type":"boolean","title":"Is Farming","default":false},"group_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id Ref"},"client_entity_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Entity Type Id Ref"},"nzbn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nzbn"},"send_portal_invite":{"type":"boolean","title":"Send Portal Invite","default":false},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"assignee_uuids":{"items":{"type":"string"},"type":"array","title":"Assignee Uuids","default":[]},"coa_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Coa File"},"client_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Client File"}},"type":"object","title":"Body_create_client_api_v1_clients_post"},"Body_create_note_api_v1_notes_create_note__job_uuid___client_uuid__post":{"properties":{"workpaper_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Code","description":"WP code the note belongs to (the UI always sends it); omit only for a job-wide note not tied to any workpaper.","examples":["EXP"]},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name","description":"Human-readable workpaper name, stored for display alongside the note.","examples":["Expenses"]},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"The note text (the UI always sends it); may be omitted for an attachment-only note.","examples":["Please confirm the FY24 rent accrual before sign-off."]},"tagged_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagged Uuid Ref","description":"Stringified user id to @-mention on the note; empty / omitted = no tag.","examples":["42"]},"cell_field_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cell Field Id","description":"Links the note to a specific cell (doc field `_id`); omit for a workpaper-level note.","examples":["EXP.D.0"]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional attachment(s), ingested as canonical ZBox files.","default":[]}},"type":"object","title":"Body_create_note_api_v1_notes_create_note__job_uuid___client_uuid__post"},"Body_create_point_api_v1_review_points__job_uuid__post":{"properties":{"workpaper_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Code","description":"Workpaper the point is raised against; omit for a job-level point.","examples":["FIA"]},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name","description":"Display name of the workpaper (denormalized onto the thread).","examples":["Fixed Assets"]},"cell_field_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cell Field Id","description":"Specific workpaper cell the point targets; omit for a whole-WP point.","examples":["FIA.12"]},"content":{"type":"string","title":"Content","description":"Required. The point text (must be non-empty after trimming, else 422/validation).","examples":["Please confirm the opening balance for this asset class."]},"tagged_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagged Uuid Ref","description":"Stringified user id to tag/notify on the point; empty or omitted means none.","examples":["42"]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional supporting-doc attachments for the point.","default":[]}},"type":"object","required":["content"],"title":"Body_create_point_api_v1_review_points__job_uuid__post"},"Body_create_query_with_attachments_api_v1_queries_with_attachments_post":{"properties":{"query_type":{"type":"string","title":"Query Type"},"description":{"type":"string","title":"Description"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"source_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Key"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"},"is_client_visible":{"type":"boolean","title":"Is Client Visible","default":false},"is_batch_query":{"type":"boolean","title":"Is Batch Query","default":false},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","required":["query_type","description"],"title":"Body_create_query_with_attachments_api_v1_queries_with_attachments_post"},"Body_create_run_api_v1_jobs_autocoding_files_post":{"properties":{"gl_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Gl File","description":"Optional GL workbook (.xlsx/.xls). Omit when use_stored_gl is set."},"bank_files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Bank Files","description":"One or more bank statements (.csv/.xlsx/.xls/.pdf) — at least one required."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional run name."},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date","description":"Optional balance date (YYYY-MM-DD)."},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region","description":"Region/country code; None ⇒ service defaults to the portal country."},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Client to code against. Required when no GL file is uploaded (the run then codes off the client's stored/live ledger)."},"use_stored_gl":{"type":"boolean","title":"Use Stored Gl","description":"Code against the client's stored general_ledger instead of an uploaded GL.","default":false},"coa_bank_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Bank Account Uuid","description":"Optional COA bank account this statement posts into."}},"type":"object","required":["bank_files"],"title":"Body_create_run_api_v1_jobs_autocoding_files_post"},"Body_follow_up_point_api_v1_review_points__job_uuid___note_uuid__follow_up_post":{"properties":{"content":{"type":"string","title":"Content","description":"Required. The follow-up point text (must be non-empty after trimming).","examples":["Still not reconciled — please recheck the closing balance."]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional attachments for the follow-up point.","default":[]}},"type":"object","required":["content"],"title":"Body_follow_up_point_api_v1_review_points__job_uuid___note_uuid__follow_up_post"},"Body_manual_gl_upload_api_v1_gl_scrutiny_jobs__job_uuid__manual_gl_post":{"properties":{"which":{"type":"string","title":"Which","description":"Required. Which year's GL this file is — 'current' or 'last' (derived target FY comes from the job's financial year). Any other value is rejected with 422.","examples":["current"]},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Required. One year's GL export (xlsx/csv/xls) — ingested via the zbox + GL pipeline; a wrong-year file is rejected before any write."}},"type":"object","required":["which","file"],"title":"Body_manual_gl_upload_api_v1_gl_scrutiny_jobs__job_uuid__manual_gl_post"},"Body_patch_client_api_v1_clients__client_uuid__patch":{"properties":{"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"client_mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Mobile Number"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"business_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Structure"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"balance_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Month"},"is_xero":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Xero"},"is_farming":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Farming"},"group_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id Ref"},"client_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Type Id Ref"},"client_entity_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Entity Type Id Ref"},"nzbn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nzbn"},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"is_deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Deleted"},"send_portal_invite":{"type":"boolean","title":"Send Portal Invite","default":false},"coa_file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Coa File"}},"type":"object","title":"Body_patch_client_api_v1_clients__client_uuid__patch"},"Body_preview_tb_api_v1_coa_jobs__job_uuid__tb_preview_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"REQUIRED. The trial-balance spreadsheet to classify (.csv or .xlsx)."},"upload_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Kind","description":"Optional explicit format override ('csv' or 'xlsx')."}},"type":"object","required":["file"],"title":"Body_preview_tb_api_v1_coa_jobs__job_uuid__tb_preview_post"},"Body_promote_blocked_tb_api_v1_coa_jobs__job_uuid__tb_promote_blocked_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"REQUIRED. The same trial-balance spreadsheet the preview classified."},"accounts":{"type":"string","title":"Accounts","description":"REQUIRED. JSON array of the blocked rows to create, each with the Zato account type chosen for it: [{\"line\": 22, \"account_type_id\": 7}]."},"upload_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Kind","description":"Optional explicit format override ('csv' or 'xlsx')."}},"type":"object","required":["file","accounts"],"title":"Body_promote_blocked_tb_api_v1_coa_jobs__job_uuid__tb_promote_blocked_post"},"Body_respond_point_api_v1_review_points__job_uuid___note_uuid__respond_post":{"properties":{"content":{"type":"string","title":"Content","description":"Required. The response text (must be non-empty after trimming).","examples":["Attached the reconciled bank statement."]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional attachments for the response.","default":[]}},"type":"object","required":["content"],"title":"Body_respond_point_api_v1_review_points__job_uuid___note_uuid__respond_post"},"Body_respond_to_query_api_v1_partner_queries__query_uuid__response_put":{"properties":{"body":{"type":"string","maxLength":10000,"minLength":1,"title":"Body","description":"REQUIRED. The response message text (1–10000 chars).","examples":["Please find the missing March invoice attached."]},"responded_by":{"type":"string","minLength":1,"title":"Responded By","description":"REQUIRED. UUID of the firm user responding. Must be firm leadership (Director/Manager/Admin) or a user assigned to this query's job — else 403.","examples":["81bee014-b346-4256-837b-584a9e6f41da"]},"is_client_visible":{"type":"boolean","title":"Is Client Visible","description":"Whether this response is visible to the client (default false = firm-internal).","default":false,"examples":[false]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional 0..N attachments uploaded into Zbox and linked to this reply (≤20 files, ≤25 MB each).","default":[]}},"type":"object","required":["body","responded_by"],"title":"Body_respond_to_query_api_v1_partner_queries__query_uuid__response_put"},"Body_seed_knowledge_base_api_v1_coa_knowledge_base_seed_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"REQUIRED. CSV with columns coa_account_name + zato_parent_account_code (optional: entity_type, is_farming)."}},"type":"object","required":["file"],"title":"Body_seed_knowledge_base_api_v1_coa_knowledge_base_seed_post"},"Body_update_content_api_v1_notes_update_content__job_uuid___client_uuid__put":{"properties":{"note_id":{"type":"string","title":"Note Id","description":"The target note's `note_uuid` (field kept as `note_id` for FE compatibility). Required — identifies which note to edit.","examples":["3f2504e0-4f89-11d3-9a0c-0305e82c3301"]},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"New note text; omit to leave content unchanged (e.g. an attachment-only edit).","examples":["Updated: rent accrual confirmed."]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional attachment(s) to add to the note (ingested as ZBox files).","default":[]}},"type":"object","required":["note_id"],"title":"Body_update_content_api_v1_notes_update_content__job_uuid___client_uuid__put"},"Body_update_firm_details_api_v1_practice_firm_me_details_put":{"properties":{"logo":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Logo"},"terms":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Terms"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name","description":"Firm's display name."},"firm_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Email","description":"Firm's primary email."},"firm_primary_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Primary Phone","description":"Firm's primary phone."},"firm_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Address","description":"Firm street address."},"suburb":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suburb","description":"Firm suburb/locality."},"firm_pincode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Pincode","description":"Firm postcode/PIN."},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name","description":"Registered business name."},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name","description":"Firm contact person."},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number","description":"Firm IRD number; UI-required, optional here."},"practice_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Type","description":"Practice type/category."},"default_job_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Job Value","description":"Firm-wide Default Job Value (non-negative number)."},"billing_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Name","description":"Billing contact name."},"billing_contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Email","description":"Billing contact email."},"billing_contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Phone","description":"Billing contact phone."},"terms_accepted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Terms Accepted","description":"Sign Terms of Use in this PUT (one-time)."},"remove_logo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Remove Logo","description":"Clear saved logo when true and no new file."},"terms_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Content","description":"Client Terms HTML (mammoth.js extract)."}},"type":"object","title":"Body_update_firm_details_api_v1_practice_firm_me_details_put"},"Body_update_point_api_v1_review_points__job_uuid___note_uuid__put":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Replacement point text; omit to leave the text unchanged and only append files.","examples":["Updated: please confirm by Friday."]},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Optional additional attachments to append to the point.","default":[]}},"type":"object","title":"Body_update_point_api_v1_review_points__job_uuid___note_uuid__put"},"Body_upload_api_v1_jobs_pdf_splitter_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The multi-document 'bunch' PDF to split. Required; must be a .pdf."},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Optional client to associate the uploaded bunch with. Omit for a firm-level upload.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]}},"type":"object","required":["file"],"title":"Body_upload_api_v1_jobs_pdf_splitter_upload_post"},"Body_upload_attachment_api_v1_queries__query_uuid__attachments_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"response_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Uuid"}},"type":"object","required":["file"],"title":"Body_upload_attachment_api_v1_queries__query_uuid__attachments_post"},"Body_upload_avatar_api_v1_profile_me_avatar_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Required. The avatar image to upload (multipart field name 'file'). Must be a non-empty image/* file no larger than 350 KB; otherwise the request is rejected with 422."}},"type":"object","required":["file"],"title":"Body_upload_avatar_api_v1_profile_me_avatar_post"},"Body_upload_client_coa_api_v1_coa_clients__client_uuid__coa_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"REQUIRED. The client's full chart-of-accounts file (.csv or .xlsx) to ingest."}},"type":"object","required":["file"],"title":"Body_upload_client_coa_api_v1_coa_clients__client_uuid__coa_post"},"Body_upload_document_api_v1_client_me_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The document file to upload into ZBox for the caller's client."}},"type":"object","required":["file"],"title":"Body_upload_document_api_v1_client_me_documents_post"},"Body_upload_file_api_v1_questionnaire_r_files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The file to upload via ZBox and attach to the answer."}},"type":"object","required":["file"],"title":"Body_upload_file_api_v1_questionnaire_r_files_post"},"Body_upload_file_api_v1_zbox_files_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The document to upload (required; size-capped by zbox_upload_max_mb)."},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid","description":"Pre-link the upload to this job (its client is derived); omit for a firm/client upload."},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Pre-tag the upload to this client; ignored when job_uuid is given."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Manual source bucket to stamp (e.g. 'xero', 'ird'); validated against the source registry, ignored if unknown."},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id","description":"Client-minted batch id so the UI receives zbox:<batch_id> categorization frames."},"supporting_doc":{"type":"boolean","title":"Supporting Doc","description":"Store as a pure supporting doc (MJ attachments): pre-categorized 'others', not scored/extracted and kept out of the By-File mapping pool.","default":false},"assert_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assert Parent Key","description":"Known-category upload (e.g. a Z-Watch 'upload this document' card): the CoA parent OR a __LEDGER_*__ pick to assign deterministically — skips the scorer."},"assert_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assert Source","description":"Pool source for the asserted category (xero/ird/client_direct/ledger)."},"assert_sub_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assert Sub Key","description":"Pool sub key (== category slug) for the asserted category."}},"type":"object","required":["file"],"title":"Body_upload_file_api_v1_zbox_files_upload_post"},"Body_upload_questionnaire_file_api_v1_client_me_questionnaires__invitation_uuid__files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"The file to store as the answer for this question."}},"type":"object","required":["file"],"title":"Body_upload_questionnaire_file_api_v1_client_me_questionnaires__invitation_uuid__files_post"},"Body_upload_tb_api_v1_coa_jobs__job_uuid__tb_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"REQUIRED. The trial-balance spreadsheet to ingest (.csv or .xlsx)."},"upload_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Kind","description":"Optional explicit format override ('csv' or 'xlsx'); auto-detected from the filename/content-type when omitted."},"resolutions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolutions","description":"JSON object mapping a trial-balance line number to the CONFIRMED chart-of-accounts account_uuid, e.g. {\"6\": \"<uuid>\"}. Required for every account the preview flagged as needing review; a uuid that isn't one of that line's suggested candidates is rejected."}},"type":"object","required":["file"],"title":"Body_upload_tb_api_v1_coa_jobs__job_uuid__tb_upload_post"},"BootstrapConfig":{"properties":{"locale":{"type":"string","title":"Locale","description":"The deployment's active locale, e.g. 'en-NZ'."},"supported_locales":{"items":{"type":"string"},"type":"array","title":"Supported Locales","description":"Locales this deployment can switch between."},"country":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Country","description":"Active portal country profile slice (currency, formatting, identifier labels/regexes, tax, feature flags). Omitted if it fails to load."},"supported_countries":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Supported Countries","description":"Light summary ({country_code, name, currency}) of every configured country."},"job_type_rules":{"anyOf":[{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object"},{"type":"null"}],"title":"Job Type Rules","description":"Per-job-type UI rules keyed by job-type code. Omitted if the portal has none or the config fails to load."},"restricted_entity_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Restricted Entity Types","description":"Entity types whose clients only see their special job types and skip CoA (e.g. Individual → ITR)."}},"additionalProperties":true,"type":"object","required":["locale","supported_locales"],"title":"BootstrapConfig","description":"The deployment's public bootstrap config (locale + country/job-type slices).\n\n`locale` and `supported_locales` always ship. The `country`,\n`supported_countries`, `job_type_rules`, and `restricted_entity_types` blocks\nare best-effort — omitted if their config fails to load, since the login page\nmust still render."},"BranchCreate":{"properties":{"branch_name":{"type":"string","maxLength":255,"minLength":1,"title":"Branch Name","description":"Branch/office display name (required).","examples":["Auckland CBD"]},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Optional branch street address.","examples":["12 Queen St, Auckland 1010"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Optional branch contact email.","examples":["auckland@acmeaccounting.co.nz"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional branch phone (E.164); validated/normalised server-side.","examples":["+6493001234"]},"is_primary":{"type":"boolean","title":"Is Primary","description":"Marks this as the firm's primary branch. Defaults to false.","default":false}},"type":"object","required":["branch_name"],"title":"BranchCreate","description":"One branch/office row in the onboarding form."},"BranchRequest":{"properties":{"branch_name":{"type":"string","maxLength":255,"minLength":1,"title":"Branch Name","description":"Branch display name (required, non-empty).","examples":["Auckland CBD"]},"branch_code":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Branch Code","description":"Optional short branch code.","examples":["AKL"]},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name","description":"Optional branch contact person.","examples":["Jane Smith"]},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"Optional branch address."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Optional branch contact email.","examples":["akl@firm.co.nz"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional branch contact phone."},"is_primary":{"type":"boolean","title":"Is Primary","description":"Mark this as the firm's primary branch.","default":false},"manager_user_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager User Uuid","description":"Optional user_uuid to assign as branch head/manager; must belong to your firm."}},"type":"object","required":["branch_name"],"title":"BranchRequest"},"BranchResponse":{"properties":{"branch_uuid":{"type":"string","title":"Branch Uuid"},"branch_name":{"type":"string","title":"Branch Name"},"branch_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Code"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"is_primary":{"type":"boolean","title":"Is Primary"},"is_active":{"type":"boolean","title":"Is Active","default":true},"manager_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["branch_uuid","branch_name","is_primary"],"title":"BranchResponse"},"BranchRow":{"properties":{"branch_uuid":{"type":"string","title":"Branch Uuid"},"branch_name":{"type":"string","title":"Branch Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"is_primary":{"type":"boolean","title":"Is Primary"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["branch_uuid","branch_name","is_primary","is_active"],"title":"BranchRow"},"BulkApprovalIn":{"properties":{"action":{"type":"string","title":"Action","description":"Action to apply to every selected workpaper. One of: approve | unapprove | reject.","examples":["approve"]},"wp_codes":{"items":{"type":"string"},"type":"array","title":"Wp Codes","description":"Workpaper codes to act on (de-duped server-side; must contain at least one).","examples":[["FIA","EXP"]]},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Optional reviewer note stored on each transition and shown in the approval log.","examples":["Approved after the open query was cleared."]}},"type":"object","required":["action","wp_codes"],"title":"BulkApprovalIn"},"BulkDeleteRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to act on in bulk (soft-delete / restore / purge, per route).","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]}},"type":"object","required":["file_uuids"],"title":"BulkDeleteRequest"},"BulkDeleteResult":{"properties":{"deleted":{"type":"integer","title":"Deleted"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["deleted","missing"],"title":"BulkDeleteResult","description":"`POST /zbox/files/delete` — bulk soft-delete ack."},"BulkDelinkRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to delink from the job/client in the path (files stay in Zbox).","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]}},"type":"object","required":["file_uuids"],"title":"BulkDelinkRequest","description":"Bulk DELINK a selection from ONE job/client (the scope is in the path). Unlike\n``BulkDeleteRequest`` the files are PRESERVED — only their link to that scope detaches."},"BulkDelinkResult":{"properties":{"delinked":{"type":"integer","title":"Delinked"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["delinked","missing"],"title":"BulkDelinkResult","description":"`POST /zbox/{jobs|clients}/{uuid}/files/delink` — bulk delink ack: how many of the\nselected files were delinked from the scope, and how many were missing (malformed, or\nnot linked to that scope)."},"BulkLinkClientRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to tag with the client in one call.","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]},"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the client to tag all the files with (must belong to your firm).","examples":["a1b2c3d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]}},"type":"object","required":["file_uuids","client_uuid"],"title":"BulkLinkClientRequest"},"BulkLinkRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to link to the job in one call.","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]},"job_uuid":{"type":"string","title":"Job Uuid","description":"UUID of the job to link all the files to (must belong to your firm).","examples":["c4e2d3f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f"]}},"type":"object","required":["file_uuids","job_uuid"],"title":"BulkLinkRequest"},"BulkLinkResult":{"properties":{"linked":{"type":"integer","title":"Linked"},"already":{"type":"integer","title":"Already"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["linked","already","missing"],"title":"BulkLinkResult","description":"Bulk job/client link ack: counts of newly-linked, already-linked, and\nmissing (malformed/foreign) file ids."},"BulkPurgeResult":{"properties":{"purged":{"type":"integer","title":"Purged"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["purged","missing"],"title":"BulkPurgeResult","description":"`POST /zbox/files/purge` — bulk permanent-delete ack."},"BulkRestoreResult":{"properties":{"restored":{"type":"integer","title":"Restored"},"missing":{"type":"integer","title":"Missing"}},"type":"object","required":["restored","missing"],"title":"BulkRestoreResult","description":"`POST /zbox/files/restore` — bulk restore ack."},"BulkSetCategoryRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to apply the same category to.","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]},"parent_key":{"type":"string","title":"Parent Key","description":"The CoA parent key to apply to every file. MUST NOT be a ledger-slot key — General Ledger / Trial Balance are single-file-per-job and can never be bulk-applied (422).","examples":["INCOME"]},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","examples":["xero"]},"sub_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Key","examples":["sales"]},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid","description":"When set, writes a per-JOB category override onto each (file, job) link; omit for the firm-level path (same rule as SetCategoryRequest.job_uuid).","examples":["c4e2d3f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f"]}},"type":"object","required":["file_uuids","parent_key"],"title":"BulkSetCategoryRequest"},"BulkSetCategoryResult":{"properties":{"updated":{"items":{"type":"string"},"type":"array","title":"Updated"},"skipped":{"items":{"$ref":"#/components/schemas/BulkSetCategorySkip"},"type":"array","title":"Skipped"}},"type":"object","required":["updated","skipped"],"title":"BulkSetCategoryResult","description":"`POST /zbox/files/category/bulk` — bulk category-apply ack. `skipped` files\n(e.g. no longer linked to the job) don't fail the whole batch."},"BulkSetCategorySkip":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["file_uuid","reason"],"title":"BulkSetCategorySkip"},"BulkUploadRequest":{"properties":{"condition_ids":{"items":{"type":"integer"},"type":"array","title":"Condition Ids","description":"Rule (condition) ids to clone-allocate to the target clients. Required.","examples":[[12,15]]},"client_uuids":{"items":{"type":"string"},"type":"array","title":"Client Uuids","description":"Target client UUIDs. Optional — empty means all active firm clients.","examples":[["b1f2c3d4-0000-4a11-8b22-000000000001"]]}},"type":"object","required":["condition_ids"],"title":"BulkUploadRequest","description":"Allocate existing rules to a set of clients (clone-to-CLIENT)."},"CabinetItem":{"properties":{"fyi_cabinet_id":{"type":"string","title":"Fyi Cabinet Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"cabinet_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cabinet Type"},"is_knowledge":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Knowledge"},"jobs_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Jobs Enabled"},"hidden":{"type":"boolean","title":"Hidden"}},"type":"object","required":["fyi_cabinet_id","hidden"],"title":"CabinetItem","description":"A cached FYI cabinet with its hidden flag."},"CabinetsResponse":{"properties":{"cabinets":{"items":{"$ref":"#/components/schemas/CabinetItem"},"type":"array","title":"Cabinets"}},"type":"object","required":["cabinets"],"title":"CabinetsResponse"},"CandidateDecisionIn":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"origin":{"type":"string","title":"Origin"},"candidate_key":{"type":"string","title":"Candidate Key"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"query_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},"type":"object","required":["wp_code","origin","candidate_key"],"title":"CandidateDecisionIn","description":"Body for discard / mark-posted. job_uuid comes from the path."},"CandidatePostIn":{"properties":{"wp_code":{"type":"string","title":"Wp Code","default":""},"origin":{"type":"string","title":"Origin"},"candidate_key":{"type":"string","title":"Candidate Key"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"visibility":{"type":"string","title":"Visibility","default":"internal"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},"type":"object","required":["origin","candidate_key","title","description"],"title":"CandidatePostIn","description":"One-click post: create the query (internal, or external via send-to-client)\nand link the candidate. job_uuid comes from the path. wp_code is '' for a\njob-level missing-doc candidate."},"CarryForwardResult":{"properties":{"accounts_carried":{"type":"integer","title":"Accounts Carried"},"imported_from_prior":{"type":"integer","title":"Imported From Prior"},"files":{"type":"integer","title":"Files"},"discrepancies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Discrepancies"},"status":{"type":"string","title":"Status"},"source_tb_as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Tb As Of"},"authoritative":{"type":"boolean","title":"Authoritative"}},"type":"object","required":["accounts_carried","imported_from_prior","files","discrepancies","status","source_tb_as_of","authoritative"],"title":"CarryForwardResult","description":"Result of a prior-year carry-forward run (`carry_forward.run()`)."},"CatalogFile":{"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"level":{"type":"string","title":"Level","default":"parent"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"parent_key":{"type":"string","title":"Parent Key","default":""}},"type":"object","title":"CatalogFile"},"CatalogListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CatalogRow"},"type":"array","title":"Items"}},"type":"object","title":"CatalogListResponse","description":"Envelope payload for the flat account-mapping catalog (``{\"items\": [...]}``)."},"CatalogRow":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"section_index":{"type":"integer","title":"Section Index"},"section_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Name"},"parent_key":{"type":"string","title":"Parent Key"},"parent_name":{"type":"string","title":"Parent Name"},"is_multi_account":{"type":"boolean","title":"Is Multi Account","default":true},"addable":{"type":"boolean","title":"Addable","default":false},"section_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Mode"},"files_linked_to":{"type":"string","title":"Files Linked To","default":"section"},"files":{"items":{"$ref":"#/components/schemas/CatalogFile"},"type":"array","title":"Files"}},"type":"object","required":["wp_code","wp_name","section_index","parent_key","parent_name"],"title":"CatalogRow"},"CatalogueOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DefinitionSummary"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CatalogueOut","description":"The definition catalogue — one summary per workpaper (packs ∪ DB definitions)."},"CategoriesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CategoryOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CategoriesResponse"},"CategorizeAccepted":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"accepted":{"type":"integer","title":"Accepted"},"missing":{"items":{"type":"string"},"type":"array","title":"Missing","default":[]}},"type":"object","required":["batch_id","accepted"],"title":"CategorizeAccepted"},"CategorizeRequest":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids","description":"ZBox file UUIDs to run async AI categorization on.","examples":[["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]]},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id","description":"Optional client-minted batch id so the UI can subscribe to zbox:<batch_id> progress frames BEFORE the work starts.","examples":["a1b2c3d4e5f6"]}},"type":"object","required":["file_uuids"],"title":"CategorizeRequest"},"CategoryCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Display name for the new tracking category. Required, non-empty, and unique per client (case-insensitive).","examples":["Region"]}},"type":"object","required":["name"],"title":"CategoryCreate"},"CategoryNeed":{"properties":{"category":{"type":"string","title":"Category"},"label":{"type":"string","title":"Label"},"parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Key"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"sub_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Key"},"is_ledger":{"type":"boolean","title":"Is Ledger","default":false}},"type":"object","required":["category","label"],"title":"CategoryNeed","description":"A document a workpaper still needs, carrying the EXACT assignment to stamp when\nthe user uploads it via Z-Watch — so the upload is categorized deterministically\n(no re-detection, no origin-lock, no LLM tiebreak). ``parent_key``/``source``/\n``sub_key`` feed ``set_category``; ``is_ledger`` routes GL/TB to the ledger-slot\nfill. Assignments are sourced from ``wp_category_def`` (the canonical file-category\nhome), so Z-Watch and the By-File/By-Workpaper lists agree by construction."},"CategoryOut":{"properties":{"parent_key":{"type":"string","title":"Parent Key"},"source_group":{"type":"string","title":"Source Group"},"source_label":{"type":"string","title":"Source Label"},"sub_key":{"type":"string","title":"Sub Key"},"name":{"type":"string","title":"Name"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"exclusive":{"type":"boolean","title":"Exclusive","default":false},"target_table":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Table"}},"type":"object","required":["parent_key","source_group","source_label","sub_key","name"],"title":"CategoryOut"},"CategoryPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New category name (rename). Omit to leave unchanged; must stay unique per client. Propagates into general_ledger.tracking.","examples":["Cost Centre"]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Set false to archive, true to restore/activate (subject to the active-category cap). Omit to leave unchanged.","examples":[true]}},"type":"object","title":"CategoryPatch","description":"Partial update — send only the field(s) to change; omit the rest."},"CheckDuplicateRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"The bunch PDF's file name to check for an existing same-name upload under this firm (and client, if given). Required.","examples":["Bunch_Invoices_Q1.pdf"]},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Optional client scope — restrict the duplicate check to this client's uploads. Omit to check firm-wide.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]}},"type":"object","required":["file_name"],"title":"CheckDuplicateRequest"},"CheckDuplicateResponse":{"properties":{"is_duplicate":{"type":"boolean","title":"Is Duplicate","default":false},"duplicate_files":{"items":{"$ref":"#/components/schemas/DuplicateFile"},"type":"array","title":"Duplicate Files"}},"type":"object","title":"CheckDuplicateResponse"},"ClientAccountItem":{"properties":{"account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Uuid"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"tax_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type"},"reporting_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reporting Code"},"reporting_code_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reporting Code Name"},"tax_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Code"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"provider_account_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Account Class"},"system_account":{"anyOf":[{},{"type":"null"}],"title":"System Account"},"account_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Type Id"},"zato_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Account Type"},"zato_account_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Account Class"},"zato_type_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Type Code"},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Key"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"needs_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Review"},"last_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Outcome"},"is_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Approved"},"balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Balance"}},"additionalProperties":true,"type":"object","title":"ClientAccountItem","description":"One row in the client COA grid (chart_of_accounts + AI-prediction meta).\nExtra keys pass through unchanged (docs-only)."},"ClientAccountsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientAccountItem"},"type":"array","title":"Items"},"coa_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa File Name"},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced At"},"has_trial_balance":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Trial Balance"}},"additionalProperties":true,"type":"object","required":["items"],"title":"ClientAccountsResponse","description":"`GET /coa/clients/{uuid}/accounts` — chart rows + file name + sync meta."},"ClientAgedLiveResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"totals":{"additionalProperties":true,"type":"object","title":"Totals"}},"type":"object","required":["client_uuid","rows","totals"],"title":"ClientAgedLiveResponse","description":"Live aged payables / receivables computed from synced data via the engine."},"ClientApproveAllOut":{"properties":{"confirmed":{"type":"integer","title":"Confirmed"},"unmapped":{"type":"integer","title":"Unmapped"}},"additionalProperties":true,"type":"object","required":["confirmed","unmapped"],"title":"ClientApproveAllOut","description":"`POST /coa/clients/{uuid}/approve-all` — confirmed + still-unmapped counts."},"ClientAttachmentListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientAttachmentOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ClientAttachmentListOut","description":"Client-visible attachments on a query and its client-visible responses."},"ClientAttachmentOut":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"target_type":{"type":"string","title":"Target Type"},"response_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Uuid"},"linked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Linked At"}},"type":"object","required":["file_uuid","file_name","target_type"],"title":"ClientAttachmentOut"},"ClientAutomapOut":{"properties":{"total":{"type":"integer","title":"Total"},"auto":{"type":"integer","title":"Auto"},"review":{"type":"integer","title":"Review"},"unmapped":{"type":"integer","title":"Unmapped"}},"additionalProperties":true,"type":"object","required":["total","auto","review","unmapped"],"title":"ClientAutomapOut","description":"`POST /coa/clients/{uuid}/automap` — mapping-run tallies. ``error``/``hint``\nappear only on the agent-unavailable fallback (extra keys pass through)."},"ClientContactsResponse":{"properties":{"contacts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Contacts"}},"type":"object","required":["contacts"],"title":"ClientContactsResponse","description":"Active Xero contacts for a client (drives the AP/AR per-contact picker)."},"ClientCopyOptions":{"properties":{"has_prior_year":{"type":"boolean","title":"Has Prior Year","description":"True if the client already has a copy of this firm template for a different financial year (so the UI can offer 'start from last year').","default":false},"prior_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Year","description":"Financial year of the most recent prior-year client copy, if any.","examples":["2024-2025"]}},"type":"object","title":"ClientCopyOptions"},"ClientCreateResponse":{"properties":{"client":{"$ref":"#/components/schemas/ClientDetail"},"invite":{"anyOf":[{"$ref":"#/components/schemas/ClientInviteResult"},{"type":"null"}]}},"type":"object","required":["client"],"title":"ClientCreateResponse"},"ClientDelinkResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"client_uuid":{"type":"string","title":"Client Uuid"},"delinked":{"type":"boolean","title":"Delinked"},"links_detached":{"type":"integer","title":"Links Detached"}},"type":"object","required":["file_uuid","client_uuid","delinked","links_detached"],"title":"ClientDelinkResult","description":"`DELETE /zbox/clients/{client_uuid}/files/{file_uuid}` — client-tag delink ack (the\nfile is preserved; only its direct client link detaches)."},"ClientDetail":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"client_mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Mobile Number"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"business_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Structure"},"is_xero":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Xero"},"is_farming":{"type":"boolean","title":"Is Farming","default":false},"balance_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Balance Date"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"jobs_count":{"type":"integer","title":"Jobs Count","default":0},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"group_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id Ref"},"can_view":{"type":"boolean","title":"Can View","default":false},"can_edit":{"type":"boolean","title":"Can Edit","default":false},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"coa_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa File Name"},"balance_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Month"},"firm_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Firm Id Ref"},"client_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Type Id Ref"},"client_entity_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Entity Type Id Ref"},"nzbn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nzbn"},"external_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"External Info"},"portal_invited":{"type":"boolean","title":"Portal Invited","default":false},"has_jobs":{"type":"boolean","title":"Has Jobs","default":false}},"type":"object","required":["client_uuid","client_name","contact_name","client_email","client_mobile_number","country_code","business_structure","is_xero","balance_date","created_at","branch_uuid","branch_name","group_id_ref","address","ird_number","coa_file_name","balance_month","firm_id_ref","client_type_id_ref","client_entity_type_id_ref","nzbn","external_info"],"title":"ClientDetail","description":"Full payload for the client detail page header. Fields below are always set\nby `router._detail`, so nullable ones are `T | None` (required + nullable);\n`portal_invited` keeps a default (some call sites omit it)."},"ClientDocumentRow":{"properties":{"document_id":{"type":"string","title":"Document Id"},"name":{"type":"string","title":"Name"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"uploaded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Uploaded At"},"uploaded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded By"},"direction":{"type":"string","title":"Direction"}},"type":"object","required":["document_id","name","size_bytes","uploaded_at","uploaded_by","direction"],"title":"ClientDocumentRow"},"ClientDocumentUploadOut":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["document_id","name"],"title":"ClientDocumentUploadOut","description":"Ack for a client document upload — the new ZBox document id + its name.\n``document_id`` is nullable because it echoes the ZBox result's file_uuid."},"ClientDocumentsResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/ClientDocumentRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"ClientDocumentsResponse"},"ClientGeneralLedgerLiveResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"totals":{"additionalProperties":true,"type":"object","title":"Totals"}},"type":"object","required":["client_uuid","rows","totals"],"title":"ClientGeneralLedgerLiveResponse","description":"Engine-built (stateless) general ledger for a client, plus footer totals."},"ClientGlAccountsResponse":{"properties":{"accounts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Accounts"}},"type":"object","required":["accounts"],"title":"ClientGlAccountsResponse","description":"A client's chart of accounts (code + name) for the GL drill-down picker."},"ClientGlRowsResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"count":{"type":"integer","title":"Count","default":0},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["client_uuid"],"title":"ClientGlRowsResponse","description":"Preview of a client's stored general_ledger rows (GET /clients/{uuid}/gl-rows).\n``rows`` are engine-shaped GL rows with open-ended columns."},"ClientGlSummaryResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"count":{"type":"integer","title":"Count","default":0},"xero_connected":{"type":"boolean","title":"Xero Connected","default":false},"corpus_source":{"type":"string","title":"Corpus Source","default":""}},"type":"object","required":["client_uuid"],"title":"ClientGlSummaryResponse","description":"Corpus availability for the Setup prompt (GET /clients/{uuid}/gl-summary)."},"ClientGlUploadResponse":{"properties":{"file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Uuid"}},"type":"object","required":["file_uuid"],"title":"ClientGlUploadResponse","description":"Reference to the latest manually-uploaded GL file for a client (may be null)."},"ClientHomeResponse":{"properties":{"greeting_name":{"type":"string","title":"Greeting Name"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"pending":{"items":{"$ref":"#/components/schemas/ClientPendingItem"},"type":"array","title":"Pending"}},"type":"object","required":["greeting_name","firm_name","pending"],"title":"ClientHomeResponse"},"ClientInGroup":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"is_primary":{"type":"boolean","title":"Is Primary","default":false}},"type":"object","required":["client_uuid","client_name"],"title":"ClientInGroup"},"ClientInviteResult":{"properties":{"invited_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invited Email"},"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent","default":false},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"},"user_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Uuid"}},"type":"object","title":"ClientInviteResult"},"ClientJobsGridResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientJobsGridRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"ClientJobsGridResponse"},"ClientJobsGridRow":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"balance_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Balance Date"},"is_xero":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Xero"},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"managers":{"items":{"$ref":"#/components/schemas/GridPerson"},"type":"array","title":"Managers"},"accountants":{"items":{"$ref":"#/components/schemas/GridPerson"},"type":"array","title":"Accountants"}},"type":"object","required":["client_uuid","client_name","contact_name","client_email","balance_date","is_xero","branch_uuid","branch_name","job_uuid","job_name","job_code","job_type","financial_year","period","start_date","status"],"title":"ClientJobsGridRow","description":"One flattened client→job row (`GET /clients/jobs-grid`). One row per\nnon-deleted job; a client with no jobs still yields one row with null job\ncolumns. Mirrors `repository.flat_client_job_row`."},"ClientListItem":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"client_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Type"},"mapping":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Mapping"}},"type":"object","required":["client_uuid","client_name"],"title":"ClientListItem","description":"A Zato client with its FYI mapping status (mapping-grid row)."},"ClientMappingRow":{"properties":{"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"},"fyi_entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fyi Entity Name"},"zato_client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Client Uuid"},"zato_client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Client Name"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["fyi_entity_id"],"title":"ClientMappingRow","description":"One FYI entity → Zato client mapping row (list view)."},"ClientOut":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"client_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Code"}},"type":"object","required":["client_uuid","client_name"],"title":"ClientOut"},"ClientParentOut":{"properties":{"name":{"type":"string","title":"Name"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"},"xero_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xero Type"},"is_multiparent":{"type":"boolean","title":"Is Multiparent"},"sibling":{"items":{"type":"string"},"type":"array","title":"Sibling","default":[]},"section":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section"},"is_mapped":{"type":"boolean","title":"Is Mapped","default":false}},"additionalProperties":true,"type":"object","required":["name","is_multiparent"],"title":"ClientParentOut","description":"One entry in the client's effective-parents map (keyed by parent_key)."},"ClientPatchResponse":{"properties":{"client":{"$ref":"#/components/schemas/ClientDetail"},"invite":{"anyOf":[{"$ref":"#/components/schemas/ClientInviteResult"},{"type":"null"}]}},"type":"object","required":["client"],"title":"ClientPatchResponse"},"ClientPendingItem":{"properties":{"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"href":{"type":"string","title":"Href"}},"type":"object","required":["kind","title","href"],"title":"ClientPendingItem"},"ClientQueryListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientQueryOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"ClientQueryListOut"},"ClientQueryOut":{"properties":{"query_uuid":{"type":"string","title":"Query Uuid"},"subject":{"type":"string","title":"Subject"},"description":{"type":"string","title":"Description"},"status":{"type":"string","title":"Status"},"is_resolved":{"type":"boolean","title":"Is Resolved"},"message_count":{"type":"integer","title":"Message Count"},"last_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message"},"last_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last At"},"accountant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountant Name"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["query_uuid","subject","description","status","is_resolved","message_count","created_at","updated_at"],"title":"ClientQueryOut"},"ClientQuestionnaireListItem":{"properties":{"invitation_uuid":{"type":"string","title":"Invitation Uuid"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"client_uuid":{"type":"string","title":"Client Uuid"}},"type":"object","required":["invitation_uuid","status","client_uuid"],"title":"ClientQuestionnaireListItem","description":"One assigned questionnaire in the logged-in client's list. Backed by a\nreal `client_invitations` row (the same the OTP magic-link resolves)."},"ClientQuestionnaireListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/ClientQuestionnaireListItem"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"ClientQuestionnaireListResponse"},"ClientReplyIn":{"properties":{"body":{"type":"string","minLength":1,"title":"Body","description":"The client's reply text posted to the query thread (must be non-empty).","examples":["Yes, that expense was for the new office printer."]}},"type":"object","required":["body"],"title":"ClientReplyIn"},"ClientReportsSummaryResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"documents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Documents"}},"type":"object","required":["client_uuid","documents"],"title":"ClientReportsSummaryResponse","description":"Docs overview for a client — latest version of each financial document."},"ClientSummary":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"client_mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Mobile Number"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"business_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Structure"},"is_xero":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Xero"},"is_farming":{"type":"boolean","title":"Is Farming","default":false},"balance_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Balance Date"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"jobs_count":{"type":"integer","title":"Jobs Count","default":0},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"group_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id Ref"},"can_view":{"type":"boolean","title":"Can View","default":false},"can_edit":{"type":"boolean","title":"Can Edit","default":false}},"type":"object","required":["client_uuid","client_name","contact_name","client_email","client_mobile_number","country_code","business_structure","is_xero","balance_date","created_at","branch_uuid","branch_name","group_id_ref"],"title":"ClientSummary","description":"Row shape for the list grid — keep light.\n\nResponse model — `router._summary` always sets these fields, so always-present\nnullable ones are typed `T | None` (required + nullable), not `T | None = None`.\n`jobs_count` and the bool flags keep a default (the bare summary row omits\n`jobs_count`; the flags carry a sensible default)."},"ClientSwitchRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the authorized client to make the session's active client. Re-validated against the caller's authorized clients (404 if not allowed).","examples":["9f1c2b3a-4d5e-6f70-8a90-bcdef0123456"]}},"type":"object","required":["client_uuid"],"title":"ClientSwitchRequest"},"ClientSwitchResult":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"}},"type":"object","required":["client_uuid","client_name"],"title":"ClientSwitchResult","description":"Payload for POST /clients/switch — the now-active client after the re-mint\n(the access token itself rides in an httpOnly cookie, not the body)."},"ClientThreadListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientThreadMessageOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ClientThreadListOut","description":"The client-visible message thread for one query."},"ClientThreadMessageOut":{"properties":{"response_uuid":{"type":"string","title":"Response Uuid"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"is_own":{"type":"boolean","title":"Is Own"},"body":{"type":"string","title":"Body"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["response_uuid","is_own","body","created_at"],"title":"ClientThreadMessageOut"},"ClientTrialBalanceLiveResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"totals":{"additionalProperties":true,"type":"object","title":"Totals"},"report_date":{"type":"string","title":"Report Date"},"prev_report_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Report Date"}},"type":"object","required":["client_uuid","rows","totals","report_date","prev_report_date"],"title":"ClientTrialBalanceLiveResponse","description":"Live Trial Balance pulled from Xero via the engine (nothing persisted)."},"ClientTrialBalanceResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"totals":{"additionalProperties":true,"type":"object","title":"Totals"}},"type":"object","required":["client_uuid","rows","totals"],"title":"ClientTrialBalanceResponse","description":"Stored trial-balance rows for a client, plus YTD footer totals."},"ClientUpdateMappingOut":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Key"},"updated":{"type":"integer","title":"Updated"},"parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Name"}},"type":"object","required":["account_uuid","updated"],"title":"ClientUpdateMappingOut","description":"`PUT /coa/clients/{uuid}/mappings/{account_uuid}` — the applied override."},"ClientsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","offset","limit"],"title":"ClientsListResponse","description":"Paginated Zato-client page for the mapping grid's infinite scroll."},"CoaAuditSnapshot":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"mappings":{"items":{"$ref":"#/components/schemas/AuditedMapping"},"type":"array","title":"Mappings"}},"type":"object","required":["client_uuid"],"title":"CoaAuditSnapshot"},"CoaBankAccountItem":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"code":{"type":"string","title":"Code","default":""},"name":{"type":"string","title":"Name","default":""}},"type":"object","required":["account_uuid"],"title":"CoaBankAccountItem","description":"A Zato COA bank account (zato account type = 'bank') a connected feed can be linked to."},"CoaBankAccountsResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"provider":{"type":"string","title":"Provider","default":""},"accounts":{"items":{"$ref":"#/components/schemas/CoaBankAccountItem"},"type":"array","title":"Accounts"}},"type":"object","required":["client_uuid"],"title":"CoaBankAccountsResponse"},"CoaBankOption":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"code":{"type":"string","title":"Code","default":""},"name":{"type":"string","title":"Name","default":""}},"type":"object","required":["account_uuid"],"title":"CoaBankOption","description":"A COA bank account (zato 'bank' type) the setup can link a feed to / post an upload into."},"CoaFileOut":{"properties":{"source":{"type":"string","title":"Source"},"source_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source File Id"},"file_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Url"},"file_name":{"type":"string","title":"File Name"},"uploaded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded At"},"csv_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csv Content"}},"type":"object","required":["source","file_name"],"title":"CoaFileOut","description":"`GET /coa/clients/{uuid}/coa-file` — either an uploaded-file download URL or\na synthesised inline CSV (``source`` distinguishes them)."},"CoaIngestOut":{"properties":{"account_count":{"type":"integer","title":"Account Count"},"coa_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa File Name"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"},"automap_deferred":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Automap Deferred"},"needs_type_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Needs Type Count"}},"additionalProperties":true,"type":"object","required":["account_count"],"title":"CoaIngestOut","description":"CoA ingest result (upload / Xero sync). ``summary`` is an engine-owned\nupsert rollup; ``automap_deferred`` marks HITL/frontend-triggered automap."},"CoaLinkResult":{"properties":{"bank_account_uuid":{"type":"string","title":"Bank Account Uuid"},"coa_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Account Uuid"}},"type":"object","required":["bank_account_uuid","coa_account_uuid"],"title":"CoaLinkResult","description":"Ack for a set/clear COA link — echoes the bank account and its (now possibly null) COA link."},"ColOverride":{"properties":{"header_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Name","description":"Custom column header label; null keeps the grid's default header.","examples":["Net Amount"]},"text_align":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Align","description":"Cell text alignment for the column: 'left', 'center', or 'right'.","examples":["right"]},"editable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Editable","description":"Whether cells in this column are user-editable.","examples":[true]},"show_info":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Info","description":"Whether the column's info/tooltip icon is shown.","examples":[true]}},"type":"object","title":"ColOverride","description":"Per-column display overrides set via the Grid Settings drawer.\n\nAll fields optional — send only the attributes the user changed; a null/\nomitted attribute keeps the grid's default for that column."},"ColumnCheckStatus":{"properties":{"status":{"type":"string","title":"Status"},"expected":{"items":{"type":"string"},"type":"array","title":"Expected","default":[]},"required":{"items":{"type":"string"},"type":"array","title":"Required","default":[]},"present":{"items":{"type":"string"},"type":"array","title":"Present","default":[]},"missing_required":{"items":{"type":"string"},"type":"array","title":"Missing Required","default":[]},"unmatched_headers":{"items":{"type":"string"},"type":"array","title":"Unmatched Headers","default":[]},"header_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Header Index"},"header_row":{"items":{"type":"string"},"type":"array","title":"Header Row","default":[]}},"type":"object","required":["status"],"title":"ColumnCheckStatus","description":"Which expected GL columns the uploaded file has, and what's missing."},"ColumnMappingRequest":{"properties":{"mapping":{"additionalProperties":{"type":"string"},"type":"object","title":"Mapping","description":"Required. Header rename map {original_file_header: expected_column} — each key is a header as it appears in the uploaded file, each value is Zato's expected GL column name. Must be non-empty (an empty map is rejected).","examples":[{"Acct":"account_code","Dr":"debit","Txn Date":"transaction_date"}]}},"type":"object","required":["mapping"],"title":"ColumnMappingRequest"},"ColumnMappingResult":{"properties":{"rows_inserted":{"type":"integer","title":"Rows Inserted","default":0},"gl_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Year"},"file_uuid":{"type":"string","title":"File Uuid"}},"type":"object","required":["file_uuid"],"title":"ColumnMappingResult"},"ColumnsApplyRequest":{"properties":{"tracking_columns":{"items":{"$ref":"#/components/schemas/TrackingColumnTag"},"type":"array","title":"Tracking Columns","description":"Upload columns to tag as tracking categories. Optional — an empty list is a no-op; each item requires both header and category_name."}},"type":"object","title":"ColumnsApplyRequest"},"CommentsIn":{"properties":{"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Optional note explaining the reject/revoke; surfaced to the job team by bell + email.","examples":["Please redo the depreciation schedule before re-submitting."]}},"type":"object","title":"CommentsIn"},"CompanyMatch":{"properties":{"nzbn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nzbn"},"entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name"},"entity_type_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type Code"},"entity_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Status"},"registration_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Date"}},"type":"object","title":"CompanyMatch","description":"One row in the search-results picker."},"CompanyOfficeDetailResponse":{"properties":{"nzbn":{"type":"string","title":"Nzbn"},"entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name"},"raw":{"additionalProperties":true,"type":"object","title":"Raw"}},"type":"object","required":["nzbn","raw"],"title":"CompanyOfficeDetailResponse"},"CompanyOfficeSearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"total":{"type":"integer","title":"Total"},"items":{"items":{"$ref":"#/components/schemas/CompanyMatch"},"type":"array","title":"Items"}},"type":"object","required":["query","total","items"],"title":"CompanyOfficeSearchResponse"},"ComparativesStatusResponse":{"properties":{"carried":{"type":"boolean","title":"Carried"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"source_tb_as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Tb As Of"},"stale":{"type":"boolean","title":"Stale"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At"},"discrepancy_count":{"type":"integer","title":"Discrepancy Count"},"prior_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Job Uuid"}},"type":"object","required":["carried","status","source_tb_as_of","stale","last_run_at","discrepancy_count","prior_job_uuid"],"title":"ComparativesStatusResponse","description":"Carry-forward provenance + live staleness for the comparatives banner\n(`carry_forward.status()`)."},"ConditionIdResult":{"properties":{"condition_id":{"type":"integer","title":"Condition Id"}},"type":"object","required":["condition_id"],"title":"ConditionIdResult","description":"Ack carrying the affected rule's id (delete)."},"ConfirmFindingOut":{"properties":{"event_uuid":{"type":"string","title":"Event Uuid"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"},"finding_status":{"type":"string","title":"Finding Status"}},"type":"object","required":["event_uuid","job_uuid_ref","finding_status"],"title":"ConfirmFindingOut","description":"`POST .../findings/{event_uuid}/confirm` — the finding's new status."},"ConfirmedFolderMapping":{"properties":{"kind":{"type":"string","enum":["client_folder","job_folder"],"title":"Kind"},"folder_id":{"type":"string","title":"Folder Id"},"folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Label"},"target_uuid":{"type":"string","title":"Target Uuid"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"type":"string","enum":["manual","auto_exact","auto_fuzzy","auto_ai"],"title":"Origin","default":"manual"},"fiscal_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year"}},"type":"object","required":["kind","folder_id","target_uuid"],"title":"ConfirmedFolderMapping","description":"One confirmed folder tag (used inline for a single folder and in the bulk\nauto-map save)."},"ConnectResponse":{"properties":{"authorize_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorize Url"},"connected":{"type":"boolean","title":"Connected","default":false}},"type":"object","title":"ConnectResponse"},"CopySectionToGroupRequest":{"properties":{"target_group_uuid":{"type":"string","title":"Target Group Uuid","description":"entity_questionnaire_group_uuid of the destination firm template to copy the section (with its questions) into.","examples":["6f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f"]}},"type":"object","required":["target_group_uuid"],"title":"CopySectionToGroupRequest"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name","description":"REQUIRED. Human-readable label for the key, shown in the firm's key list.","examples":["GRA production integration"]},"scopes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Scopes","description":"REQUIRED. At least one API scope to grant. Allowed: clients:read, jobs:read, users:read, files:read, files:write, queries:read, queries:respond.","examples":[["clients:read","jobs:read"]]},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"Optional ISO-8601 expiry timestamp; null/omitted = the key never expires.","examples":["2027-02-27T00:00:00Z"]}},"type":"object","required":["name","scopes"],"title":"CreateApiKeyRequest"},"CreateGroupRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Name for the new blank firm template; the service rejects a blank/whitespace-only name (ValidationFailed).","examples":["FY26 Annual Accounts Checklist"]},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year","description":"Optional financial year to tag the template with.","examples":["2025-2026"]}},"type":"object","required":["name"],"title":"CreateGroupRequest"},"CreateJobIn":{"properties":{"client_uuid":{"type":"string","minLength":1,"title":"Client Uuid","description":"REQUIRED. UUID of an existing client in the caller's firm the COA job is created under.","examples":["3f2b1c9a-7d84-4e2f-9a1b-2c3d4e5f6a7b"]},"job_name":{"type":"string","maxLength":255,"minLength":1,"title":"Job Name","description":"REQUIRED. Human-readable job name.","examples":["FY2025 Annual Accounts"]},"financial_year":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Financial Year","description":"Optional financial-year label.","examples":["2025"]},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start","description":"Optional accounting-period start (ISO 8601 date).","examples":["2024-04-01"]},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End","description":"Optional accounting-period end (ISO 8601 date); defaults to today when omitted for the Xero job-build dispatch.","examples":["2025-03-31"]},"job_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Job Type","description":"Optional job-type slug.","examples":["annual_accounts"]}},"type":"object","required":["client_uuid","job_name"],"title":"CreateJobIn"},"CreateReportIn":{"properties":{"template_key":{"type":"string","title":"Template Key","description":"Report template to assemble, keyed as returned by GET /reporting/templates. Required — the assemble pipeline passes it unconditionally to load_template() and create_report(); there is no default or fallback.","examples":["nz_financial_statements"]}},"type":"object","required":["template_key"],"title":"CreateReportIn"},"CreateRequestPayload":{"properties":{"subject":{"type":"string","title":"Subject","description":"Short title/summary of the support ticket. Required and non-empty (whitespace is trimmed server-side).","examples":["Xero connection keeps dropping"]},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Optional longer description of the issue.","examples":["The Xero integration disconnects every few hours since Monday."]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Optional ticket category — one of \"Technical\", \"Billing\", \"Process\", \"Other\".","examples":["Technical"]},"priority":{"type":"string","title":"Priority","description":"Ticket priority — one of \"low\", \"normal\", \"high\", \"urgent\". Optional; defaults to \"normal\" when omitted.","default":"normal","examples":["normal"]}},"type":"object","required":["subject"],"title":"CreateRequestPayload"},"CreateRequestResponse":{"properties":{"request_uuid":{"type":"string","title":"Request Uuid"},"status":{"type":"string","title":"Status"}},"type":"object","required":["request_uuid","status"],"title":"CreateRequestResponse"},"CreateSupportUserPayload":{"properties":{"email":{"type":"string","title":"Email","description":"Email address of the new support user; the invitation is sent here. Must not already belong to an existing user (else 409 Conflict).","examples":["support.manager@zatohq.com"]},"full_name":{"type":"string","title":"Full Name","description":"Full display name of the new support user.","examples":["Priya Sharma"]},"role_key":{"type":"string","title":"Role Key","description":"Support role to grant — must be \"support_manager\" or \"support_account_owner\" (a Support Admin cannot create another admin).","examples":["support_manager"]}},"type":"object","required":["email","full_name","role_key"],"title":"CreateSupportUserPayload"},"CreateSupportUserResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"role_name":{"type":"string","title":"Role Name"},"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email","role_name","invitation_email_sent"],"title":"CreateSupportUserResponse"},"CreatedApiKey":{"properties":{"key_uuid":{"type":"string","title":"Key Uuid"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"is_revoked":{"type":"boolean","title":"Is Revoked"},"full_key":{"type":"string","title":"Full Key"}},"type":"object","required":["key_uuid","name","key_prefix","scopes","is_revoked","full_key"],"title":"CreatedApiKey"},"CsFirmClientsResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"CsFirmClientsResponse","description":"Paginated clients for a firm (CS lens). Each `items` row is a CS-clients\nprojection (client fields + contact_info + flags), documented loosely as an\nopen object."},"CsFirmJobsResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"CsFirmJobsResponse","description":"Paginated jobs for a firm (CS lens). Each `items` row is a CS-jobs projection\nwith a wide, partly-conditional key set (job fields + client_name + TB/GL presence\n+ XPM external_info), so rows are documented loosely as open objects."},"CsTeamUserRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active","default":true},"auth_type":{"type":"string","title":"Auth Type","default":"manual"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"invitation_email_sent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email"],"title":"CsTeamUserRow"},"CsTeamUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CsTeamUserRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CsTeamUsersResponse"},"CsUserCreateRequest":{"properties":{"category":{"type":"string","enum":["Sales","Support","Domain","Dev","Finance","Management","Admin"],"title":"Category","description":"CS-team category (required). One of Sales/Support/Domain/Dev/Finance/Management/Admin.","examples":["Support"]},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"New CS member's full name (required).","examples":["Sam Support"]},"email":{"type":"string","format":"email","title":"Email","description":"New CS member's email; 409 if a CS user already exists with it (required).","examples":["sam@zatohq.com"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional mobile (E.164); validated server-side.","examples":["+64211234567"]}},"type":"object","required":["category","name","email"],"title":"CsUserCreateRequest","description":"One row of the CS portal \"Add New User\" drawer."},"CsUserUpdateRequest":{"properties":{"category":{"anyOf":[{"type":"string","enum":["Sales","Support","Domain","Dev","Finance","Management","Admin"]},{"type":"null"}],"title":"Category","description":"New CS-team category; omit to leave unchanged.","examples":["Domain"]},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"New full name; omit to leave unchanged.","examples":["Sam Support"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"New mobile (E.164); omit to leave unchanged.","examples":["+64211234567"]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Toggle the directory row active/inactive; omit to leave unchanged."}},"type":"object","title":"CsUserUpdateRequest","description":"Editable fields of a CS-team directory row. PARTIAL UPDATE — every field is\noptional; omit a field to leave it unchanged."},"DashboardAccountRow":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"gl_bal":{"type":"number","title":"Gl Bal","default":0.0}},"type":"object","title":"DashboardAccountRow","description":"An account nested under a workpaper in the By-Workpaper view."},"DecisionItem":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"detail":{"type":"string","title":"Detail"},"badge":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Badge"},"badge_tone":{"type":"string","title":"Badge Tone"},"action_label":{"type":"string","title":"Action Label"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"}},"type":"object","required":["id","kind","title","detail","badge","badge_tone","action_label","route"],"title":"DecisionItem","description":"One ranked, actionable item in the Decision Centre — rule-generated,\nnever LLM-generated (§ narrative is the only LLM-authored field on this page)."},"DefinitionEnvelopeOut":{"properties":{"definition":{"anyOf":[{"$ref":"#/components/schemas/WorkpaperDefinition"},{"type":"null"}]},"summary":{"anyOf":[{"$ref":"#/components/schemas/DefinitionSummary"},{"type":"null"}]}},"type":"object","required":["definition","summary"],"title":"DefinitionEnvelopeOut","description":"One WP's definition + summary; both keys always present, null when not found."},"DefinitionSummary":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"country":{"type":"string","title":"Country","default":"NZ"},"wp_name":{"type":"string","title":"Wp Name","default":""},"source":{"type":"string","enum":["pack","db"],"title":"Source"},"status":{"type":"string","title":"Status","default":"published"},"has_hooks":{"type":"boolean","title":"Has Hooks","default":false},"editable":{"type":"boolean","title":"Editable","default":true},"in_run_set":{"type":"boolean","title":"In Run Set","default":true},"hidden":{"type":"boolean","title":"Hidden","default":false},"config_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config Uuid"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},"type":"object","required":["wp_code","source"],"title":"DefinitionSummary"},"DeleteDocumentResponse":{"properties":{"document_uuid":{"type":"string","title":"Document Uuid"},"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["document_uuid","deleted"],"title":"DeleteDocumentResponse"},"DeleteJobOut":{"properties":{"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"},"is_deleted":{"type":"boolean","title":"Is Deleted"}},"type":"object","required":["job_uuid_ref","is_deleted"],"title":"DeleteJobOut","description":"`DELETE /coa/jobs/{uuid}` — soft-delete ack."},"DeleteResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["manual_journal_uuid"],"title":"DeleteResponse"},"DeleteTbOut":{"properties":{"file_cleared":{"type":"boolean","title":"File Cleared"},"untagged":{"type":"boolean","title":"Untagged"}},"type":"object","required":["file_cleared","untagged"],"title":"DeleteTbOut","description":"`DELETE /coa/jobs/{uuid}/tb` — whether the file ref was cleared / a linked\nTB-slot file untagged."},"DeletedFileListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeletedFileRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"DeletedFileListResponse"},"DeletedFileRow":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"provider":{"type":"string","title":"Provider"},"external_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Folder Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Parent Key"},"category_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Source"},"category_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Sub"},"category_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Category Confidence"},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"processing_state":{"type":"string","title":"Processing State","default":"INGESTED"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"link_count":{"type":"integer","title":"Link Count","default":0},"linked_to_target":{"type":"boolean","title":"Linked To Target","default":false},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"},"jobs":{"items":{"$ref":"#/components/schemas/JobRef"},"type":"array","title":"Jobs","default":[]},"extraction":{"additionalProperties":true,"type":"object","title":"Extraction","default":{}},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"deleted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deleted By"}},"type":"object","required":["file_uuid","file_name","provider"],"title":"DeletedFileRow","description":"A soft-deleted (recycle-bin) file — the base row plus who/when it was binned."},"DeletedResponse":{"properties":{"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["deleted"],"title":"DeletedResponse","description":"Ack for the CS-team-user hard-delete — always `{\"deleted\": true}` on success."},"DelinkResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"job_uuid":{"type":"string","title":"Job Uuid"},"delinked":{"type":"boolean","title":"Delinked"},"links_detached":{"type":"integer","title":"Links Detached"}},"type":"object","required":["file_uuid","job_uuid","delinked","links_detached"],"title":"DelinkResult","description":"`DELETE /zbox/jobs/{job_uuid}/files/{file_uuid}` — job delink ack (the file is\npreserved; only its link(s) to this job detach)."},"DeliveryEventOut":{"properties":{"event_type":{"type":"string","title":"Event Type"},"provider":{"type":"string","title":"Provider"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"}},"type":"object","required":["event_type","provider","occurred_at"],"title":"DeliveryEventOut"},"DemapGlResult":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"wp_code":{"type":"string","title":"Wp Code"},"demapped":{"type":"boolean","title":"Demapped"}},"type":"object","required":["account_uuid","wp_code","demapped"],"title":"DemapGlResult","description":"Ack for REMOVING a GL account's COA mapping (a real ``parent_id`` clear)."},"DetachResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"wp_code":{"type":"string","title":"Wp Code"},"detached":{"type":"boolean","title":"Detached"}},"type":"object","required":["file_uuid","wp_code","detached"],"title":"DetachResult","description":"Ack for detaching a file from a workpaper (idempotent — the file is preserved)."},"DisconnectClientRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"Required. Zato client_uuid whose XPM mapping to clear.","examples":["550e8400-e29b-41d4-a716-446655440000"]}},"type":"object","required":["client_uuid"],"title":"DisconnectClientRequest"},"DisconnectedResponse":{"properties":{"disconnected":{"type":"boolean","title":"Disconnected"}},"type":"object","required":["disconnected"],"title":"DisconnectedResponse","description":"Ack for a disconnect action."},"DispatchAutomapOut":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"}},"type":"object","required":["run_id","status","job_uuid_ref"],"title":"DispatchAutomapOut","description":"`POST /coa/jobs/{uuid}/automap` (202) — the durable dispatch record id;\nthe client watches live progress over the ``run:<run_id>`` WS topic."},"DispatchOut":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"}},"type":"object","required":["run_id","status","job_uuid_ref"],"title":"DispatchOut","description":"Payload of the async-dispatch routes (extract / runs) — the durable run handle."},"DispatchStatusResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["run_id","status"],"title":"DispatchStatusResponse"},"DocumentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"DocumentListResponse"},"DocumentResponse":{"properties":{"document_uuid":{"type":"string","title":"Document Uuid"},"document_type":{"type":"string","title":"Document Type"},"file_name":{"type":"string","title":"File Name"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["document_uuid","document_type","file_name"],"title":"DocumentResponse"},"DocumentView":{"properties":{"document_uuid":{"type":"string","title":"Document Uuid"},"split_file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Split File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"supplier_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier Name"},"page_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Range"}},"type":"object","required":["document_uuid"],"title":"DocumentView","description":"The compact document row returned after an edit / add / resplit."},"DownloadUrl":{"properties":{"url":{"type":"string","title":"Url"},"file_name":{"type":"string","title":"File Name"}},"type":"object","required":["url","file_name"],"title":"DownloadUrl"},"DraftAnswer":{"properties":{"snapshot_question_uuid":{"type":"string","title":"Snapshot Question Uuid","description":"snapshot_question_uuid identifying which snapshot question this answer belongs to; used to locate the row to upsert.","examples":["b1e2f3a4-5c6d-7e8f-9a0b-1c2d3e4f5061"]},"value":{"anyOf":[{},{"type":"null"}],"title":"Value","description":"The answer value; shape depends on question_type (string, number, list, object, …).","examples":["Yes"]},"additional_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Response","description":"Optional free-text elaboration alongside the answer."},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments","description":"Optional recipient comment on this question."}},"type":"object","required":["snapshot_question_uuid"],"title":"DraftAnswer"},"DraftRequest":{"properties":{"answers":{"items":{"$ref":"#/components/schemas/DraftAnswer"},"type":"array","title":"Answers","description":"Answers to upsert; each is matched by snapshot_question_uuid and unknown ones are skipped. An empty list is a no-op save."}},"type":"object","title":"DraftRequest"},"DropboxCredentialsRequest":{"properties":{"DROPBOX_APP_KEY":{"type":"string","maxLength":128,"minLength":1,"title":"Dropbox App Key","description":"Dropbox app key from the Dropbox App Console. Always required.","examples":["8xk9v2m4p6q8r0t"]},"DROPBOX_APP_SECRET":{"type":"string","title":"Dropbox App Secret","description":"Dropbox app secret. Required on first connect; leave blank on reconnect to keep the already-stored secret (the GET never returns it).","default":"","examples":["s3cr3t9v2m4p6q8r0t2u4w6"]},"DROPBOX_REFRESH_TOKEN":{"type":"string","title":"Dropbox Refresh Token","description":"Dropbox OAuth refresh token (from the one-time OAuth in the App Console). Required on first connect; leave blank on reconnect to keep the stored token.","default":"","examples":["sl.B1a2b3c4d5e6f7g8h9i0j"]}},"type":"object","required":["DROPBOX_APP_KEY"],"title":"DropboxCredentialsRequest","description":"Connect payload entered in the ZIP portal.\n\nOn RE-connect the secret / refresh token may be left blank to keep the saved\nones (the GET never returns them, so the form can't echo them back)."},"DropdownResponse":{"properties":{"clients":{"items":{"$ref":"#/components/schemas/app__modules__gl_rule_builder__schemas__ClientOption"},"type":"array","title":"Clients"},"accounts":{"items":{"$ref":"#/components/schemas/app__modules__gl_rule_builder__schemas__AccountOption"},"type":"array","title":"Accounts"}},"type":"object","required":["clients","accounts"],"title":"DropdownResponse"},"DshOut":{"properties":{"workpaper_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Workpaper Balance"},"gl_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gl Balance"},"variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance"},"computed_variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Computed Variance"},"reconciled":{"type":"boolean","title":"Reconciled","default":false},"tolerance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tolerance"}},"type":"object","title":"DshOut"},"DuplicateFile":{"properties":{"file_name":{"type":"string","title":"File Name"},"uploaded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded At"}},"type":"object","required":["file_name"],"title":"DuplicateFile"},"DuplicateGroupRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name for the duplicated template; when omitted the service defaults to \"Copy of <source name>\".","examples":["Copy of FY26 Checklist"]}},"type":"object","title":"DuplicateGroupRequest"},"EditDocumentRequest":{"properties":{"page_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Range","description":"New page range to re-carve THIS document to exactly, e.g. '1-3' or non-contiguous '1-3,5'. Optional — omit for a category/supplier-only edit. At least one of page_range, category, or supplier_name must be sent.","examples":["1-3"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"New category (must be one of GET /categories). Optional in this partial update.","examples":["Invoice"]},"supplier_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier Name","description":"New supplier name. Optional; send an empty string to clear it.","examples":["Acme Ltd"]}},"type":"object","title":"EditDocumentRequest"},"EditLockStatusOut":{"properties":{"locked":{"type":"boolean","title":"Locked"},"locked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locked By"},"locked_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locked Since"}},"type":"object","required":["locked"],"title":"EditLockStatusOut","description":"Payload of ``GET /{job}/{wp}/edit-session/lock-status`` — always unlocked in Z2."},"EditLogsOut":{"properties":{"logs":{"items":{"$ref":"#/components/schemas/WpEditLogEntry"},"type":"array","title":"Logs"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"EditLogsOut","description":"Payload of ``GET /{job}/edit-logs`` — the cell-edit audit log + total."},"EditSessionOut":{"properties":{"session_id":{"type":"string","title":"Session Id"},"version":{"type":"integer","title":"Version"},"locked":{"type":"boolean","title":"Locked"},"status":{"type":"string","title":"Status"}},"type":"object","required":["session_id","version","locked","status"],"title":"EditSessionOut","description":"Payload of ``POST /{job}/{wp}/edit-session/start`` — the synthetic session (Z1 parity)."},"EditSessionStatusOut":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"EditSessionStatusOut","description":"Payload of ``POST /{job}/{wp}/edit-session/discard`` — the placeholder ack."},"EffectiveThresholdsResponse":{"properties":{"threshold_type":{"type":"string","title":"Threshold Type"},"source":{"type":"string","enum":["JOB","CLIENT","JOB_TYPE","CLIENT_TYPE","ORG","MASTER"],"title":"Source"},"source_label":{"type":"string","title":"Source Label"},"thresholds":{"additionalProperties":true,"type":"object","title":"Thresholds"},"inherited_from_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inherited From Id"}},"type":"object","required":["threshold_type","source","source_label","thresholds"],"title":"EffectiveThresholdsResponse"},"EffectiveWpThresholdsResponse":{"properties":{"threshold_type":{"type":"string","title":"Threshold Type"},"source":{"type":"string","enum":["JOB","CLIENT","JOB_TYPE","CLIENT_TYPE","ORG","MASTER"],"title":"Source"},"source_label":{"type":"string","title":"Source Label"},"thresholds":{"additionalProperties":true,"type":"object","title":"Thresholds"},"inherited_from_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inherited From Id"}},"type":"object","required":["threshold_type","source","source_label","thresholds"],"title":"EffectiveWpThresholdsResponse"},"EnrichmentMerchant":{"properties":{"merchant_key":{"type":"string","title":"Merchant Key"},"merchant_raw":{"type":"string","title":"Merchant Raw","default":""},"bs_indices":{"items":{"type":"integer"},"type":"array","title":"Bs Indices"},"candidates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Candidates"},"selected_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Selected Index"},"status":{"type":"string","title":"Status","default":"pending"}},"type":"object","required":["merchant_key"],"title":"EnrichmentMerchant","description":"One unknown merchant awaiting a human pick, with its 4-5 web candidates."},"EnrichmentResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"status":{"type":"string","title":"Status"},"merchants":{"items":{"$ref":"#/components/schemas/EnrichmentMerchant"},"type":"array","title":"Merchants"}},"type":"object","required":["ac_job_uuid","status"],"title":"EnrichmentResponse"},"EnrichmentSelection":{"properties":{"merchant_key":{"type":"string","title":"Merchant Key","description":"Normalised merchant key this pick applies to.","examples":["amazon"]},"selected_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Selected Index","description":"Index of the chosen web candidate; -1 or null skips this merchant.","examples":[0]},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry","description":"Optional industry hint for the merchant.","examples":["Retail"]},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context","description":"Optional free-text context for the merchant."}},"type":"object","required":["merchant_key"],"title":"EnrichmentSelection"},"EnrichmentSubmitRequest":{"properties":{"selections":{"items":{"$ref":"#/components/schemas/EnrichmentSelection"},"type":"array","title":"Selections","description":"Merchant picks to apply; empty ⇒ resume with no changes."}},"type":"object","title":"EnrichmentSubmitRequest","description":"Per-merchant company selections that resume a paused enrichment run."},"EnterOrgResponse":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"landing_route":{"type":"string","title":"Landing Route"}},"type":"object","required":["firm_uuid","firm_name","landing_route"],"title":"EnterOrgResponse"},"EntitiesOnlyResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FYIEntityOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","offset","limit"],"title":"EntitiesOnlyResponse","description":"Paginated FYI entity page for the picker."},"EntityFilterOptionsResponse":{"properties":{"groups":{"items":{"type":"string"},"type":"array","title":"Groups","default":[]},"managers":{"items":{"type":"string"},"type":"array","title":"Managers","default":[]},"partners":{"items":{"type":"string"},"type":"array","title":"Partners","default":[]}},"type":"object","title":"EntityFilterOptionsResponse","description":"Distinct group / manager / partner names for the picker filter dropdowns."},"EntityGroupDetail":{"properties":{"entity_questionnaire_group_uuid":{"type":"string","title":"Entity Questionnaire Group Uuid"},"questionnaire_group_name":{"type":"string","title":"Questionnaire Group Name"},"type":{"type":"string","title":"Type"},"source_name":{"type":"string","title":"Source Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"sections":{"items":{"$ref":"#/components/schemas/EntitySection"},"type":"array","title":"Sections","default":[]}},"type":"object","required":["entity_questionnaire_group_uuid","questionnaire_group_name","type","source_name"],"title":"EntityGroupDetail"},"EntityGroupSummary":{"properties":{"entity_questionnaire_group_uuid":{"type":"string","title":"Entity Questionnaire Group Uuid"},"questionnaire_group_name":{"type":"string","title":"Questionnaire Group Name"},"type":{"type":"string","title":"Type"},"source_name":{"type":"string","title":"Source Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"section_count":{"type":"integer","title":"Section Count","default":0},"question_count":{"type":"integer","title":"Question Count","default":0}},"type":"object","required":["entity_questionnaire_group_uuid","questionnaire_group_name","type","source_name"],"title":"EntityGroupSummary"},"EntityQuestion":{"properties":{"entity_template_uuid":{"type":"string","title":"Entity Template Uuid"},"info":{"additionalProperties":true,"type":"object","title":"Info"}},"type":"object","required":["entity_template_uuid","info"],"title":"EntityQuestion"},"EntitySection":{"properties":{"entity_questionnaire_section_uuid":{"type":"string","title":"Entity Questionnaire Section Uuid"},"section_name":{"type":"string","title":"Section Name"},"display_order":{"type":"integer","title":"Display Order"},"questions":{"items":{"$ref":"#/components/schemas/EntityQuestion"},"type":"array","title":"Questions","default":[]}},"type":"object","required":["entity_questionnaire_section_uuid","section_name","display_order"],"title":"EntitySection"},"EntityTypeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EntityTypeOption"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"EntityTypeListResponse"},"EntityTypeOption":{"properties":{"client_entity_type_id":{"type":"integer","title":"Client Entity Type Id"},"entity_name":{"type":"string","title":"Entity Name"}},"type":"object","required":["client_entity_type_id","entity_name"],"title":"EntityTypeOption","description":"One client entity-type option for the create/edit dropdown\n(`GET /clients/entity-types`)."},"Envelope_AcBulkUpdateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AcBulkUpdateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AcBulkUpdateResponse]"},"Envelope_AcResultsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AcResultsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AcResultsResponse]"},"Envelope_AcRunStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AcRunStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AcRunStatusResponse]"},"Envelope_AcceptInviteResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AcceptInviteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AcceptInviteResponse]"},"Envelope_AccountTransactionsOut_":{"properties":{"data":{"$ref":"#/components/schemas/AccountTransactionsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AccountTransactionsOut]"},"Envelope_AccountTypesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AccountTypesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AccountTypesResponse]"},"Envelope_ActionResult_":{"properties":{"data":{"$ref":"#/components/schemas/ActionResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ActionResult]"},"Envelope_ActiveRunsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ActiveRunsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ActiveRunsResponse]"},"Envelope_ActivityListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ActivityListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ActivityListResponse]"},"Envelope_AddSectionOut_":{"properties":{"data":{"$ref":"#/components/schemas/AddSectionOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AddSectionOut]"},"Envelope_AgentClientDetail_":{"properties":{"data":{"$ref":"#/components/schemas/AgentClientDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentClientDetail]"},"Envelope_AgentClientsList_":{"properties":{"data":{"$ref":"#/components/schemas/AgentClientsList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentClientsList]"},"Envelope_AgentFirmOverview_":{"properties":{"data":{"$ref":"#/components/schemas/AgentFirmOverview"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentFirmOverview]"},"Envelope_AgentJobDetail_":{"properties":{"data":{"$ref":"#/components/schemas/AgentJobDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentJobDetail]"},"Envelope_AgentJobsList_":{"properties":{"data":{"$ref":"#/components/schemas/AgentJobsList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentJobsList]"},"Envelope_AgentManualJournalsList_":{"properties":{"data":{"$ref":"#/components/schemas/AgentManualJournalsList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentManualJournalsList]"},"Envelope_AgentMemoryRecords_":{"properties":{"data":{"$ref":"#/components/schemas/AgentMemoryRecords"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentMemoryRecords]"},"Envelope_AgentPermissionsView_":{"properties":{"data":{"$ref":"#/components/schemas/AgentPermissionsView"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentPermissionsView]"},"Envelope_AgentRecentActivity_":{"properties":{"data":{"$ref":"#/components/schemas/AgentRecentActivity"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentRecentActivity]"},"Envelope_AgentUsersList_":{"properties":{"data":{"$ref":"#/components/schemas/AgentUsersList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AgentUsersList]"},"Envelope_AiTagApplyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AiTagApplyResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AiTagApplyResponse]"},"Envelope_AiTagDispatchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AiTagDispatchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AiTagDispatchResponse]"},"Envelope_AiTagProposalsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AiTagProposalsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AiTagProposalsResponse]"},"Envelope_AnalyzeAnomaliesOut_":{"properties":{"data":{"$ref":"#/components/schemas/AnalyzeAnomaliesOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AnalyzeAnomaliesOut]"},"Envelope_ApproveAccountOut_":{"properties":{"data":{"$ref":"#/components/schemas/ApproveAccountOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ApproveAccountOut]"},"Envelope_ApproveAllOut_":{"properties":{"data":{"$ref":"#/components/schemas/ApproveAllOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ApproveAllOut]"},"Envelope_AskResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AskResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AskResponse]"},"Envelope_AssembleAccepted_":{"properties":{"data":{"$ref":"#/components/schemas/AssembleAccepted"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AssembleAccepted]"},"Envelope_AssigneeListOut_":{"properties":{"data":{"$ref":"#/components/schemas/AssigneeListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AssigneeListOut]"},"Envelope_AttachResult_":{"properties":{"data":{"$ref":"#/components/schemas/AttachResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AttachResult]"},"Envelope_AttachableFilesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AttachableFilesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AttachableFilesResponse]"},"Envelope_AttachmentListOut_":{"properties":{"data":{"$ref":"#/components/schemas/AttachmentListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AttachmentListOut]"},"Envelope_AttachmentUploadOut_":{"properties":{"data":{"$ref":"#/components/schemas/AttachmentUploadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AttachmentUploadOut]"},"Envelope_AttachmentViewUrlOut_":{"properties":{"data":{"$ref":"#/components/schemas/AttachmentViewUrlOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AttachmentViewUrlOut]"},"Envelope_AuditListOut_":{"properties":{"data":{"$ref":"#/components/schemas/AuditListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AuditListOut]"},"Envelope_AuditQueryOut_":{"properties":{"data":{"$ref":"#/components/schemas/AuditQueryOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AuditQueryOut]"},"Envelope_AutoJournalDispatch_":{"properties":{"data":{"$ref":"#/components/schemas/AutoJournalDispatch"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AutoJournalDispatch]"},"Envelope_AutoMapClientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AutoMapClientsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AutoMapClientsResponse]"},"Envelope_AutoMapFuzzyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AutoMapFuzzyResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AutoMapFuzzyResponse]"},"Envelope_AutomapStatusOut_":{"properties":{"data":{"$ref":"#/components/schemas/AutomapStatusOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AutomapStatusOut]"},"Envelope_AvatarRemovedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AvatarRemovedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AvatarRemovedResponse]"},"Envelope_AvatarUrlResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AvatarUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AvatarUrlResponse]"},"Envelope_BankAccountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__BankAccountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BankAccountsResponse]"},"Envelope_BankFeedPreviewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BankFeedPreviewResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BankFeedPreviewResponse]"},"Envelope_BankFeedRunResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BankFeedRunResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BankFeedRunResponse]"},"Envelope_BatchBucketsOut_":{"properties":{"data":{"$ref":"#/components/schemas/BatchBucketsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BatchBucketsOut]"},"Envelope_BatchCreateOut_":{"properties":{"data":{"$ref":"#/components/schemas/BatchCreateOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BatchCreateOut]"},"Envelope_BatchFlaggedOut_":{"properties":{"data":{"$ref":"#/components/schemas/BatchFlaggedOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BatchFlaggedOut]"},"Envelope_BatchMovedOut_":{"properties":{"data":{"$ref":"#/components/schemas/BatchMovedOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BatchMovedOut]"},"Envelope_BatchPushedOut_":{"properties":{"data":{"$ref":"#/components/schemas/BatchPushedOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BatchPushedOut]"},"Envelope_BoardResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BoardResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BoardResponse]"},"Envelope_BootstrapConfig_":{"properties":{"data":{"$ref":"#/components/schemas/BootstrapConfig"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BootstrapConfig]"},"Envelope_BranchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BranchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BranchResponse]"},"Envelope_BranchRow_":{"properties":{"data":{"$ref":"#/components/schemas/BranchRow"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BranchRow]"},"Envelope_BulkDeleteResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkDeleteResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkDeleteResult]"},"Envelope_BulkDelinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkDelinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkDelinkResult]"},"Envelope_BulkLinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkLinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkLinkResult]"},"Envelope_BulkPurgeResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkPurgeResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkPurgeResult]"},"Envelope_BulkRestoreResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkRestoreResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkRestoreResult]"},"Envelope_BulkSetCategoryResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkSetCategoryResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BulkSetCategoryResult]"},"Envelope_CabinetsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CabinetsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CabinetsResponse]"},"Envelope_CarryForwardResult_":{"properties":{"data":{"$ref":"#/components/schemas/CarryForwardResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CarryForwardResult]"},"Envelope_CatalogListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CatalogListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CatalogListResponse]"},"Envelope_CatalogueOut_":{"properties":{"data":{"$ref":"#/components/schemas/CatalogueOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CatalogueOut]"},"Envelope_CategoriesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CategoriesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CategoriesResponse]"},"Envelope_CategorizeAccepted_":{"properties":{"data":{"$ref":"#/components/schemas/CategorizeAccepted"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CategorizeAccepted]"},"Envelope_CheckDuplicateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CheckDuplicateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CheckDuplicateResponse]"},"Envelope_ClientAccountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientAccountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientAccountsResponse]"},"Envelope_ClientApproveAllOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientApproveAllOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientApproveAllOut]"},"Envelope_ClientAttachmentListOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientAttachmentListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientAttachmentListOut]"},"Envelope_ClientAutomapOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientAutomapOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientAutomapOut]"},"Envelope_ClientCopyOptions_":{"properties":{"data":{"$ref":"#/components/schemas/ClientCopyOptions"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientCopyOptions]"},"Envelope_ClientCreateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientCreateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientCreateResponse]"},"Envelope_ClientDelinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/ClientDelinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientDelinkResult]"},"Envelope_ClientDetail_":{"properties":{"data":{"$ref":"#/components/schemas/ClientDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientDetail]"},"Envelope_ClientDocumentUploadOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientDocumentUploadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientDocumentUploadOut]"},"Envelope_ClientDocumentsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientDocumentsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientDocumentsResponse]"},"Envelope_ClientGlRowsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientGlRowsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientGlRowsResponse]"},"Envelope_ClientGlSummaryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientGlSummaryResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientGlSummaryResponse]"},"Envelope_ClientHomeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientHomeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientHomeResponse]"},"Envelope_ClientJobsGridResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientJobsGridResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientJobsGridResponse]"},"Envelope_ClientPatchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientPatchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientPatchResponse]"},"Envelope_ClientQueryListOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientQueryListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientQueryListOut]"},"Envelope_ClientQueryOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientQueryOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientQueryOut]"},"Envelope_ClientQuestionnaireListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientQuestionnaireListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientQuestionnaireListResponse]"},"Envelope_ClientSwitchResult_":{"properties":{"data":{"$ref":"#/components/schemas/ClientSwitchResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientSwitchResult]"},"Envelope_ClientThreadListOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientThreadListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientThreadListOut]"},"Envelope_ClientThreadMessageOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientThreadMessageOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientThreadMessageOut]"},"Envelope_ClientUpdateMappingOut_":{"properties":{"data":{"$ref":"#/components/schemas/ClientUpdateMappingOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientUpdateMappingOut]"},"Envelope_ClientsListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClientsListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientsListResponse]"},"Envelope_CoaAuditSnapshot_":{"properties":{"data":{"$ref":"#/components/schemas/CoaAuditSnapshot"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CoaAuditSnapshot]"},"Envelope_CoaBankAccountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CoaBankAccountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CoaBankAccountsResponse]"},"Envelope_CoaFileOut_":{"properties":{"data":{"$ref":"#/components/schemas/CoaFileOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CoaFileOut]"},"Envelope_CoaIngestOut_":{"properties":{"data":{"$ref":"#/components/schemas/CoaIngestOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CoaIngestOut]"},"Envelope_CoaLinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/CoaLinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CoaLinkResult]"},"Envelope_ColumnCheckStatus_":{"properties":{"data":{"$ref":"#/components/schemas/ColumnCheckStatus"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ColumnCheckStatus]"},"Envelope_ColumnMappingResult_":{"properties":{"data":{"$ref":"#/components/schemas/ColumnMappingResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ColumnMappingResult]"},"Envelope_CompanyOfficeDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CompanyOfficeDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CompanyOfficeDetailResponse]"},"Envelope_CompanyOfficeSearchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CompanyOfficeSearchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CompanyOfficeSearchResponse]"},"Envelope_ComparativesStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ComparativesStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ComparativesStatusResponse]"},"Envelope_ConditionIdResult_":{"properties":{"data":{"$ref":"#/components/schemas/ConditionIdResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ConditionIdResult]"},"Envelope_ConfirmFindingOut_":{"properties":{"data":{"$ref":"#/components/schemas/ConfirmFindingOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ConfirmFindingOut]"},"Envelope_ConnectResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ConnectResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ConnectResponse]"},"Envelope_CreateRequestResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CreateRequestResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CreateRequestResponse]"},"Envelope_CreateSupportUserResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CreateSupportUserResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CreateSupportUserResponse]"},"Envelope_CreatedApiKey_":{"properties":{"data":{"$ref":"#/components/schemas/CreatedApiKey"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CreatedApiKey]"},"Envelope_CsFirmClientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CsFirmClientsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CsFirmClientsResponse]"},"Envelope_CsFirmJobsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CsFirmJobsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CsFirmJobsResponse]"},"Envelope_CsTeamUserRow_":{"properties":{"data":{"$ref":"#/components/schemas/CsTeamUserRow"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CsTeamUserRow]"},"Envelope_CsTeamUsersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CsTeamUsersResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CsTeamUsersResponse]"},"Envelope_DashboardSummary_":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__dashboard__schemas__DashboardSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DashboardSummary]"},"Envelope_DefinitionEnvelopeOut_":{"properties":{"data":{"$ref":"#/components/schemas/DefinitionEnvelopeOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DefinitionEnvelopeOut]"},"Envelope_DeleteDocumentResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DeleteDocumentResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeleteDocumentResponse]"},"Envelope_DeleteJobOut_":{"properties":{"data":{"$ref":"#/components/schemas/DeleteJobOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeleteJobOut]"},"Envelope_DeleteResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DeleteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeleteResponse]"},"Envelope_DeleteTbOut_":{"properties":{"data":{"$ref":"#/components/schemas/DeleteTbOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeleteTbOut]"},"Envelope_DeletedFileListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DeletedFileListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeletedFileListResponse]"},"Envelope_DeletedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DeletedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DeletedResponse]"},"Envelope_DelinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/DelinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DelinkResult]"},"Envelope_DemapGlResult_":{"properties":{"data":{"$ref":"#/components/schemas/DemapGlResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DemapGlResult]"},"Envelope_DetachResult_":{"properties":{"data":{"$ref":"#/components/schemas/DetachResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DetachResult]"},"Envelope_DisconnectedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DisconnectedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DisconnectedResponse]"},"Envelope_DispatchAutomapOut_":{"properties":{"data":{"$ref":"#/components/schemas/DispatchAutomapOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DispatchAutomapOut]"},"Envelope_DispatchOut_":{"properties":{"data":{"$ref":"#/components/schemas/DispatchOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DispatchOut]"},"Envelope_DispatchStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DispatchStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DispatchStatusResponse]"},"Envelope_DocumentListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DocumentListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DocumentListResponse]"},"Envelope_DocumentView_":{"properties":{"data":{"$ref":"#/components/schemas/DocumentView"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DocumentView]"},"Envelope_DownloadUrl_":{"properties":{"data":{"$ref":"#/components/schemas/DownloadUrl"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DownloadUrl]"},"Envelope_DropdownResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DropdownResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[DropdownResponse]"},"Envelope_EditLockStatusOut_":{"properties":{"data":{"$ref":"#/components/schemas/EditLockStatusOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EditLockStatusOut]"},"Envelope_EditLogsOut_":{"properties":{"data":{"$ref":"#/components/schemas/EditLogsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EditLogsOut]"},"Envelope_EditSessionOut_":{"properties":{"data":{"$ref":"#/components/schemas/EditSessionOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EditSessionOut]"},"Envelope_EditSessionStatusOut_":{"properties":{"data":{"$ref":"#/components/schemas/EditSessionStatusOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EditSessionStatusOut]"},"Envelope_EffectiveThresholdsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EffectiveThresholdsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EffectiveThresholdsResponse]"},"Envelope_EffectiveWpThresholdsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EffectiveWpThresholdsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EffectiveWpThresholdsResponse]"},"Envelope_EnrichmentResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EnrichmentResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EnrichmentResponse]"},"Envelope_EnterOrgResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EnterOrgResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EnterOrgResponse]"},"Envelope_EntitiesOnlyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EntitiesOnlyResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EntitiesOnlyResponse]"},"Envelope_EntityFilterOptionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EntityFilterOptionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EntityFilterOptionsResponse]"},"Envelope_EntityGroupDetail_":{"properties":{"data":{"$ref":"#/components/schemas/EntityGroupDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EntityGroupDetail]"},"Envelope_EntityTypeListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EntityTypeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[EntityTypeListResponse]"},"Envelope_ExitOrgResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExitOrgResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ExitOrgResponse]"},"Envelope_ExtractToggleResult_":{"properties":{"data":{"$ref":"#/components/schemas/ExtractToggleResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ExtractToggleResult]"},"Envelope_ExtractedInputExampleOut_":{"properties":{"data":{"$ref":"#/components/schemas/ExtractedInputExampleOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ExtractedInputExampleOut]"},"Envelope_FarmingModuleListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FarmingModuleListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FarmingModuleListResponse]"},"Envelope_FileContentResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileContentResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileContentResponse]"},"Envelope_FileCountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileCountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileCountsResponse]"},"Envelope_FileDeletedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileDeletedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileDeletedResponse]"},"Envelope_FileDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileDetailResponse]"},"Envelope_FileExtractAnswer_":{"properties":{"data":{"$ref":"#/components/schemas/FileExtractAnswer"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileExtractAnswer]"},"Envelope_FileIdsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileIdsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileIdsResponse]"},"Envelope_FileListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileListResponse]"},"Envelope_FilePurgedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FilePurgedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FilePurgedResponse]"},"Envelope_FileRestoredResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileRestoredResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileRestoredResponse]"},"Envelope_FileSummaryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileSummaryResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileSummaryResponse]"},"Envelope_FileUrlResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FileUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileUrlResponse]"},"Envelope_FinalizeResult_":{"properties":{"data":{"$ref":"#/components/schemas/FinalizeResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FinalizeResult]"},"Envelope_FirmCreateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmCreateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmCreateResponse]"},"Envelope_FirmDetailsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmDetailsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmDetailsResponse]"},"Envelope_FirmEmailProfileOut_":{"properties":{"data":{"$ref":"#/components/schemas/FirmEmailProfileOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmEmailProfileOut]"},"Envelope_FirmListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmListResponse]"},"Envelope_FirmLoginStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmLoginStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmLoginStatusResponse]"},"Envelope_FirmResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmResponse]"},"Envelope_FirmUpdateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmUpdateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmUpdateResponse]"},"Envelope_FirmUserPatchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FirmUserPatchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmUserPatchResponse]"},"Envelope_FolderAutoMapClientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderAutoMapClientsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderAutoMapClientsResponse]"},"Envelope_FolderAutoMapJobsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderAutoMapJobsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderAutoMapJobsResponse]"},"Envelope_FolderImportAccepted_":{"properties":{"data":{"$ref":"#/components/schemas/FolderImportAccepted"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderImportAccepted]"},"Envelope_FolderMarkResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderMarkResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderMarkResponse]"},"Envelope_FolderResolveResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderResolveResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderResolveResponse]"},"Envelope_FolderStructureResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderStructureResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderStructureResponse]"},"Envelope_FolderTagsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderTagsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderTagsResponse]"},"Envelope_FolderTagsSaveResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderTagsSaveResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderTagsSaveResponse]"},"Envelope_FolderUntagResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FolderUntagResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FolderUntagResponse]"},"Envelope_FullDocOut_":{"properties":{"data":{"$ref":"#/components/schemas/FullDocOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FullDocOut]"},"Envelope_FyiAiMapDispatchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiAiMapDispatchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiAiMapDispatchResponse]"},"Envelope_FyiAiMapProposalsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiAiMapProposalsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiAiMapProposalsResponse]"},"Envelope_FyiAssistConfirmResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiAssistConfirmResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiAssistConfirmResponse]"},"Envelope_FyiAssistResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiAssistResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiAssistResponse]"},"Envelope_FyiEntitiesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiEntitiesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiEntitiesResponse]"},"Envelope_FyiJobSuggestResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiJobSuggestResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiJobSuggestResponse]"},"Envelope_FyiJobsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FyiJobsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FyiJobsResponse]"},"Envelope_GlAnalysisResult_":{"properties":{"data":{"$ref":"#/components/schemas/GlAnalysisResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlAnalysisResult]"},"Envelope_GlPreviewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GlPreviewResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlPreviewResponse]"},"Envelope_GlProcessResult_":{"properties":{"data":{"$ref":"#/components/schemas/GlProcessResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlProcessResult]"},"Envelope_GlRowsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GlRowsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlRowsResponse]"},"Envelope_GlStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GlStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlStatusResponse]"},"Envelope_GlSupportingData_":{"properties":{"data":{"$ref":"#/components/schemas/GlSupportingData"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlSupportingData]"},"Envelope_GlValueScanResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GlValueScanResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GlValueScanResponse]"},"Envelope_GrantSupportResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GrantSupportResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GrantSupportResponse]"},"Envelope_GroupClientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GroupClientsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GroupClientsResponse]"},"Envelope_GroupClientsUpdatedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GroupClientsUpdatedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GroupClientsUpdatedResponse]"},"Envelope_GroupCreateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GroupCreateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GroupCreateResponse]"},"Envelope_GroupListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GroupListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GroupListResponse]"},"Envelope_GroupRef_":{"properties":{"data":{"$ref":"#/components/schemas/GroupRef"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[GroupRef]"},"Envelope_HiddenCabinetsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/HiddenCabinetsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[HiddenCabinetsResponse]"},"Envelope_HitlAnswerOut_":{"properties":{"data":{"$ref":"#/components/schemas/HitlAnswerOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[HitlAnswerOut]"},"Envelope_HitlListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/HitlListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[HitlListResponse]"},"Envelope_HitlRequestOut_":{"properties":{"data":{"$ref":"#/components/schemas/HitlRequestOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[HitlRequestOut]"},"Envelope_ImportXeroResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ImportXeroResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ImportXeroResponse]"},"Envelope_IntegratedStatusAck_":{"properties":{"data":{"$ref":"#/components/schemas/IntegratedStatusAck"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[IntegratedStatusAck]"},"Envelope_IntegrationFilterCapsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/IntegrationFilterCapsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[IntegrationFilterCapsResponse]"},"Envelope_IntegrationFolderResponse_":{"properties":{"data":{"$ref":"#/components/schemas/IntegrationFolderResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[IntegrationFolderResponse]"},"Envelope_IntegrationTreeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/IntegrationTreeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[IntegrationTreeResponse]"},"Envelope_InvitationDetail_":{"properties":{"data":{"$ref":"#/components/schemas/InvitationDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[InvitationDetail]"},"Envelope_JobConfigAllResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JobConfigAllResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobConfigAllResponse]"},"Envelope_JobDetail_":{"properties":{"data":{"$ref":"#/components/schemas/JobDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobDetail]"},"Envelope_JobDocumentOut_":{"properties":{"data":{"$ref":"#/components/schemas/JobDocumentOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobDocumentOut]"},"Envelope_JobMappingReadinessOut_":{"properties":{"data":{"$ref":"#/components/schemas/JobMappingReadinessOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobMappingReadinessOut]"},"Envelope_JobMappingsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JobMappingsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobMappingsResponse]"},"Envelope_JobMappings_":{"properties":{"data":{"$ref":"#/components/schemas/JobMappings"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobMappings]"},"Envelope_JobOut_":{"properties":{"data":{"$ref":"#/components/schemas/JobOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobOut]"},"Envelope_JobSection_":{"properties":{"data":{"$ref":"#/components/schemas/JobSection"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobSection]"},"Envelope_JobSplitsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JobSplitsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobSplitsResponse]"},"Envelope_JobSummaryMetrics_":{"properties":{"data":{"$ref":"#/components/schemas/JobSummaryMetrics"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobSummaryMetrics]"},"Envelope_JournalCategoryListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JournalCategoryListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JournalCategoryListResponse]"},"Envelope_JournalSourceListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JournalSourceListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JournalSourceListResponse]"},"Envelope_JournalTypeListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/JournalTypeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JournalTypeListResponse]"},"Envelope_KbSeedOut_":{"properties":{"data":{"$ref":"#/components/schemas/KbSeedOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[KbSeedOut]"},"Envelope_KbStatsOut_":{"properties":{"data":{"$ref":"#/components/schemas/KbStatsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[KbStatsOut]"},"Envelope_LedgerChangesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LedgerChangesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LedgerChangesResponse]"},"Envelope_LedgerSlotsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LedgerSlotsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LedgerSlotsResponse]"},"Envelope_LineDTO_":{"properties":{"data":{"$ref":"#/components/schemas/LineDTO"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LineDTO]"},"Envelope_LineSplitCountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LineSplitCountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LineSplitCountsResponse]"},"Envelope_LineSplitsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LineSplitsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LineSplitsResponse]"},"Envelope_LineageDetailOut_":{"properties":{"data":{"$ref":"#/components/schemas/LineageDetailOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LineageDetailOut]"},"Envelope_LinesReorderResult_":{"properties":{"data":{"$ref":"#/components/schemas/LinesReorderResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LinesReorderResult]"},"Envelope_LinkClientResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LinkClientResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LinkClientResponse]"},"Envelope_LinkLiveAccepted_":{"properties":{"data":{"$ref":"#/components/schemas/LinkLiveAccepted"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LinkLiveAccepted]"},"Envelope_LinkNodeResult_":{"properties":{"data":{"$ref":"#/components/schemas/LinkNodeResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LinkNodeResult]"},"Envelope_LoginBeginResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LoginBeginResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LoginBeginResponse]"},"Envelope_LoginOtpStagedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LoginOtpStagedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LoginOtpStagedResponse]"},"Envelope_LoginReminderResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LoginReminderResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[LoginReminderResponse]"},"Envelope_ManualGlUploadResult_":{"properties":{"data":{"$ref":"#/components/schemas/ManualGlUploadResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualGlUploadResult]"},"Envelope_ManualJournalCreateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ManualJournalCreateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualJournalCreateResponse]"},"Envelope_ManualJournalDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ManualJournalDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualJournalDetailResponse]"},"Envelope_ManualJournalListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ManualJournalListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualJournalListResponse]"},"Envelope_ManualJournalUpdateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ManualJournalUpdateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualJournalUpdateResponse]"},"Envelope_ManualRevisionStatus_":{"properties":{"data":{"$ref":"#/components/schemas/ManualRevisionStatus"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ManualRevisionStatus]"},"Envelope_MapJobsResult_":{"properties":{"data":{"$ref":"#/components/schemas/MapJobsResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MapJobsResult]"},"Envelope_MappedFoldersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MappedFoldersResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MappedFoldersResponse]"},"Envelope_MappingReadinessOut_":{"properties":{"data":{"$ref":"#/components/schemas/MappingReadinessOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MappingReadinessOut]"},"Envelope_MarkLineQueryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MarkLineQueryResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MarkLineQueryResponse]"},"Envelope_MarkReadOut_":{"properties":{"data":{"$ref":"#/components/schemas/MarkReadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MarkReadOut]"},"Envelope_MarkReadResult_":{"properties":{"data":{"$ref":"#/components/schemas/MarkReadResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MarkReadResult]"},"Envelope_MasterConfigOut_":{"properties":{"data":{"$ref":"#/components/schemas/MasterConfigOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MasterConfigOut]"},"Envelope_MeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MeResponse]"},"Envelope_MessageDetailOut_":{"properties":{"data":{"$ref":"#/components/schemas/MessageDetailOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MessageDetailOut]"},"Envelope_MessageListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MessageListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MessageListResponse]"},"Envelope_MyOrgListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MyOrgListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[MyOrgListResponse]"},"Envelope_NoteDeleteResult_":{"properties":{"data":{"$ref":"#/components/schemas/NoteDeleteResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[NoteDeleteResult]"},"Envelope_NoteOut_":{"properties":{"data":{"$ref":"#/components/schemas/NoteOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[NoteOut]"},"Envelope_NotesListOut_":{"properties":{"data":{"$ref":"#/components/schemas/NotesListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[NotesListOut]"},"Envelope_NotificationListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/NotificationListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[NotificationListResponse]"},"Envelope_OkResponse_":{"properties":{"data":{"$ref":"#/components/schemas/OkResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[OkResponse]"},"Envelope_OpeningBalanceResolution_":{"properties":{"data":{"$ref":"#/components/schemas/OpeningBalanceResolution"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[OpeningBalanceResolution]"},"Envelope_OpeningBalanceStatus_":{"properties":{"data":{"$ref":"#/components/schemas/OpeningBalanceStatus"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[OpeningBalanceStatus]"},"Envelope_OrgSupportDetail_":{"properties":{"data":{"$ref":"#/components/schemas/OrgSupportDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[OrgSupportDetail]"},"Envelope_OrganisationsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/OrganisationsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[OrganisationsResponse]"},"Envelope_PartnerAddResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerAddResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerAddResponse]"},"Envelope_PartnerBatchStatus_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerBatchStatus"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerBatchStatus]"},"Envelope_PartnerClientList_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerClientList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerClientList]"},"Envelope_PartnerClientOut_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerClientOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerClientOut]"},"Envelope_PartnerClientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerClientsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerClientsResponse]"},"Envelope_PartnerJobList_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerJobList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerJobList]"},"Envelope_PartnerJobOut_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerJobOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerJobOut]"},"Envelope_PartnerJobsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerJobsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerJobsResponse]"},"Envelope_PartnerQueryDetail_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerQueryDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerQueryDetail]"},"Envelope_PartnerQueryList_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerQueryList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerQueryList]"},"Envelope_PartnerQueryResponseOut_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerQueryResponseOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerQueryResponseOut]"},"Envelope_PartnerUserList_":{"properties":{"data":{"$ref":"#/components/schemas/PartnerUserList"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PartnerUserList]"},"Envelope_PendingChangesOut_":{"properties":{"data":{"$ref":"#/components/schemas/PendingChangesOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PendingChangesOut]"},"Envelope_PendingColumnsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PendingColumnsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PendingColumnsResponse]"},"Envelope_PendingMappingsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PendingMappingsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PendingMappingsResponse]"},"Envelope_PermissionsReferenceResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PermissionsReferenceResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PermissionsReferenceResponse]"},"Envelope_PersonaMeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PersonaMeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PersonaMeResponse]"},"Envelope_PostToXeroResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PostToXeroResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PostToXeroResponse]"},"Envelope_PpmGlAssistOut_":{"properties":{"data":{"$ref":"#/components/schemas/PpmGlAssistOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PpmGlAssistOut]"},"Envelope_PreviewOut_":{"properties":{"data":{"$ref":"#/components/schemas/PreviewOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PreviewOut]"},"Envelope_PriorDocOut_":{"properties":{"data":{"$ref":"#/components/schemas/PriorDocOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PriorDocOut]"},"Envelope_PriorSuggestionResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PriorSuggestionResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PriorSuggestionResponse]"},"Envelope_PriorYearSettingsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PriorYearSettingsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[PriorYearSettingsResponse]"},"Envelope_QueryListOut_":{"properties":{"data":{"$ref":"#/components/schemas/QueryListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[QueryListOut]"},"Envelope_QueryOut_":{"properties":{"data":{"$ref":"#/components/schemas/QueryOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[QueryOut]"},"Envelope_QueryTemplatesInfo_":{"properties":{"data":{"$ref":"#/components/schemas/QueryTemplatesInfo"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[QueryTemplatesInfo]"},"Envelope_QuestionnaireFileUploadOut_":{"properties":{"data":{"$ref":"#/components/schemas/QuestionnaireFileUploadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[QuestionnaireFileUploadOut]"},"Envelope_RecallResult_":{"properties":{"data":{"$ref":"#/components/schemas/RecallResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecallResult]"},"Envelope_RecentErrorsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecentErrorsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecentErrorsResponse]"},"Envelope_RecipientFormResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecipientFormResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecipientFormResponse]"},"Envelope_RecipientUploadResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecipientUploadResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecipientUploadResponse]"},"Envelope_RecodeBulkResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecodeBulkResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodeBulkResponse]"},"Envelope_RecodeHistoryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecodeHistoryResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodeHistoryResponse]"},"Envelope_RecodeLineResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecodeLineResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodeLineResponse]"},"Envelope_RecodeResultResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecodeResultResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodeResultResponse]"},"Envelope_RecodingFilterOptions_":{"properties":{"data":{"$ref":"#/components/schemas/RecodingFilterOptions"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodingFilterOptions]"},"Envelope_RecodingTransactionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecodingTransactionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RecodingTransactionsResponse]"},"Envelope_ReferenceResult_":{"properties":{"data":{"$ref":"#/components/schemas/ReferenceResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ReferenceResult]"},"Envelope_RefreshApplyResult_":{"properties":{"data":{"$ref":"#/components/schemas/RefreshApplyResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RefreshApplyResult]"},"Envelope_RefreshDiff_":{"properties":{"data":{"$ref":"#/components/schemas/RefreshDiff"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RefreshDiff]"},"Envelope_RefreshSessionResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RefreshSessionResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RefreshSessionResponse]"},"Envelope_RefreshedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RefreshedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RefreshedResponse]"},"Envelope_RegenerateTokenOut_":{"properties":{"data":{"$ref":"#/components/schemas/RegenerateTokenOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RegenerateTokenOut]"},"Envelope_ReloadOut_":{"properties":{"data":{"$ref":"#/components/schemas/ReloadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ReloadOut]"},"Envelope_RemapGlResult_":{"properties":{"data":{"$ref":"#/components/schemas/RemapGlResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RemapGlResult]"},"Envelope_RemoveSectionOut_":{"properties":{"data":{"$ref":"#/components/schemas/RemoveSectionOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RemoveSectionOut]"},"Envelope_RemovedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RemovedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RemovedResponse]"},"Envelope_ReportData_":{"properties":{"data":{"$ref":"#/components/schemas/ReportData"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ReportData]"},"Envelope_ReportListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ReportListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ReportListResponse]"},"Envelope_ReportSummary_":{"properties":{"data":{"$ref":"#/components/schemas/ReportSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ReportSummary]"},"Envelope_RequestOtpResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RequestOtpResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RequestOtpResponse]"},"Envelope_ResetClientMappingsOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResetClientMappingsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResetClientMappingsOut]"},"Envelope_ResetCoaFileOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResetCoaFileOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResetCoaFileOut]"},"Envelope_ResetJobOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResetJobOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResetJobOut]"},"Envelope_ResetPasswordResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ResetPasswordResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResetPasswordResponse]"},"Envelope_ResetTbOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResetTbOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResetTbOut]"},"Envelope_ResolveAccountTypeOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResolveAccountTypeOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResolveAccountTypeOut]"},"Envelope_ResponseListOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResponseListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResponseListOut]"},"Envelope_ResponseOut_":{"properties":{"data":{"$ref":"#/components/schemas/ResponseOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResponseOut]"},"Envelope_RestoreResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RestoreResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RestoreResponse]"},"Envelope_ResyncResult_":{"properties":{"data":{"$ref":"#/components/schemas/ResyncResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResyncResult]"},"Envelope_RevokedApiKeyAck_":{"properties":{"data":{"$ref":"#/components/schemas/RevokedApiKeyAck"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RevokedApiKeyAck]"},"Envelope_RuleEditShape_":{"properties":{"data":{"$ref":"#/components/schemas/RuleEditShape"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RuleEditShape]"},"Envelope_RunOut_":{"properties":{"data":{"$ref":"#/components/schemas/RunOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[RunOut]"},"Envelope_Run_":{"properties":{"data":{"$ref":"#/components/schemas/Run"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[Run]"},"Envelope_SaveClientMappingsResult_":{"properties":{"data":{"$ref":"#/components/schemas/SaveClientMappingsResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveClientMappingsResult]"},"Envelope_SaveDefinitionOut_":{"properties":{"data":{"$ref":"#/components/schemas/SaveDefinitionOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveDefinitionOut]"},"Envelope_SavedCountResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SavedCountResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SavedCountResponse]"},"Envelope_ScaffoldOut_":{"properties":{"data":{"$ref":"#/components/schemas/ScaffoldOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ScaffoldOut]"},"Envelope_ScanListOut_":{"properties":{"data":{"$ref":"#/components/schemas/ScanListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ScanListOut]"},"Envelope_ScanStartOut_":{"properties":{"data":{"$ref":"#/components/schemas/ScanStartOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ScanStartOut]"},"Envelope_SectionPatchResult_":{"properties":{"data":{"$ref":"#/components/schemas/SectionPatchResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SectionPatchResult]"},"Envelope_SectionRef_":{"properties":{"data":{"$ref":"#/components/schemas/SectionRef"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SectionRef]"},"Envelope_SesEventAck_":{"properties":{"data":{"$ref":"#/components/schemas/SesEventAck"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SesEventAck]"},"Envelope_SessionHistory_":{"properties":{"data":{"$ref":"#/components/schemas/SessionHistory"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SessionHistory]"},"Envelope_SessionResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SessionResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SessionResponse]"},"Envelope_SetFavouriteOut_":{"properties":{"data":{"$ref":"#/components/schemas/SetFavouriteOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SetFavouriteOut]"},"Envelope_SetGroupOut_":{"properties":{"data":{"$ref":"#/components/schemas/SetGroupOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SetGroupOut]"},"Envelope_SetHiddenOut_":{"properties":{"data":{"$ref":"#/components/schemas/SetHiddenOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SetHiddenOut]"},"Envelope_SetStatusAck_":{"properties":{"data":{"$ref":"#/components/schemas/SetStatusAck"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SetStatusAck]"},"Envelope_SignoffIssuesSnapshot_":{"properties":{"data":{"$ref":"#/components/schemas/SignoffIssuesSnapshot"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SignoffIssuesSnapshot]"},"Envelope_SignoffReadinessSnapshot_":{"properties":{"data":{"$ref":"#/components/schemas/SignoffReadinessSnapshot"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SignoffReadinessSnapshot]"},"Envelope_SignoffReadiness_":{"properties":{"data":{"$ref":"#/components/schemas/SignoffReadiness"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SignoffReadiness]"},"Envelope_SourceListOut_":{"properties":{"data":{"$ref":"#/components/schemas/SourceListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SourceListOut]"},"Envelope_SourcesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SourcesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SourcesResponse]"},"Envelope_SplitStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SplitStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SplitStatusResponse]"},"Envelope_StartResponse_":{"properties":{"data":{"$ref":"#/components/schemas/StartResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[StartResponse]"},"Envelope_SubContextOptionsOut_":{"properties":{"data":{"$ref":"#/components/schemas/SubContextOptionsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SubContextOptionsOut]"},"Envelope_SupportRequestDetail_":{"properties":{"data":{"$ref":"#/components/schemas/SupportRequestDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SupportRequestDetail]"},"Envelope_SupportRequestListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SupportRequestListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SupportRequestListResponse]"},"Envelope_SupportUserListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SupportUserListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SupportUserListResponse]"},"Envelope_SupportingDocSectionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SupportingDocSectionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SupportingDocSectionsResponse]"},"Envelope_SupportingDocsInfo_":{"properties":{"data":{"$ref":"#/components/schemas/SupportingDocsInfo"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SupportingDocsInfo]"},"Envelope_SuppressResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SuppressResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SuppressResponse]"},"Envelope_SuppressionListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SuppressionListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SuppressionListResponse]"},"Envelope_SwitchPersonaResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SwitchPersonaResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SwitchPersonaResponse]"},"Envelope_SyncCabinetsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SyncCabinetsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncCabinetsResponse]"},"Envelope_SyncFromXeroResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SyncFromXeroResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncFromXeroResponse]"},"Envelope_SyncLocalResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SyncLocalResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncLocalResponse]"},"Envelope_SyncResult_":{"properties":{"data":{"$ref":"#/components/schemas/SyncResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncResult]"},"Envelope_SyncStartedResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SyncStartedResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncStartedResponse]"},"Envelope_SyncStatusOut_":{"properties":{"data":{"$ref":"#/components/schemas/SyncStatusOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncStatusOut]"},"Envelope_SyncToXeroResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SyncToXeroResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SyncToXeroResponse]"},"Envelope_TaxRateListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TaxRateListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TaxRateListResponse]"},"Envelope_TaxRatesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TaxRatesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TaxRatesResponse]"},"Envelope_TbBalancesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TbBalancesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TbBalancesResponse]"},"Envelope_TbListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TbListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TbListResponse]"},"Envelope_TbPreviewOut_":{"properties":{"data":{"$ref":"#/components/schemas/TbPreviewOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TbPreviewOut]"},"Envelope_TbPromoteOut_":{"properties":{"data":{"$ref":"#/components/schemas/TbPromoteOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TbPromoteOut]"},"Envelope_TbUploadOut_":{"properties":{"data":{"$ref":"#/components/schemas/TbUploadOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TbUploadOut]"},"Envelope_TeammateInviteResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TeammateInviteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TeammateInviteResponse]"},"Envelope_TemplateListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TemplateListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TemplateListResponse]"},"Envelope_TemplateRef_":{"properties":{"data":{"$ref":"#/components/schemas/TemplateRef"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TemplateRef]"},"Envelope_ToggleResult_":{"properties":{"data":{"$ref":"#/components/schemas/ToggleResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ToggleResult]"},"Envelope_TraceDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TraceDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TraceDetailResponse]"},"Envelope_TraceListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TraceListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TraceListResponse]"},"Envelope_TrackingCategoriesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TrackingCategoriesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TrackingCategoriesResponse]"},"Envelope_TrackingCategoryListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TrackingCategoryListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TrackingCategoryListResponse]"},"Envelope_TrackingColumnsApplyResult_":{"properties":{"data":{"$ref":"#/components/schemas/TrackingColumnsApplyResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TrackingColumnsApplyResult]"},"Envelope_TrackingColumnsPending_":{"properties":{"data":{"$ref":"#/components/schemas/TrackingColumnsPending"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TrackingColumnsPending]"},"Envelope_TrackingSchemaResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TrackingSchemaResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TrackingSchemaResponse]"},"Envelope_TransactionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TransactionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TransactionsResponse]"},"Envelope_TreeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TreeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[TreeResponse]"},"Envelope_Union_MemoryActivityEvent__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/MemoryActivityEvent"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[Union[MemoryActivityEvent, NoneType]]"},"Envelope_Union_MemoryClientDetail__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/MemoryClientDetail"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[Union[MemoryClientDetail, NoneType]]"},"Envelope_Union_MemoryJobDetail__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/MemoryJobDetail"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[Union[MemoryJobDetail, NoneType]]"},"Envelope_UnreadCountOut_":{"properties":{"data":{"$ref":"#/components/schemas/UnreadCountOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UnreadCountOut]"},"Envelope_UpdateMappingOut_":{"properties":{"data":{"$ref":"#/components/schemas/UpdateMappingOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UpdateMappingOut]"},"Envelope_UploadResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UploadResponse]"},"Envelope_UploadUrlsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadUrlsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UploadUrlsResponse]"},"Envelope_UploadedFileResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadedFileResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UploadedFileResponse]"},"Envelope_UsersDropdownOut_":{"properties":{"data":{"$ref":"#/components/schemas/UsersDropdownOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[UsersDropdownOut]"},"Envelope_ValidationResult_":{"properties":{"data":{"$ref":"#/components/schemas/ValidationResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ValidationResult]"},"Envelope_VerifyDnsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/VerifyDnsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[VerifyDnsResponse]"},"Envelope_VersionsOut_":{"properties":{"data":{"$ref":"#/components/schemas/VersionsOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[VersionsOut]"},"Envelope_ViewUrlOut_":{"properties":{"data":{"$ref":"#/components/schemas/ViewUrlOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ViewUrlOut]"},"Envelope_ViewUrlResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ViewUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ViewUrlResponse]"},"Envelope_VisibilityItem_":{"properties":{"data":{"$ref":"#/components/schemas/VisibilityItem"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[VisibilityItem]"},"Envelope_VisibilityListOut_":{"properties":{"data":{"$ref":"#/components/schemas/VisibilityListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[VisibilityListOut]"},"Envelope_VoidResponse_":{"properties":{"data":{"$ref":"#/components/schemas/VoidResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[VoidResponse]"},"Envelope_WatchSnapshot_":{"properties":{"data":{"$ref":"#/components/schemas/WatchSnapshot"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WatchSnapshot]"},"Envelope_WorkpaperDashboardOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperDashboardOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperDashboardOut]"},"Envelope_WorkpaperExportOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperExportOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperExportOut]"},"Envelope_WorkpaperFieldValuesOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperFieldValuesOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperFieldValuesOut]"},"Envelope_WorkpaperListOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperListOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperListOut]"},"Envelope_WorkpaperRunResultOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperRunResultOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperRunResultOut]"},"Envelope_WorkpaperSectionOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperSectionOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperSectionOut]"},"Envelope_WorkpaperViewOut_":{"properties":{"data":{"$ref":"#/components/schemas/WorkpaperViewOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkpaperViewOut]"},"Envelope_WorkspaceSearchResponse_":{"properties":{"data":{"$ref":"#/components/schemas/WorkspaceSearchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WorkspaceSearchResponse]"},"Envelope_WpCandidateOut_":{"properties":{"data":{"$ref":"#/components/schemas/WpCandidateOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WpCandidateOut]"},"Envelope_WpCandidatesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/WpCandidatesResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WpCandidatesResponse]"},"Envelope_WpConfigWorkpaper_":{"properties":{"data":{"$ref":"#/components/schemas/WpConfigWorkpaper"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WpConfigWorkpaper]"},"Envelope_WriteResult_":{"properties":{"data":{"$ref":"#/components/schemas/WriteResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WriteResult]"},"Envelope_XeroAdoptTenantResult_":{"properties":{"data":{"$ref":"#/components/schemas/XeroAdoptTenantResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XeroAdoptTenantResult]"},"Envelope_XeroAdoptTenantsResult_":{"properties":{"data":{"$ref":"#/components/schemas/XeroAdoptTenantsResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XeroAdoptTenantsResult]"},"Envelope_XeroBankAccountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XeroBankAccountsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XeroBankAccountsResponse]"},"Envelope_XeroSyncPreviewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XeroSyncPreviewResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XeroSyncPreviewResponse]"},"Envelope_XeroSyncResultResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XeroSyncResultResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XeroSyncResultResponse]"},"Envelope_XpmAuthResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XpmAuthResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XpmAuthResponse]"},"Envelope_XpmAuthStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XpmAuthStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XpmAuthStatusResponse]"},"Envelope_XpmSyncResult_":{"properties":{"data":{"$ref":"#/components/schemas/XpmSyncResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XpmSyncResult]"},"Envelope_XpmTenantsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/XpmTenantsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[XpmTenantsResponse]"},"Envelope_ZatoJobsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ZatoJobsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ZatoJobsResponse]"},"Envelope_dict_":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[dict]"},"Envelope_dict_str__ClientParentOut__":{"properties":{"data":{"additionalProperties":{"$ref":"#/components/schemas/ClientParentOut"},"type":"object","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[dict[str, ClientParentOut]]"},"Envelope_list_AcJobListItem__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AcJobListItem"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[AcJobListItem]]"},"Envelope_list_ApiKeyOut__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiKeyOut"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[ApiKeyOut]]"},"Envelope_list_DocumentView__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DocumentView"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[DocumentView]]"},"Envelope_list_EntityGroupSummary__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EntityGroupSummary"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[EntityGroupSummary]]"},"Envelope_list_InvitationSummary__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InvitationSummary"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[InvitationSummary]]"},"Envelope_list_ManualHit__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ManualHit"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[ManualHit]]"},"Envelope_list_MasterGroup__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MasterGroup"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[MasterGroup]]"},"Envelope_list_MemoryActivityEvent__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MemoryActivityEvent"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[MemoryActivityEvent]]"},"Envelope_list_RecallLogEntry__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RecallLogEntry"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[RecallLogEntry]]"},"Envelope_list_RuleListItem__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RuleListItem"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[RuleListItem]]"},"Envelope_list_SessionSummary__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SessionSummary"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[SessionSummary]]"},"Envelope_list_SplitDocument__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SplitDocument"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[SplitDocument]]"},"Envelope_list_str__":{"properties":{"data":{"items":{"type":"string"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[list[str]]"},"ErrorEnvelope":{"properties":{"data":{"type":"null","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors"}},"type":"object","required":["errors"],"title":"ErrorEnvelope","description":"The failure envelope: `data` is null and `errors` is non-empty. Used as the\ndocumented model for 401/403/422 responses (see `app.api.error_responses`)."},"ErrorItem":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"detail":{"anyOf":[{},{"type":"null"}],"title":"Detail"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"severity":{"type":"string","title":"Severity","default":"error"}},"type":"object","required":["code","message"],"title":"ErrorItem","description":"One normalized error. `field` ties it to a form input; `severity`\ndistinguishes hard errors from warnings (see `app.core.responses`)."},"ExitOrgResponse":{"properties":{"landing_route":{"type":"string","title":"Landing Route"}},"type":"object","required":["landing_route"],"title":"ExitOrgResponse"},"ExtractRequest":{"properties":{"file_uuid":{"type":"string","minLength":1,"title":"File Uuid","description":"UUID of the categorized job file to extract from (required — the run has no input without it).","examples":["9f1c2e34-5b6a-4d7e-8f90-1a2b3c4d5e6f"]}},"type":"object","required":["file_uuid"],"title":"ExtractRequest","description":"Body for POST /workpapers/{job_uuid}/extract/{wp_code}."},"ExtractToggleRequest":{"properties":{"is_extract":{"type":"boolean","title":"Is Extract","description":"New state of the file's inert per-WP extract flag (true = marked for extraction). Required — it is the whole toggle command. Persisted, but INERT: does NOT run automation.","examples":[true]}},"type":"object","required":["is_extract"],"title":"ExtractToggleRequest","description":"Set a file's inert per-WP extract flag (single-field toggle command)."},"ExtractToggleResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"wp_code":{"type":"string","title":"Wp Code"},"is_extract":{"type":"boolean","title":"Is Extract"}},"type":"object","required":["file_uuid","wp_code","is_extract"],"title":"ExtractToggleResult","description":"Ack for toggling a file's inert extract flag (``set_extract``)."},"ExtractedInputExampleOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"takes_extracted_input":{"type":"boolean","title":"Takes Extracted Input"},"input_doc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Doc"},"example":{"additionalProperties":true,"type":"object","title":"Example"}},"type":"object","required":["wp_code","takes_extracted_input"],"title":"ExtractedInputExampleOut","description":"Payload of ``GET /{job}/{wp}/extracted/example`` — a WP's expected input shape."},"FYICredentialsRequest":{"properties":{"FYI_REGION":{"type":"string","maxLength":64,"minLength":1,"title":"Fyi Region","description":"FYI API region slug; builds the region-scoped base URL https://api-{region}.fyi.app. Required.","examples":["ap-southeast-2"]},"FYI_ACCESS_ID":{"type":"string","minLength":1,"title":"Fyi Access Id","description":"FYI API access/key id issued to the firm's FYI application. Required.","examples":["fyi-access-id-abc123"]},"FYI_ACCESS_SECRET":{"type":"string","title":"Fyi Access Secret","description":"FYI API secret key. Required on the FIRST connect; leave blank on re-connect to keep the already-stored secret.","default":"","examples":["s3cr3t-fyi-access-key"]}},"type":"object","required":["FYI_REGION","FYI_ACCESS_ID"],"title":"FYICredentialsRequest","description":"Connect payload. Field names mirror the 1.0 contract + the drawer form.\n\nOn RE-connect the secret may be left blank to keep the saved one (the GET\nnever returns the plaintext secret, so the form can't echo it back)."},"FYIEntityOut":{"properties":{"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"manager_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Name"},"partner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Name"},"mapping":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Mapping"}},"type":"object","required":["fyi_entity_id"],"title":"FYIEntityOut"},"FYIJobOut":{"properties":{"fyi_job_id":{"type":"string","title":"Fyi Job Id"},"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"status_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Id"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"manager_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Name"},"partner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Name"},"mapping":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Mapping"}},"type":"object","required":["fyi_job_id","fyi_entity_id"],"title":"FYIJobOut"},"FarmingModuleListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FarmingModuleOption"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FarmingModuleListResponse"},"FarmingModuleOption":{"properties":{"farming_sub_category_id":{"type":"integer","title":"Farming Sub Category Id"},"farming_sub_category_uuid":{"type":"string","title":"Farming Sub Category Uuid"},"farming_sub_category":{"type":"string","title":"Farming Sub Category"}},"type":"object","required":["farming_sub_category_id","farming_sub_category_uuid","farming_sub_category"],"title":"FarmingModuleOption","description":"One active farming sub-category (`GET /jobs/farming-modules`)."},"FileContentResponse":{"properties":{"file_name":{"type":"string","title":"File Name"},"content":{"type":"string","title":"Content"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["file_name","content","truncated"],"title":"FileContentResponse","description":"One document's normalised markdown content (``extract.content_of_file``).\n``truncated`` flags that ``content`` was clipped to the prompt-safe cap."},"FileCountsResponse":{"properties":{"all":{"type":"integer","title":"All"},"uncategorised":{"type":"integer","title":"Uncategorised"},"low_confidence":{"type":"integer","title":"Low Confidence"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["all","uncategorised","low_confidence","failed"],"title":"FileCountsResponse","description":"`GET /zbox/files/counts` — per-triage-bucket counts over the current scope."},"FileDeletedResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["file_uuid","deleted"],"title":"FileDeletedResponse","description":"`DELETE /zbox/files/{file_uuid}` — soft-delete (recycle-bin) ack."},"FileDetailResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"provider":{"type":"string","title":"Provider"},"external_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Folder Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Parent Key"},"category_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Source"},"category_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Sub"},"category_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Category Confidence"},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"processing_state":{"type":"string","title":"Processing State","default":"INGESTED"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"link_count":{"type":"integer","title":"Link Count","default":0},"linked_to_target":{"type":"boolean","title":"Linked To Target","default":false},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"},"jobs":{"items":{"$ref":"#/components/schemas/JobRef"},"type":"array","title":"Jobs","default":[]},"extraction":{"additionalProperties":true,"type":"object","title":"Extraction","default":{}},"sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sha256"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"ingest_run_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingest Run Ref"},"blob_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blob Ref"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"extracted_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Data"},"links":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Links","default":[]},"clients":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clients","default":[]}},"type":"object","required":["file_uuid","file_name","provider"],"title":"FileDetailResponse","description":"`GET /zbox/files/{file_uuid}` (and link / set-category / link-client) — the\nfull file detail plus the firm-level client tags the handler attaches."},"FileExtractAnswer":{"properties":{"file_name":{"type":"string","title":"File Name"},"query":{"type":"string","title":"Query"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["file_name","query","answer"],"title":"FileExtractAnswer","description":"Answer extracted from ONE document (``extract.answer_from_file``)."},"FileIdsResponse":{"properties":{"file_uuids":{"items":{"type":"string"},"type":"array","title":"File Uuids"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["file_uuids","total"],"title":"FileIdsResponse","description":"Every file_uuid matching the current filters (no page window) — backs the\ngrid's cross-page 'select all matching'. `total` == len(file_uuids)."},"FileListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FileRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"FileListResponse"},"FilePurgedResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"purged":{"type":"boolean","title":"Purged"}},"type":"object","required":["file_uuid","purged"],"title":"FilePurgedResponse","description":"`DELETE /zbox/files/{file_uuid}/purge` — permanent-delete ack."},"FileRestoredResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"restored":{"type":"boolean","title":"Restored"}},"type":"object","required":["file_uuid","restored"],"title":"FileRestoredResponse","description":"`POST /zbox/files/{file_uuid}/restore` — restore-from-recycle-bin ack."},"FileRow":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"provider":{"type":"string","title":"Provider"},"external_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Folder Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Parent Key"},"category_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Source"},"category_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Sub"},"category_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Category Confidence"},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"processing_state":{"type":"string","title":"Processing State","default":"INGESTED"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"link_count":{"type":"integer","title":"Link Count","default":0},"linked_to_target":{"type":"boolean","title":"Linked To Target","default":false},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"},"jobs":{"items":{"$ref":"#/components/schemas/JobRef"},"type":"array","title":"Jobs","default":[]},"extraction":{"additionalProperties":true,"type":"object","title":"Extraction","default":{}}},"type":"object","required":["file_uuid","file_name","provider"],"title":"FileRow"},"FileSummaryResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"cached":{"type":"boolean","title":"Cached","description":"True if the stored summary was reused (file bytes unchanged)."},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["summary","cached"],"title":"FileSummaryResponse","description":"`POST /zbox/files/{file_uuid}/summarize` — the OCR agent's condensed document\nsummary, persisted to `extracted_data.summary` (readable straight off\n`GET /zbox/files/{file_uuid}` from then on, no re-OCR)."},"FileUrlResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"FileUrlResponse"},"FinalizeResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"failures":{"items":{"type":"string"},"type":"array","title":"Failures","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"report_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Uuid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["ok"],"title":"FinalizeResult"},"FirmCreateRequest":{"properties":{"practice_name":{"type":"string","maxLength":255,"minLength":1,"title":"Practice Name","description":"Unique practice/firm name; 409 if it already exists (required).","examples":["Acme Accounting Ltd"]},"engagement_type":{"type":"string","enum":["pilot","evaluation","dev","staging","uat","production"],"title":"Engagement Type","description":"Legacy engagement tier; drives placement in higher envs. Defaults to 'pilot'.","default":"pilot","examples":["pilot"]},"agreement_signed":{"type":"boolean","title":"Agreement Signed","description":"Whether the pilot agreement is signed; seeds the pilot agreement row. Defaults false.","default":false},"gocardless_signed":{"type":"boolean","title":"Gocardless Signed","description":"Whether the GoCardless mandate is signed; seeds that agreement row. Defaults false.","default":false},"request_support_access":{"type":"boolean","title":"Request Support Access","description":"If true, opens a Domain-Support onboarding request for Practice-Portal setup. Defaults false.","default":false},"billing_contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Billing Contact Name","description":"Optional billing contact name.","examples":["Jane Director"]},"billing_contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Billing Contact Email","description":"Optional billing contact email.","examples":["billing@acmeaccounting.co.nz"]},"customer_success_manager_uuid":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Customer Success Manager Uuid","description":"Optional CS-manager assignment UUID (reserved; not yet persisted)."},"start_date":{"type":"string","format":"date","title":"Start Date","description":"Firm onboarding/start date, ISO-8601 (required).","examples":["2026-07-01"]},"number_of_jobs":{"type":"integer","multipleOf":5.0,"minimum":5.0,"title":"Number Of Jobs","description":"Contracted job count; minimum 5, multiple of 5. Defaults to 5.","default":5,"examples":[10]},"branches":{"items":{"$ref":"#/components/schemas/BranchCreate"},"type":"array","title":"Branches","description":"Optional branches/offices to create with the firm.","default":[]},"partners":{"items":{"$ref":"#/components/schemas/PartnerCreate"},"type":"array","title":"Partners","description":"Optional partner users to create + invite. Emails must be unique within the request; a level-6 (Director) partner, else the first, becomes the firm contact.","default":[]}},"type":"object","required":["practice_name","start_date"],"title":"FirmCreateRequest"},"FirmCreateResponse":{"properties":{"firm":{"$ref":"#/components/schemas/FirmResponse"},"partners":{"items":{"$ref":"#/components/schemas/PartnerInvitationResult"},"type":"array","title":"Partners"}},"type":"object","required":["firm","partners"],"title":"FirmCreateResponse"},"FirmDetailsResponse":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"firm_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Email"},"firm_primary_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Primary Phone"},"firm_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Address"},"suburb":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suburb"},"firm_pincode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Pincode"},"firm_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Type"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"practice_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Type"},"default_job_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Default Job Value"},"billing_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Name"},"billing_contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Email"},"billing_contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact Phone"},"firm_logo_document_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Logo Document Uuid"},"firm_terms_document_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Terms Document Uuid"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"is_pilot_agreement_signed":{"type":"boolean","title":"Is Pilot Agreement Signed"},"is_gocardless_mandate_signed":{"type":"boolean","title":"Is Gocardless Mandate Signed"},"is_terms_of_use_signed":{"type":"boolean","title":"Is Terms Of Use Signed","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"terms_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Content"},"terms_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms File Name"}},"type":"object","required":["firm_uuid","firm_name","is_pilot_agreement_signed","is_gocardless_mandate_signed"],"title":"FirmDetailsResponse"},"FirmEmailProfileOut":{"properties":{"firm_uuid_ref":{"type":"string","title":"Firm Uuid Ref"},"tier":{"type":"string","enum":["hosted","branded","integrated"],"title":"Tier"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"},"subdomain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subdomain"},"ses_configuration_set":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ses Configuration Set"},"ip_pool":{"type":"string","title":"Ip Pool"},"region":{"type":"string","title":"Region"},"branding_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Branding Config"},"disclaimer_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disclaimer Html"},"pii_policy":{"type":"string","enum":["zero","template"],"title":"Pii Policy"},"dkim_status":{"type":"string","title":"Dkim Status"},"dmarc_status":{"type":"string","title":"Dmarc Status"},"mail_from_status":{"type":"string","title":"Mail From Status"},"bimi_enabled":{"type":"boolean","title":"Bimi Enabled"},"integration_stream_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Stream Url"},"integration_status_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Status Url"},"has_integration_token":{"type":"boolean","title":"Has Integration Token","default":false},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["firm_uuid_ref","tier","ip_pool","region","pii_policy","dkim_status","dmarc_status","mail_from_status","bimi_enabled","is_active"],"title":"FirmEmailProfileOut"},"FirmEmailProfileUpdate":{"properties":{"tier":{"anyOf":[{"type":"string","enum":["hosted","branded","integrated"]},{"type":"null"}],"title":"Tier","description":"Sending tier: hosted, branded, or integrated.","examples":["branded"]},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email","description":"Sender ('From') email address for outbound mail.","examples":["mail@acme-advisory.com"]},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name","description":"Sender display name shown in the recipient's inbox.","examples":["Acme Advisory"]},"subdomain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subdomain","description":"Sending subdomain for the firm (branded/integrated tiers).","examples":["mail.acme-advisory.com"]},"branding_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Branding Config","description":"Bounded branding config (logo/colours) applied to templates.","examples":[{"accent":"#0b5","logo_url":"https://cdn.example.com/acme.png"}]},"disclaimer_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disclaimer Html","description":"HTML disclaimer appended to branded/integrated emails.","examples":["<p>Confidential — for the intended recipient only.</p>"]},"pii_policy":{"anyOf":[{"type":"string","enum":["zero","template"]},{"type":"null"}],"title":"Pii Policy","description":"PII minimisation policy: zero or template.","examples":["zero"]},"bimi_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bimi Enabled","description":"Whether BIMI (brand logo in inbox) is enabled.","examples":[true]}},"type":"object","title":"FirmEmailProfileUpdate","description":"Partial update of the firm email profile — only the fields you send are\napplied (merged via model_dump(exclude_unset=True)). Every field is optional."},"FirmListItem":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"firm_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Type"},"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type"},"firm_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Email"},"firm_primary_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Primary Phone"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_pilot_agreement_signed":{"type":"boolean","title":"Is Pilot Agreement Signed"},"is_gocardless_mandate_signed":{"type":"boolean","title":"Is Gocardless Mandate Signed"},"is_support_request_access":{"type":"boolean","title":"Is Support Request Access"},"number_of_jobs":{"type":"integer","title":"Number Of Jobs"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"days_since_invite":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Since Invite"},"users_count":{"type":"integer","title":"Users Count","default":0},"jobs_count":{"type":"integer","title":"Jobs Count","default":0}},"type":"object","required":["firm_uuid","firm_name","is_active","is_pilot_agreement_signed","is_gocardless_mandate_signed","is_support_request_access","number_of_jobs"],"title":"FirmListItem"},"FirmListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FirmListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"FirmListResponse"},"FirmLoginStatusResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FirmLoginStatusRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FirmLoginStatusResponse"},"FirmLoginStatusRow":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"days_since_login":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Since Login"}},"type":"object","required":["firm_uuid"],"title":"FirmLoginStatusRow"},"FirmPriorYearSettingsRequest":{"properties":{"auto_link_enabled":{"type":"boolean","title":"Auto Link Enabled","description":"Enable draft auto-linking of prior-year data; false = suggest-only.","default":true},"auto_link_threshold":{"type":"number","title":"Auto Link Threshold","description":"Confidence 0.0-1.0 above which auto-link applies (clamped).","default":0.9,"examples":[0.9]},"block_sign_off_on_comparatives":{"type":"boolean","title":"Block Sign Off On Comparatives","description":"Phase 4 gate: block job sign-off while comparatives are unresolved.","default":false}},"type":"object","title":"FirmPriorYearSettingsRequest","description":"Firm-level Prior Year config (Phase 2.5). All fields default, so a caller may\nsend only the ones they change."},"FirmResponse":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"firm_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Type"},"engagement_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engagement Type"},"firm_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Email"},"firm_primary_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Primary Phone"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_pilot_agreement_signed":{"type":"boolean","title":"Is Pilot Agreement Signed"},"is_gocardless_mandate_signed":{"type":"boolean","title":"Is Gocardless Mandate Signed"},"is_support_request_access":{"type":"boolean","title":"Is Support Request Access"},"number_of_jobs":{"type":"integer","title":"Number Of Jobs"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["firm_uuid","firm_name","is_active","is_pilot_agreement_signed","is_gocardless_mandate_signed","is_support_request_access","number_of_jobs"],"title":"FirmResponse"},"FirmUpdateRequest":{"properties":{"firm_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Firm Name","description":"New firm name; omit to leave unchanged.","examples":["Acme Accounting Ltd"]},"billing_contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Billing Contact Name","description":"New billing contact name; omit to leave unchanged.","examples":["Jane Director"]},"billing_contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Billing Contact Email","description":"New billing contact email; omit to leave unchanged.","examples":["billing@acmeaccounting.co.nz"]},"number_of_jobs":{"anyOf":[{"type":"integer","multipleOf":5.0,"minimum":5.0},{"type":"null"}],"title":"Number Of Jobs","description":"New contracted job count (min 5, multiple of 5); omit to leave unchanged.","examples":[10]},"is_pilot_agreement_signed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Pilot Agreement Signed","description":"Flip the latest pilot agreement signed state; omit to leave unchanged."},"is_gocardless_mandate_signed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Gocardless Mandate Signed","description":"Flip the latest GoCardless mandate signed state; omit to leave unchanged."},"is_support_request_access":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Support Request Access","description":"Toggle firm support-request access; omit to leave unchanged."},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Toggle the firm active/suspended; omit to leave unchanged."},"users":{"items":{"$ref":"#/components/schemas/UserUpdateInFirm"},"type":"array","title":"Users","description":"Optional per-user changes to apply in the same request; each item must carry its `user_uuid`.","default":[]}},"type":"object","title":"FirmUpdateRequest","description":"PARTIAL UPDATE of a firm — every field is optional; omit a field to leave it\nunchanged (no field here is ever required)."},"FirmUpdateResponse":{"properties":{"firm":{"$ref":"#/components/schemas/FirmResponse"},"updated_users":{"items":{"type":"string"},"type":"array","title":"Updated Users","default":[]}},"type":"object","required":["firm"],"title":"FirmUpdateResponse"},"FirmUserPatchRequest":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"New display name."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"New contact phone."},"role_level":{"anyOf":[{"type":"integer","enum":[1,2,3,4,5,6]},{"type":"null"}],"title":"Role Level","description":"New role level 1-6.","examples":[4]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Enable/disable the teammate's login."},"auth_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Type","description":"Login method ('manual'/SSO). Only a Director may change this (ORG.PERM_USERS_MANAGEMENT__EDIT_USER); ignored otherwise."},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid","description":"Reassign the teammate to this branch."},"is_branch_head":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Branch Head","description":"When true (with branch_uuid), mark as branch manager."}},"type":"object","title":"FirmUserPatchRequest","description":"Partial update — every field is optional; send only what changes."},"FirmUserPatchResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"FirmUserPatchResponse"},"FolderAutoMapClientsResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"clients":{"items":{"$ref":"#/components/schemas/FolderClientSuggestion"},"type":"array","title":"Clients"}},"type":"object","required":["provider","clients"],"title":"FolderAutoMapClientsResponse"},"FolderAutoMapJobsRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"client_folder_id":{"type":"string","title":"Client Folder Id"},"client_uuid":{"type":"string","title":"Client Uuid"},"ai_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Run Id"}},"type":"object","required":["provider","client_folder_id","client_uuid"],"title":"FolderAutoMapJobsRequest"},"FolderAutoMapJobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/FolderJobSuggestion"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"FolderAutoMapJobsResponse"},"FolderAutoMapRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"base_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Folder Id"},"ai_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Run Id"}},"type":"object","required":["provider"],"title":"FolderAutoMapRequest","description":"Auto-map client folders to Zato clients. `base_folder_id` null (default) scans\nthe children of every folder marked \"subfolders are Clients\"; a non-null value\noverrides that and scans just that one folder. Jobs load per client separately.\n`ai_run_id` (optional) seeds each row with the LLM's target guess (fuzzy fallback)."},"FolderClientSuggestion":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"folder_label":{"type":"string","title":"Folder Label"},"recommended_client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Client Uuid"},"recommended_client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Client Name"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"anyOf":[{"type":"string","enum":["manual","auto_exact","auto_fuzzy","auto_ai"]},{"type":"null"}],"title":"Origin"}},"type":"object","required":["folder_id","folder_label"],"title":"FolderClientSuggestion"},"FolderImportAccepted":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"linked":{"type":"integer","title":"Linked"},"already":{"type":"integer","title":"Already"},"ingesting":{"type":"integer","title":"Ingesting"},"folders":{"type":"integer","title":"Folders"},"skipped":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Skipped"}},"type":"object","required":["batch_id","linked","already","ingesting","folders"],"title":"FolderImportAccepted"},"FolderImportRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"folder_ids":{"items":{"type":"string"},"type":"array","title":"Folder Ids"},"categorize":{"type":"boolean","title":"Categorize","default":true}},"type":"object","required":["provider"],"title":"FolderImportRequest","description":"Bulk-import every file under the provider's mapped folders to its tagged\nclient/job. `folder_ids` empty (default) = all active client/job tags for the\nprovider; a subset imports just those."},"FolderJobSuggestion":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"folder_label":{"type":"string","title":"Folder Label"},"recommended_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Job Uuid"},"recommended_job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Job Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"fiscal_year_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year Hint"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"anyOf":[{"type":"string","enum":["manual","auto_exact","auto_fuzzy","auto_ai"]},{"type":"null"}],"title":"Origin"}},"type":"object","required":["folder_id","folder_label"],"title":"FolderJobSuggestion"},"FolderMark":{"properties":{"folder_id":{"type":"string","title":"Folder Id","description":"provider folder id; '' = provider root"},"folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Label"},"child_role":{"type":"string","enum":["client","job","fiscal_year","source","ignore"],"title":"Child Role"},"depth_roles":{"anyOf":[{"items":{"type":"string","enum":["job","fiscal_year","source"]},"type":"array"},{"type":"null"}],"title":"Depth Roles"}},"type":"object","required":["folder_id","child_role"],"title":"FolderMark","description":"One structural declaration: the subfolders of `folder_id` have role\n`child_role`. `folder_id` is the provider folder id (\"\" = the provider root).\nMarks are per-folder (non-uniform trees allowed) and stored as a small bounded\nlist in `zbox_integrations.settings.folder_mapping.marks`.\n\n`depth_roles` is ONLY meaningful on a `child_role=\"client\"` mark: it is the\ngeneric ordered chain under each mapped client folder. A per-folder mark on an\nindividual client folder still overrides this default (uneven trees stay\nexpressible)."},"FolderMarkRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Id"},"folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Label"},"child_role":{"anyOf":[{"type":"string","enum":["client","job","fiscal_year","source","ignore"]},{"type":"null"}],"title":"Child Role"},"depth_roles":{"anyOf":[{"items":{"type":"string","enum":["job","fiscal_year","source"]},"type":"array"},{"type":"null"}],"title":"Depth Roles"},"ancestor_ids":{"items":{"type":"string"},"type":"array","title":"Ancestor Ids"}},"type":"object","required":["provider"],"title":"FolderMarkRequest","description":"Set (or clear) one folder's child role from the browse toolbar. `folder_id`\nNone = the provider root; `child_role` None = clear the mark on that folder.\n`depth_roles` is only applied when `child_role=\"client\"` (see `FolderMark`).\n`ancestor_ids` (nearest-parent -> root) guards a \"client\" mark against nesting\ninside an already-tagged client/job entity."},"FolderMarkResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"marks":{"items":{"$ref":"#/components/schemas/FolderMark"},"type":"array","title":"Marks"},"child_role":{"anyOf":[{"type":"string","enum":["client","job","fiscal_year","source","ignore"]},{"type":"null"}],"title":"Child Role"}},"type":"object","required":["provider","marks"],"title":"FolderMarkResponse"},"FolderResolveRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"folder_id":{"type":"string","title":"Folder Id"},"ancestor_ids":{"items":{"type":"string"},"type":"array","title":"Ancestor Ids"}},"type":"object","required":["provider","folder_id"],"title":"FolderResolveRequest","description":"Resolve the effective client/job target for the folder the user is linking\nfrom. `ancestor_ids` is the breadcrumb chain the browser already holds, ordered\nNEAREST-parent → root; the backend picks the closest tagged folder (one indexed\nread, no provider tree walk)."},"FolderResolveResponse":{"properties":{"target":{"anyOf":[{"$ref":"#/components/schemas/ResolvedTarget"},{"type":"null"}]}},"type":"object","title":"FolderResolveResponse"},"FolderStructureResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"marks":{"items":{"$ref":"#/components/schemas/FolderMark"},"type":"array","title":"Marks"}},"type":"object","required":["provider","marks"],"title":"FolderStructureResponse","description":"Every structural mark declared for a folder provider."},"FolderTag":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"kind":{"type":"string","enum":["client_folder","job_folder"],"title":"Kind"},"target_type":{"type":"string","title":"Target Type"},"target_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Uuid"},"target_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Label"},"fiscal_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year"},"folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Label"}},"type":"object","required":["folder_id","kind","target_type"],"title":"FolderTag","description":"A resolved active tag (browse-badge hydration + the review table's saved state)."},"FolderTagRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"tag":{"$ref":"#/components/schemas/ConfirmedFolderMapping"},"ancestor_ids":{"items":{"type":"string"},"type":"array","title":"Ancestor Ids"}},"type":"object","required":["provider","tag"],"title":"FolderTagRequest","description":"Tag one folder inline (from the browse grid) as a client/job. `ancestor_ids`\n(nearest-parent -> root) guards a client_folder tag against nesting inside an\nalready-tagged client/job entity."},"FolderTagsResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"tags":{"items":{"$ref":"#/components/schemas/FolderTag"},"type":"array","title":"Tags"}},"type":"object","required":["provider","tags"],"title":"FolderTagsResponse"},"FolderTagsSaveRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"tags":{"items":{"$ref":"#/components/schemas/ConfirmedFolderMapping"},"type":"array","title":"Tags"}},"type":"object","required":["provider","tags"],"title":"FolderTagsSaveRequest","description":"Persist a batch of confirmed tags from the bulk auto-map review table."},"FolderTagsSaveResponse":{"properties":{"saved":{"type":"integer","title":"Saved"}},"type":"object","required":["saved"],"title":"FolderTagsSaveResponse"},"FolderUntagRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"folder_id":{"type":"string","title":"Folder Id"},"kind":{"anyOf":[{"type":"string","enum":["client_folder","job_folder"]},{"type":"null"}],"title":"Kind"},"cascade":{"type":"boolean","title":"Cascade","default":false}},"type":"object","required":["provider","folder_id"],"title":"FolderUntagRequest"},"FolderUntagResponse":{"properties":{"removed":{"type":"integer","title":"Removed"},"unlinked":{"type":"integer","title":"Unlinked","default":0}},"type":"object","required":["removed"],"title":"FolderUntagResponse"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Required. Email to send the Cognito password-reset code to.","examples":["director@acme.co.nz"]}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"FullDocOut":{"properties":{"doc":{"additionalProperties":true,"type":"object","title":"Doc"}},"type":"object","title":"FullDocOut","description":"Payload of ``GET /{job}/doc`` — the whole stored workpaper doc (UI-injected)."},"FyiAiMapDispatchResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","status"],"title":"FyiAiMapDispatchResponse","description":"202 ack — the run executes off the edge loop; poll the run / proposals by id."},"FyiAiMapProposalsResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"entity_map":{"items":{"$ref":"#/components/schemas/FyiEntityMapItem"},"type":"array","title":"Entity Map"},"job_map":{"items":{"$ref":"#/components/schemas/FyiJobMapItem"},"type":"array","title":"Job Map"}},"type":"object","required":["run_id","status"],"title":"FyiAiMapProposalsResponse","description":"The completed run's proposals (read once the run banner reports done). `status`\nmirrors the run lifecycle; both maps are empty until the run completes."},"FyiAssistConfirmRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"}},"type":"object","required":["client_uuid","fyi_entity_id"],"title":"FyiAssistConfirmRequest"},"FyiAssistConfirmResponse":{"properties":{"saved":{"type":"integer","title":"Saved"}},"type":"object","required":["saved"],"title":"FyiAssistConfirmResponse","description":"Ack for persisting the confirmed FYI entity → client mapping."},"FyiAssistEntity":{"properties":{"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"confidence":{"type":"number","title":"Confidence"},"origin":{"type":"string","title":"Origin"},"mapped":{"type":"boolean","title":"Mapped"}},"type":"object","required":["fyi_entity_id","confidence","origin","mapped"],"title":"FyiAssistEntity","description":"The suggested FYI entity for a Zato client (the browse-time auto-map assist)."},"FyiAssistJob":{"properties":{"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"}},"type":"object","title":"FyiAssistJob","description":"Zato client/job context shown alongside the suggestion."},"FyiAssistResponse":{"properties":{"entity":{"anyOf":[{"$ref":"#/components/schemas/FyiAssistEntity"},{"type":"null"}]},"job":{"anyOf":[{"$ref":"#/components/schemas/FyiAssistJob"},{"type":"null"}]}},"type":"object","title":"FyiAssistResponse","description":"FYI entity suggestion + job context for the ZBox browser auto-map assist."},"FyiEntitiesResponse":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/FYIEntityOut"},"type":"array","title":"Entities"}},"type":"object","required":["entities"],"title":"FyiEntitiesResponse"},"FyiEntityMapItem":{"properties":{"fyi_entity_id":{"type":"string","title":"Fyi Entity Id"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["fyi_entity_id"],"title":"FyiEntityMapItem","description":"One LLM entity → Zato client suggestion. `client_uuid` is always a firm-owned\nclient (foreign/hallucinated uuids are dropped by the brain's shaping guard)."},"FyiJobMapItem":{"properties":{"fyi_job_id":{"type":"string","title":"Fyi Job Id"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["fyi_job_id"],"title":"FyiJobMapItem","description":"One LLM FYI job → Zato job suggestion. `job_uuid` is always a firm-owned job."},"FyiJobSuggestCandidate":{"properties":{"id":{"type":"string","title":"Id"},"client_uuid":{"type":"string","title":"Client Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["id","client_uuid"],"title":"FyiJobSuggestCandidate","description":"One candidate Zato job (the drawer's already-loaded /zato-jobs rows)."},"FyiJobSuggestItem":{"properties":{"fyi_job_id":{"type":"string","title":"Fyi Job Id"},"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"saved_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Saved Job Uuid"}},"type":"object","required":["fyi_job_id","client_uuid"],"title":"FyiJobSuggestItem","description":"One FYI job to find a Zato job for. `saved_job_uuid` is its already-confirmed\nZato job (→ origin 'manual' when still a live candidate)."},"FyiJobSuggestRequest":{"properties":{"fyi_jobs":{"items":{"$ref":"#/components/schemas/FyiJobSuggestItem"},"type":"array","maxItems":2000,"title":"Fyi Jobs"},"zato_jobs":{"items":{"$ref":"#/components/schemas/FyiJobSuggestCandidate"},"type":"array","maxItems":5000,"title":"Zato Jobs"}},"type":"object","title":"FyiJobSuggestRequest","description":"Score `fyi_jobs` against `zato_jobs` using the shared name matcher. The drawer\npasses the names it already loaded (no duplicate live-FYI fetch); the backend owns\nthe matching so it stays identical to the folder path. The lists are capped so the\nsynchronous fuzzy scoring (O(jobs x candidates)) can't be handed an unbounded payload\nthat would hold the event loop."},"FyiJobSuggestResponse":{"properties":{"suggestions":{"items":{"$ref":"#/components/schemas/FyiJobSuggestion"},"type":"array","title":"Suggestions"}},"type":"object","required":["suggestions"],"title":"FyiJobSuggestResponse"},"FyiJobSuggestion":{"properties":{"fyi_job_id":{"type":"string","title":"Fyi Job Id"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},"type":"object","required":["fyi_job_id"],"title":"FyiJobSuggestion","description":"The recommended Zato job for one FYI job. `origin`: 'manual' (saved) |\n'auto_exact' | 'auto_fuzzy' | None (nothing cleared the threshold)."},"FyiJobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/FYIJobOut"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"FyiJobsResponse"},"GlAnalysisResult":{"properties":{"glYears":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Glyears"}},"additionalProperties":true,"type":"object","title":"GlAnalysisResult","description":"GL-scrutiny analysis result (`POST .../analyze`) — the engine's AnalysisResult\n(detector findings, buckets, meta) plus `glYears`. Shape is owned by the engine,\nso this is documented as an open object (not revalidated)."},"GlColumn":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"numeric":{"type":"boolean","title":"Numeric","default":false}},"type":"object","required":["key","label"],"title":"GlColumn"},"GlPreviewResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GlPreviewRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"gl_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Year"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"is_gl_file":{"type":"boolean","title":"Is Gl File"},"processing_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing State"}},"type":"object","required":["items","total","limit","offset","is_gl_file"],"title":"GlPreviewResponse"},"GlPreviewRow":{"properties":{"gl_id":{"type":"integer","title":"Gl Id"},"transaction_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transaction Date"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_code_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code Reference"},"account_code_name_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code Name Reference"},"account_code_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code Category"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Debit"},"credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit"},"gst":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gst"},"gst_rate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gst Rate"},"gst_rate_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst Rate Name"},"row_type":{"type":"string","title":"Row Type"},"tracking":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tracking"}},"type":"object","required":["gl_id","row_type"],"title":"GlPreviewRow"},"GlProcessResult":{"properties":{"rows_inserted":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rows Inserted"},"gl_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Year"},"file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Uuid"},"is_gl_file":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Gl File"},"detected_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Year"},"min_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Date"},"max_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Date"}},"additionalProperties":true,"type":"object","title":"GlProcessResult","description":"Engine ack for a GL process/parse run. The shape is Rust-engine-owned and\nvaries by mode — a normal insert returns row counts, a detect-only pre-flight\nreturns the detected year/GL-ness — so extra keys are allowed. Docs-only: the\nhandler returns the raw engine dict unchanged."},"GlRowsResponse":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"gl_file_name":{"type":"string","title":"Gl File Name","default":""},"row_count":{"type":"integer","title":"Row Count","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"GlRowsResponse"},"GlStatusResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"is_xero":{"type":"boolean","title":"Is Xero"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"years":{"items":{},"type":"array","title":"Years"},"cy_year":{"anyOf":[{},{"type":"null"}],"title":"Cy Year"},"py_year":{"anyOf":[{},{"type":"null"}],"title":"Py Year"},"has_cy":{"type":"boolean","title":"Has Cy"},"has_py":{"type":"boolean","title":"Has Py"},"can_analyze":{"type":"boolean","title":"Can Analyze"}},"type":"object","required":["job_uuid","client_uuid","client_name","job_name","is_xero","financial_year","years","cy_year","py_year","has_cy","has_py","can_analyze"],"title":"GlStatusResponse","description":"GL availability for a job (`GET .../gl-status`)."},"GlSupportingData":{"properties":{"file_name":{"type":"string","title":"File Name"},"section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section"},"columns":{"items":{"$ref":"#/components/schemas/GlColumn"},"type":"array","title":"Columns"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["file_name","columns","rows"],"title":"GlSupportingData","description":"The lazily-fetched GL LEDGER behind a GL-supporting stub (Z1's lazy_load on view): per account,\nOpening Balance → transactions (running balance) → Total → Net Movement → Closing Balance."},"GlValueScanParent":{"properties":{"parent_name":{"type":"string","title":"Parent Name"},"count":{"type":"integer","title":"Count"},"total":{"type":"number","title":"Total"}},"type":"object","required":["parent_name","count","total"],"title":"GlValueScanParent","description":"Per-parent-account rollup of the matched transactions."},"GlValueScanResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"min_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Value"},"max_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Value"},"count":{"type":"integer","title":"Count"},"returned":{"type":"integer","title":"Returned"},"truncated":{"type":"boolean","title":"Truncated"},"transactions":{"items":{"$ref":"#/components/schemas/GlValueScanTxn"},"type":"array","title":"Transactions"},"by_parent":{"items":{"$ref":"#/components/schemas/GlValueScanParent"},"type":"array","title":"By Parent"}},"type":"object","required":["job_uuid","wp_code","min_value","max_value","count","returned","truncated","transactions","by_parent"],"title":"GlValueScanResponse","description":"GL transactions filtered by |amount| band, with a per-parent rollup (docs-only shape\nof ``scan_gl_by_value``). ``truncated`` flags that more matched than ``limit``."},"GlValueScanTxn":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"account_code":{"type":"string","title":"Account Code"},"account_name":{"type":"string","title":"Account Name"},"parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Name"},"workpaper_code":{"type":"string","title":"Workpaper Code"},"description":{"type":"string","title":"Description"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["date","account_code","account_name","parent_name","workpaper_code","description","amount"],"title":"GlValueScanTxn","description":"One GL transaction matched by the value-band scan (``gl_scan.scan_gl_by_value``)."},"GoogleDriveConnectRequest":{"properties":{"GOOGLEDRIVE_CLIENT_ID":{"type":"string","title":"Googledrive Client Id","description":"OAuth-mode only: the firm's own Google OAuth client id. Required when connecting via your own OAuth app; omit (or leave blank) for the service-account path or the one-click shared-Zato-app path.","default":"","examples":["1234567890-abc123def456.apps.googleusercontent.com"]},"GOOGLEDRIVE_CLIENT_SECRET":{"type":"string","title":"Googledrive Client Secret","description":"OAuth-mode client secret paired with GOOGLEDRIVE_CLIENT_ID. Required on the first OAuth connect; blank on RE-connect keeps the previously-saved secret, and it is omitted entirely for the service-account or shared-app path.","default":"","examples":["GOCSPX-aBcDeFgHiJkLmNoPqRsTuVwX"]},"GOOGLEDRIVE_SERVICE_ACCOUNT_JSON":{"type":"string","title":"Googledrive Service Account Json","description":"Service-account mode: the full downloaded SA key JSON (must include client_email and private_key). Provide THIS to connect immediately with no popup; omit it to use the OAuth-app path (client id/secret) instead.","default":"","examples":["{\"type\":\"service_account\",\"client_email\":\"svc@proj.iam.gserviceaccount.com\",\"private_key\":\"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n\"}"]}},"type":"object","title":"GoogleDriveConnectRequest","description":"Connect payload entered in the ZIP portal. Two modes:\n  - **Service account** (recommended, credentials-only): paste the SA JSON in\n    `GOOGLEDRIVE_SERVICE_ACCOUNT_JSON` — no popup, no redirect.\n  - **OAuth app** (legacy): the firm's app id + secret, then a consent popup\n    fetches the refresh token in-code.\nOn RE-connect the secret / SA key may be left blank to keep the saved one (the\nGET never returns them, so the form can't echo them back).\n\nEvery field is optional because which ones are needed depends on the mode; see\neach field's description for the condition. (Send the SA JSON alone, or the\nclient id/secret, or nothing at all for the one-click shared-Zato-app path.)"},"GrantSupportRequest":{"properties":{"user_uuid":{"type":"string","maxLength":64,"minLength":1,"title":"User Uuid","description":"UUID of the target user (must be a cs_team user) to grant support access (required).","examples":["b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6"]},"role_name":{"type":"string","maxLength":128,"minLength":1,"title":"Role Name","description":"Name of a seeded support-portal role to assign (required).","examples":["Support Agent"]}},"type":"object","required":["user_uuid","role_name"],"title":"GrantSupportRequest"},"GrantSupportResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"firm_uuid":{"type":"string","title":"Firm Uuid"},"role_name":{"type":"string","title":"Role Name"}},"type":"object","required":["user_uuid","firm_uuid","role_name"],"title":"GrantSupportResponse"},"GridPerson":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"}},"type":"object","required":["full_name","role_name"],"title":"GridPerson","description":"A person shown in the grid's Accountant/Manager column."},"GridPrefsBody":{"properties":{"col_order":{"items":{"type":"string"},"type":"array","title":"Col Order","description":"Column IDs in left-to-right display order; empty = grid default order.","examples":[["date","description","amount"]]},"col_hidden":{"items":{"type":"string"},"type":"array","title":"Col Hidden","description":"Column IDs the user has hidden.","examples":[["internal_id"]]},"col_pinned":{"items":{"type":"string"},"type":"array","title":"Col Pinned","description":"Column IDs pinned to the left of the grid.","examples":[["date"]]},"col_widths":{"additionalProperties":{"type":"number"},"type":"object","title":"Col Widths","description":"Per-column pixel widths keyed by column ID.","examples":[{"amount":120.0,"description":240.0}]},"col_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ColOverride"},"type":"object","title":"Col Overrides","description":"Per-column display overrides (header/alignment/editable/info) keyed by column ID.","examples":[{"amount":{"text_align":"right"}}]},"panel_group_by":{"type":"string","title":"Panel Group By","description":"Column ID for the primary row grouping; empty = no grouping.","default":"","examples":["client"]},"panel_group_by_2":{"type":"string","title":"Panel Group By 2","description":"Column ID for the secondary row grouping; empty = none.","default":"","examples":["month"]},"panel_agg_funcs":{"additionalProperties":{"type":"string"},"type":"object","title":"Panel Agg Funcs","description":"Aggregation function per column ID (e.g. sum/avg/min/max/count).","examples":[{"amount":"sum"}]},"show_grid_lines":{"type":"boolean","title":"Show Grid Lines","description":"Whether grid lines are rendered (default true).","default":true,"examples":[true]},"show_search":{"type":"boolean","title":"Show Search","description":"Whether the grid's search box is shown (default true).","default":true,"examples":[true]},"saved_at":{"type":"string","title":"Saved At","description":"Client-set ISO-8601 timestamp of when the prefs were saved.","default":"","examples":["2026-07-06T10:30:00Z"]},"grid_version":{"type":"integer","title":"Grid Version","description":"Schema version of this preferences payload.","default":1,"examples":[1]}},"type":"object","title":"GridPrefsBody","description":"AG Grid preferences for one grid table (full-save upsert payload).\n\nEvery field is OPTIONAL with a sensible default — the backend saves the\nwhole model verbatim, so an omitted field is persisted as its default (an\nempty body {} is a valid all-defaults save). Send the full object to persist\nthe user's current grid layout."},"GridPrefsResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"grid_table":{"type":"string","title":"Grid Table"},"prefs":{"$ref":"#/components/schemas/GridPrefsBody"}},"type":"object","required":["user_id","grid_table","prefs"],"title":"GridPrefsResponse"},"GroupClientsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientInGroup"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"GroupClientsResponse"},"GroupClientsUpdatedResponse":{"properties":{"updated":{"type":"integer","title":"Updated"}},"type":"object","required":["updated"],"title":"GroupClientsUpdatedResponse","description":"Ack for add/remove-clients — `updated` is the number of client rows changed."},"GroupCreateRequest":{"properties":{"group_name":{"type":"string","title":"Group Name","description":"Display name for the new client group. Required — passed straight to the ClientGroup row with no fallback.","examples":["Smith Family Group"]},"primary_contact_client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Contact Client Uuid","description":"Optional client_uuid to flag as the group's primary contact (the client is auto-added to the group). Omit for no primary contact.","examples":["a1b2c3d4-1111-2222-3333-444455556666"]},"client_uuids":{"items":{"type":"string"},"type":"array","title":"Client Uuids","description":"Optional list of client_uuids to add as initial members. Omit or pass [] to create an empty group.","examples":[["a1b2c3d4-1111-2222-3333-444455556666"]]}},"type":"object","required":["group_name"],"title":"GroupCreateRequest"},"GroupCreateResponse":{"properties":{"group_id":{"type":"integer","title":"Group Id"},"group_uuid":{"type":"string","title":"Group Uuid"},"group_name":{"type":"string","title":"Group Name"},"primary_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Contact Name"},"primary_contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Contact Email"},"entity_count":{"type":"integer","title":"Entity Count","default":0}},"type":"object","required":["group_id","group_uuid","group_name"],"title":"GroupCreateResponse"},"GroupListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GroupSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"GroupListResponse"},"GroupRef":{"properties":{"entity_questionnaire_group_uuid":{"type":"string","title":"Entity Questionnaire Group Uuid"}},"type":"object","required":["entity_questionnaire_group_uuid"],"title":"GroupRef"},"GroupSummary":{"properties":{"group_id":{"type":"integer","title":"Group Id"},"group_uuid":{"type":"string","title":"Group Uuid"},"group_name":{"type":"string","title":"Group Name"},"primary_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Contact Name"},"primary_contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Contact Email"},"entity_count":{"type":"integer","title":"Entity Count","default":0}},"type":"object","required":["group_id","group_uuid","group_name"],"title":"GroupSummary"},"GuidelinesIn":{"properties":{"guidelines":{"type":"string","title":"Guidelines","description":"Guidelines markdown to store for the WP. Send an empty string to clear the guidelines.","default":"","examples":["## How to complete this workpaper\n- Reconcile the balance to the GL…"]}},"type":"object","title":"GuidelinesIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HiddenCabinetsResponse":{"properties":{"hidden":{"type":"integer","title":"Hidden"}},"type":"object","required":["hidden"],"title":"HiddenCabinetsResponse","description":"Ack for replacing the hidden-cabinet set — count now hidden."},"HitlAnswerOut":{"properties":{"request_uuid":{"type":"string","title":"Request Uuid"},"status":{"type":"string","title":"Status"},"resolved_event_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Event Uuid"}},"type":"object","required":["request_uuid","status"],"title":"HitlAnswerOut"},"HitlAnswerRequest":{"properties":{"answer":{"additionalProperties":true,"type":"object","title":"Answer","description":"Handler-typed answer payload; its shape depends on the request's request_type. For coa_account_type send {\"parent_key\": \"telephone\", \"section\": null}; send {\"action\": \"reject\"} to decline the request. Structurally optional (defaults to {}), but the typed handler rejects an empty or malformed answer (e.g. coa_account_type requires 'parent_key').","examples":[{"parent_key":"telephone"}]}},"type":"object","title":"HitlAnswerRequest"},"HitlListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HitlRequestOut"},"type":"array","title":"Items"},"pending_count":{"type":"integer","title":"Pending Count"}},"type":"object","required":["items","pending_count"],"title":"HitlListResponse"},"HitlRequestOut":{"properties":{"request_uuid":{"type":"string","title":"Request Uuid"},"request_type":{"type":"string","title":"Request Type"},"status":{"type":"string","title":"Status"},"title":{"type":"string","title":"Title"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"options":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Options"},"answer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Answer"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"owner_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Label"},"answered_by_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answered By Label"},"deep_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deep Link"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied At"}},"type":"object","required":["request_uuid","request_type","status","title","created_at"],"title":"HitlRequestOut"},"ImportXeroItem":{"properties":{"partner_journal_id":{"type":"string","title":"Partner Journal Id"},"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"action":{"type":"string","title":"Action"},"narration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narration"}},"type":"object","required":["partner_journal_id","manual_journal_uuid","action"],"title":"ImportXeroItem"},"ImportXeroResponse":{"properties":{"created":{"type":"integer","title":"Created","default":0},"updated":{"type":"integer","title":"Updated","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"voided":{"type":"integer","title":"Voided","default":0},"items":{"items":{"$ref":"#/components/schemas/ImportXeroItem"},"type":"array","title":"Items","default":[]}},"type":"object","title":"ImportXeroResponse","description":"Response for POST /journals/{job_uuid}/import-xero."},"InfraComponent":{"properties":{"component":{"type":"string","title":"Component"},"ok":{"type":"boolean","title":"Ok"},"status":{"type":"string","title":"Status"},"detail":{"additionalProperties":true,"type":"object","title":"Detail"}},"type":"object","required":["component","ok","status"],"title":"InfraComponent","description":"One infrastructure resource card (see ``infrastructure._component``).\n``detail`` carries non-sensitive, resource-kind-specific fields."},"InfrastructureHealthResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"stack":{"type":"string","title":"Stack"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"groups":{"additionalProperties":{"items":{"$ref":"#/components/schemas/InfraComponent"},"type":"array"},"type":"object","title":"Groups"}},"type":"object","required":["ok","stack","region","groups"],"title":"InfrastructureHealthResponse","description":"Aggregate AWS infra status grouped by tier. Best-effort, non-sensitive."},"IntegratedStatusAck":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"IntegratedStatusAck","description":"Ack for a firm's integrated-tier delivery-status callback."},"IntegrationFilterCapsResponse":{"properties":{"capabilities":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Capabilities"},"doc_types":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Doc Types","default":{}},"client_mapping":{"items":{"type":"string"},"type":"array","title":"Client Mapping","default":[]},"folder_mapping":{"items":{"type":"string"},"type":"array","title":"Folder Mapping","default":[]}},"type":"object","required":["capabilities"],"title":"IntegrationFilterCapsResponse","description":"Per-provider live-browse capability registry — drives the provider-aware filter\ntoolbar (which controls to render), the document-type vocabularies, and which\nproviders expose the client-mapping surface."},"IntegrationFolderResponse":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/ProviderTreeNode"},"type":"array","title":"Folders","default":[]},"files":{"items":{"$ref":"#/components/schemas/FileRow"},"type":"array","title":"Files","default":[]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"IntegrationFolderResponse","description":"One folder level: subfolders (for the tree) + a cursor page of files (for the\ngrid) + an opaque `next_cursor` (None = last page)."},"IntegrationTreeResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/ProviderTreeNode"},"type":"array","title":"Nodes","default":[]}},"type":"object","title":"IntegrationTreeResponse","description":"`GET /zbox/integrations/tree` — provider tree roots (live + seeded)."},"InvestigateAssignIn":{"properties":{"assignee_user_id":{"type":"string","minLength":1,"title":"Assignee User Id"}},"type":"object","required":["assignee_user_id"],"title":"InvestigateAssignIn"},"InvitationDetail":{"properties":{"invitation_uuid":{"type":"string","title":"Invitation Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"questionnaire_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Questionnaire Title"},"current_owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Owner Email"},"status":{"type":"string","title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections","default":[]},"answers":{"items":{"$ref":"#/components/schemas/AnswerOut"},"type":"array","title":"Answers","default":[]},"participants":{"items":{"$ref":"#/components/schemas/ParticipantOut"},"type":"array","title":"Participants","default":[]},"ownership_trail":{"items":{"$ref":"#/components/schemas/OwnershipEventOut"},"type":"array","title":"Ownership Trail","default":[]}},"type":"object","required":["invitation_uuid","status"],"title":"InvitationDetail"},"InvitationSummary":{"properties":{"invitation_uuid":{"type":"string","title":"Invitation Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"questionnaire_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Questionnaire Title"},"current_owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Owner Email"},"status":{"type":"string","title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"}},"type":"object","required":["invitation_uuid","status"],"title":"InvitationSummary"},"IrdAgentLinkRequest":{"properties":{"agent_ird":{"type":"string","title":"Agent Ird","description":"REQUIRED. The firm's tax-agent IRD number, used to link the agent to the platform and then discover its clients (9 digits; hyphens tolerated).","examples":["123-456-789"]}},"type":"object","required":["agent_ird"],"title":"IrdAgentLinkRequest","description":"The firm's tax-agent IRD number (9 digits; hyphens tolerated)."},"IrdAutoMapResponse":{"properties":{"auto_exact":{"type":"integer","title":"Auto Exact"},"auto_name":{"type":"integer","title":"Auto Name"}},"type":"object","required":["auto_exact","auto_name"],"title":"IrdAutoMapResponse"},"IrdConnectResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorize_url","state"],"title":"IrdConnectResponse","description":"POST /ird/connect — the authorize URL the browser should visit."},"IrdDisconnectResponse":{"properties":{"status":{"type":"string","title":"Status","default":"success"},"message":{"type":"string","title":"Message","default":"IRD connection removed"}},"type":"object","title":"IrdDisconnectResponse"},"IrdDiscoverRequest":{"properties":{"client_list_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client List Id","description":"Source clients from the TDS client list (mTLS-only; works without Intermediation delegation). Provide EITHER this OR agent_ird — the request is rejected if both are omitted. Preferred when present.","examples":["CL-100234"]},"agent_ird":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Ird","description":"Source clients via the Intermediation RetrieveClientList for this tax-agent IRD number. Used only when client_list_id is absent; provide EITHER this OR client_list_id.","examples":["123-456-789"]}},"type":"object","title":"IrdDiscoverRequest","description":"Discover the firm's IRD clients. Provide a `client_list_id` to source them\nfrom the TDS client list (mTLS-only, works without Intermediation delegation),\nor an `agent_ird` to use the Intermediation RetrieveClientList."},"IrdDiscoverResponse":{"properties":{"discovered":{"type":"integer","title":"Discovered"},"source":{"type":"string","title":"Source"}},"type":"object","required":["discovered","source"],"title":"IrdDiscoverResponse"},"IrdMappingItem":{"properties":{"ird_number":{"type":"string","title":"Ird Number"},"ird_client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Client Name"},"ird_account_types":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Account Types"},"ird_client_list_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Client List Id"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"mapping_origin":{"type":"string","title":"Mapping Origin"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["ird_number","mapping_origin"],"title":"IrdMappingItem"},"IrdMappingListResponse":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/IrdMappingItem"},"type":"array","title":"Mappings"}},"type":"object","required":["mappings"],"title":"IrdMappingListResponse"},"IrdSetMappingRequest":{"properties":{"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"The Zato client UUID to point this IRD client at. Optional: pass null (or omit) to CLEAR the mapping and leave the IRD client unmapped.","examples":["9f1c2b7e-4d3a-4a11-9c0e-1b2c3d4e5f60"]}},"type":"object","title":"IrdSetMappingRequest"},"IrdStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"myir_logon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Myir Logon"},"scopes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scopes"},"authorized_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Authorized At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["status"],"title":"IrdStatusResponse","description":"GET /ird/status — whether the firm's myIR is connected + grant health."},"IrdSyncRequest":{"properties":{"force":{"type":"boolean","title":"Force","description":"Force a full refetch of every period, ignoring the change-detection shortcut. Defaults to false.","default":false},"client_list_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client List Id","description":"Optional: sync an entire IRD client list by its ID (the direct path — pulls the whole list in one call, no mapping/OAuth needed). Absent = sync over the firm's confirmed client mappings.","examples":["CL-100234"]},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number","description":"Optional: sync ONLY this one IRD number's confirmed mapping (the on-create pull for a single client). Absent = sync over every confirmed mapping.","examples":["123-456-789"]},"filing_period_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filing Period From","description":"Optional financial-year / balance-date lower bound (ISO YYYY-MM-DD). NZ INC balance dates file 31 March, so FY2024/25 is filing_period_from=2024-04-01. Absent = all periods.","examples":["2024-04-01"]},"filing_period_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filing Period To","description":"Optional financial-year / balance-date upper bound (ISO YYYY-MM-DD), e.g. FY2024/25 filing_period_to=2025-03-31. Absent = all periods.","examples":["2025-03-31"]}},"type":"object","title":"IrdSyncRequest","description":"All fields optional — an empty body syncs every confirmed client mapping."},"IrdSyncResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","status"],"title":"IrdSyncResponse"},"IssuedFile":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"upload_url":{"type":"string","title":"Upload Url"},"s3_key":{"type":"string","title":"S3 Key"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["file_uuid","file_name","upload_url","s3_key","expires_at"],"title":"IssuedFile"},"JobAgedResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["job_uuid","rows"],"title":"JobAgedResponse","description":"A job's stored aged payables / receivables rows."},"JobConfigAllResponse":{"properties":{"workpapers":{"additionalProperties":{"$ref":"#/components/schemas/WpConfigWorkpaper"},"type":"object","title":"Workpapers"}},"type":"object","title":"JobConfigAllResponse","description":"Envelope payload for the full per-job workpaper-view doc — one config entry per\nworkpaper, keyed by ``wp_code`` (``{\"workpapers\": {...}}``)."},"JobDetail":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"xpm_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xpm Start Date"},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date"},"is_zato":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Zato"},"no_gl_source":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"No Gl Source"},"can_view":{"type":"boolean","title":"Can View","default":false},"can_edit":{"type":"boolean","title":"Can Edit","default":false},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"is_xero_connected":{"type":"boolean","title":"Is Xero Connected","default":false},"coa_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa File Name"},"is_processing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Processing"},"is_ready_for_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Ready For Review"},"is_ready_for_signoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Ready For Signoff"},"dates_locked":{"type":"boolean","title":"Dates Locked","default":false},"signed_off_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Off At"},"prior_job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Job Uuid Ref"},"prior_link_confirmed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Prior Link Confirmed"},"job_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Job Value"},"external_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"External Info"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"manager_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Uuid"},"manager_uuids":{"items":{"type":"string"},"type":"array","title":"Manager Uuids"},"managers":{"items":{"$ref":"#/components/schemas/JobManager"},"type":"array","title":"Managers"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"setup_inputs":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Setup Inputs"}},"type":"object","required":["job_uuid","job_code","job_name","job_type","status","financial_year","period","start_date","xpm_start_date","balance_date","is_zato","no_gl_source","coa_file_name","is_processing","is_ready_for_review","is_ready_for_signoff","prior_job_uuid_ref","prior_link_confirmed","job_value","external_info","created_at","updated_at"],"title":"JobDetail","description":"Detail-page payload. Fields below are always set by `router._detail`, so\nnullable ones are `T | None` (required + nullable). `is_xero_connected` and the\ntwo client fields are set post-construction on some paths, so they keep a default."},"JobDocumentOut":{"properties":{"parents":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parents"}},"additionalProperties":true,"type":"object","title":"JobDocumentOut","description":"`GET /coa/jobs/{uuid}/document` — the per-job COA document (parents +\nmapping[]). Engine-owned nested shape; ``parents`` is keyed by parent_key."},"JobGeneralLedgerResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"},"totals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Totals"}},"type":"object","required":["job_uuid","rows","total"],"title":"JobGeneralLedgerResponse","description":"A job's general-ledger rows with paging total + debit/credit footer totals."},"JobGstLedgerResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"},"totals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Totals"},"basis":{"type":"string","title":"Basis"},"job_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Basis"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},"type":"object","required":["job_uuid","rows","total","basis","start_date","end_date"],"title":"JobGstLedgerResponse","description":"A job's GST control-account ledger (period/date ordered) with basis metadata."},"JobManager":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["user_uuid"],"title":"JobManager","description":"One accountant assigned to a job (for the +N display / multi-select)."},"JobMappingItem":{"properties":{"zatoClientUuid":{"type":"string","title":"Zatoclientuuid","description":"Required. Zato client_uuid the imported XPM job is assigned to.","examples":["550e8400-e29b-41d4-a716-446655440000"]},"xpmJobXeroId":{"type":"string","title":"Xpmjobxeroid","description":"Required. XPM job's Xero UUID to import.","examples":["b2c3d4e5-f6a7-8901-bc23-de45fa678901"]},"jobData":{"additionalProperties":true,"type":"object","title":"Jobdata","description":"Optional. Cached XPM job fields (name, dates, FY) captured in the wizard so the import doesn't re-fetch."}},"type":"object","required":["zatoClientUuid","xpmJobXeroId"],"title":"JobMappingItem"},"JobMappingReadinessOut":{"properties":{"needs_type":{"type":"integer","title":"Needs Type"},"unmapped":{"type":"integer","title":"Unmapped"},"unapproved":{"type":"integer","title":"Unapproved"},"blocking":{"type":"boolean","title":"Blocking"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},"type":"object","required":["needs_type","unmapped","unapproved","blocking"],"title":"JobMappingReadinessOut","description":"`GET /coa/jobs/{uuid}/mapping-readiness` — client readiness + the resolved\n``client_uuid`` (null when the job has no client)."},"JobMappingRow":{"properties":{"fyi_job_id":{"type":"string","title":"Fyi Job Id"},"zato_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Job Uuid"},"zato_job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Job Name"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},"type":"object","required":["fyi_job_id"],"title":"JobMappingRow","description":"One folder-level FYI job → Zato job mapping."},"JobMappings":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/MappingRow"},"type":"array","title":"Mappings"},"accounts":{"items":{"$ref":"#/components/schemas/app__modules__wp_mapping__schemas__AccountOption"},"type":"array","title":"Accounts"},"uploaded_files":{"items":{"$ref":"#/components/schemas/UploadedFile"},"type":"array","title":"Uploaded Files"},"sections":{"items":{"$ref":"#/components/schemas/JobSection"},"type":"array","title":"Sections"}},"type":"object","title":"JobMappings"},"JobMappingsResponse":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/JobMappingRow"},"type":"array","title":"Mappings"}},"type":"object","required":["mappings"],"title":"JobMappingsResponse"},"JobOut":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_name":{"type":"string","title":"Job Name","default":""},"job_code":{"type":"string","title":"Job Code","default":""},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"coa_workflow_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Workflow Status"},"total_accounts":{"type":"integer","title":"Total Accounts","default":0},"mapped_count":{"type":"integer","title":"Mapped Count","default":0},"review_count":{"type":"integer","title":"Review Count","default":0},"tier4_count":{"type":"integer","title":"Tier4 Count","default":0},"based_on_master_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Based On Master Version"}},"type":"object","required":["job_uuid"],"title":"JobOut"},"JobPatchRequest":{"properties":{"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name","description":"New job display name.","examples":["FY24 Annual Accounts"]},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type","description":"New job-type slug (re-resolved to an FK).","examples":["Annual"]},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year","description":"New financial-year label.","examples":["2024"]},"job_value":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Job Value","description":"New job value (portal currency, non-negative). Follows the sign-off lock like every other field; each change is audit-logged (decision_events, before/after/actor).","examples":[2300]},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period","description":"New reporting-period label.","examples":["FY2024"]},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"New start date, ISO `YYYY-MM-DD` (422 if malformed).","examples":["2023-04-01"]},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date","description":"New balance date, ISO `YYYY-MM-DD` (422 if malformed). Editable only until the job's first automation run; when it changes, `financial_year` follows its year unless one is also supplied.","examples":["2024-03-31"]},"coa_file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa File Name","description":"Chart-of-accounts source file name.","examples":["coa.csv"]},"is_zato":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Zato","description":"Whether this is a Zato-managed job."},"is_processing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Processing","description":"Whether a background build is in progress."},"external_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"External Info","description":"Replacement free-form attributes blob (see JobCreateRequest.external_info).","examples":[{"balance_date":"2024-03-31"}]},"manager_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager Uuid","description":"UUID of the firm user to (re)assign the job to (the accountant picked on the edit screen). Persisted as a team_member_mappings row; silently skipped if it doesn't resolve to a firm user.","examples":["a1b2c3d4-e5f6-7890-1234-567890abcdef"]},"manager_uuids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Manager Uuids","description":"Full set of accountant UUIDs to (re)assign the job to — reconciles the whole set (adds/removes). `[]` unassigns everyone; omit to leave the assignment unchanged. Takes precedence over the singular `manager_uuid`.","examples":[["a1b2c3d4-e5f6-7890-1234-567890abcdef"]]},"is_deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Deleted","description":"Set true to soft-delete the job."}},"type":"object","title":"JobPatchRequest","description":"Partial update — EVERY field is optional; only the keys you send are applied\n(`exclude_none`). Omitting a field leaves it unchanged. A signed-off job rejects\ngeneric edits (only a director revoke re-opens it)."},"JobRef":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"}},"type":"object","required":["job_uuid"],"title":"JobRef","description":"A job a file is actively linked to — the grid's 'Linked jobs' column."},"JobReportsSummaryResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"documents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Documents"}},"type":"object","required":["job_uuid","documents"],"title":"JobReportsSummaryResponse","description":"Docs overview for a job — one summary row per financial document type."},"JobSection":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"section_index":{"type":"integer","title":"Section Index"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["wp_code","section_index"],"title":"JobSection","description":"An added (per-job) section instance for a template workpaper."},"JobSplitsResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"splits":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SplitLegInput"},"type":"array"},"type":"object","title":"Splits"}},"type":"object","required":["ac_job_uuid"],"title":"JobSplitsResponse","description":"ALL split legs for a run, keyed by bs_index (string, JSON-safe) — lets the results\ngrid render each split line's amount + account inline, not just a count chip."},"JobSummary":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"xpm_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xpm Start Date"},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date"},"is_zato":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Zato"},"no_gl_source":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"No Gl Source"},"can_view":{"type":"boolean","title":"Can View","default":false},"can_edit":{"type":"boolean","title":"Can Edit","default":false},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},"type":"object","required":["job_uuid","job_code","job_name","job_type","status","financial_year","period","start_date","xpm_start_date","balance_date","is_zato","no_gl_source"],"title":"JobSummary","description":"Row shape for the jobs grid.\n\nResponse model — the builder (`router._summary`) always sets these fields, so\nthe always-present nullable ones are typed `T | None` (required + nullable),\nnot `T | None = None` (which would wrongly mark them optional in Swagger).\nThe two exceptions keep a default and are documented inline."},"JobSummaryMetrics":{"properties":{"workpapers_count":{"type":"integer","title":"Workpapers Count"},"workpapers_reconciled":{"type":"integer","title":"Workpapers Reconciled"},"all_reconciled":{"type":"boolean","title":"All Reconciled"},"manual_journals_posted":{"type":"integer","title":"Manual Journals Posted"},"gl_criticals_ignored":{"type":"integer","title":"Gl Criticals Ignored"},"shareholder_salary_allocated":{"type":"number","title":"Shareholder Salary Allocated"}},"type":"object","required":["workpapers_count","workpapers_reconciled","all_reconciled","manual_journals_posted","gl_criticals_ignored","shareholder_salary_allocated"],"title":"JobSummaryMetrics","description":"Aggregated per-job metrics for the workpaper header \"Job Summary\" card.\n\nField names mirror Zato 1.0's GET /review/job_summary/{job_uuid} 1:1 so the\nported card UI maps without translation."},"JobWorkpaperItem":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"account_count":{"type":"integer","title":"Account Count"},"gl_balance":{"type":"number","title":"Gl Balance"},"section_type":{"type":"string","title":"Section Type","default":"Standard"},"runnable":{"type":"boolean","title":"Runnable","default":false},"reconciled":{"type":"boolean","title":"Reconciled","default":false},"wp_group":{"type":"string","title":"Wp Group","default":"Other"},"has_ui":{"type":"boolean","title":"Has Ui","default":false},"recon_status":{"type":"string","title":"Recon Status","default":"none"},"variance":{"type":"number","title":"Variance","default":0.0},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"}},"type":"object","required":["wp_code","wp_name","account_count","gl_balance"],"title":"JobWorkpaperItem","description":"One workpaper in the template, with this job's state."},"JournalCategoryItem":{"properties":{"journal_category_id":{"type":"integer","title":"Journal Category Id"},"journal_category_uuid":{"type":"string","title":"Journal Category Uuid"},"journal_category":{"type":"string","title":"Journal Category"}},"type":"object","required":["journal_category_id","journal_category_uuid","journal_category"],"title":"JournalCategoryItem"},"JournalCategoryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JournalCategoryItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JournalCategoryListResponse"},"JournalLineDetail":{"properties":{"line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line Id"},"account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"tax_rate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Rate"},"debit":{"type":"number","title":"Debit","default":0.0},"credit":{"type":"number","title":"Credit","default":0.0},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tracking":{"items":{"$ref":"#/components/schemas/TrackingTag-Output"},"type":"array","title":"Tracking"}},"type":"object","title":"JournalLineDetail","description":"One line as returned by the detail endpoint — shaped so the edit form can\nrepopulate directly (``account``/``tax_rate``/``debit``/``credit`` mirror\n``JournalLineItem``). ``debit``/``credit`` are split out of the stored signed\n``amount`` (amount > 0 → debit, amount < 0 → credit)."},"JournalSourceItem":{"properties":{"journal_source_id":{"type":"integer","title":"Journal Source Id"},"journal_source_uuid":{"type":"string","title":"Journal Source Uuid"},"journal_source":{"type":"string","title":"Journal Source"},"dropdown_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dropdown Type"}},"type":"object","required":["journal_source_id","journal_source_uuid","journal_source","dropdown_type"],"title":"JournalSourceItem"},"JournalSourceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JournalSourceItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JournalSourceListResponse"},"JournalTypeItem":{"properties":{"journal_type_id":{"type":"integer","title":"Journal Type Id"},"journal_type_uuid":{"type":"string","title":"Journal Type Uuid"},"journal_type":{"type":"string","title":"Journal Type"}},"type":"object","required":["journal_type_id","journal_type_uuid","journal_type"],"title":"JournalTypeItem"},"JournalTypeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JournalTypeItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JournalTypeListResponse"},"KbSeedOut":{"properties":{"seeded":{"type":"integer","title":"Seeded"},"skipped":{"type":"integer","title":"Skipped"},"total_rows":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Rows"},"scopes_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scopes Used"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"additionalProperties":true,"type":"object","required":["seeded","skipped"],"title":"KbSeedOut","description":"`POST /coa/knowledge-base/seed` — seeded/skipped counts (``message`` set\nwhen nothing was mappable). Extra keys pass through."},"KbStatsFirm":{"properties":{"total_rows":{"type":"integer","title":"Total Rows"},"top_firms":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Firms","default":[]}},"type":"object","required":["total_rows"],"title":"KbStatsFirm","description":"Per-firm KB (wp_parent_kb_firm) totals + the busiest firms."},"KbStatsGlobal":{"properties":{"embedded":{"type":"integer","title":"Embedded"},"pending":{"type":"integer","title":"Pending"},"sample":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sample","default":[]}},"type":"object","required":["embedded","pending"],"title":"KbStatsGlobal","description":"Global KB (wp_parent_kb) row counts + a small sample."},"KbStatsOut":{"properties":{"global_kb":{"$ref":"#/components/schemas/KbStatsGlobal"},"firm_kb":{"$ref":"#/components/schemas/KbStatsFirm"}},"type":"object","required":["global_kb","firm_kb"],"title":"KbStatsOut","description":"`GET /coa/knowledge-base/stats` — global + firm KB statistics."},"LatestTransactionSchema":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"amount":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"post_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Post Date"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","title":"LatestTransactionSchema","description":"The most recent transaction line for an account (for the Overview row)."},"LedgerChangeRow":{"properties":{"change_uuid":{"type":"string","title":"Change Uuid"},"origin":{"type":"string","title":"Origin","default":""},"method":{"type":"string","title":"Method","default":""},"from_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Code"},"to_code":{"type":"string","title":"To Code","default":""},"amount":{"type":"number","title":"Amount","default":0.0},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"artifact_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Kind"},"artifact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Id"},"status":{"type":"string","title":"Status","default":"applied"},"provider":{"type":"string","title":"Provider","default":"xero"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["change_uuid"],"title":"LedgerChangeRow","description":"One staged ledger change (a recode or autocoding push) — what we changed + its sync status."},"LedgerChangesResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"pending":{"type":"integer","title":"Pending","default":0},"changes":{"items":{"$ref":"#/components/schemas/LedgerChangeRow"},"type":"array","title":"Changes"}},"type":"object","required":["client_uuid"],"title":"LedgerChangesResponse"},"LedgerSlotFile":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["file_uuid"],"title":"LedgerSlotFile"},"LedgerSlotsResponse":{"properties":{"slots":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/LedgerSlotFile"},{"type":"null"}]},"type":"object","title":"Slots"}},"type":"object","required":["slots"],"title":"LedgerSlotsResponse"},"LifecycleIn":{"properties":{"action":{"type":"string","title":"Action","description":"Stage transition to apply. One of: move_to_ready_to_process | move_to_in_review | move_to_review_completed | mark_ready_for_review | revert_to_in_progress | mark_ready_for_signoff | revert_to_in_review. `move_to_ready_to_process` requires Trial Balance and Current Year GL present; `move_to_in_review` requires Processed with no open queries and no pending review points; `move_to_review_completed` requires In Review with every workpaper accepted. Each returns 409 when its gate fails.","examples":["move_to_in_review"]}},"type":"object","required":["action"],"title":"LifecycleIn"},"LineDTO":{"properties":{"section_key":{"type":"string","title":"Section Key"},"line_key":{"type":"string","title":"Line Key"},"label":{"type":"string","title":"Label"},"computed_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Computed Value"},"override_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Override Value"},"effective_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Effective Value"},"prior_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Prior Value"},"note_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note Ref"},"is_included":{"type":"boolean","title":"Is Included","default":true},"is_stale":{"type":"boolean","title":"Is Stale","default":false},"sort_order":{"type":"integer","title":"Sort Order","default":0},"provenance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provenance"},"group_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Override"},"sort_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Override"}},"type":"object","required":["section_key","line_key","label"],"title":"LineDTO"},"LineOverrideIn":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"New override value for the line. Optional partial update — omit to leave the computed value untouched; send null to clear a prior override.","examples":[12500.0]},"is_included":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Included","description":"Whether the line is shown in the report. Optional; omit to leave unchanged.","examples":[true]},"group_override":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Group Override","description":"Custom display group for the line — use 'Group :: Subgroup' for a two-level arrangement. Optional partial update — omit to leave unchanged; send null or an empty string to restore the classification group.","examples":["Trading Income :: Farm Gate Sales"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reviewer note recorded on the decision_events audit row for this override. Optional.","examples":["Reclassified per client instruction"]}},"type":"object","title":"LineOverrideIn","description":"Partial override of a single report line — every field is optional; send only what changes."},"LineSplitCountsResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["ac_job_uuid"],"title":"LineSplitCountsResponse","description":"Per-line split-leg counts for a run — lets the results grid show a \"Split · N\" chip on load\n(keys are bs_index as strings, JSON-safe)."},"LineSplitsResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"bs_index":{"type":"integer","title":"Bs Index"},"splits":{"items":{"$ref":"#/components/schemas/SplitLegInput"},"type":"array","title":"Splits"},"cleared":{"type":"boolean","title":"Cleared","default":false}},"type":"object","required":["ac_job_uuid","bs_index"],"title":"LineSplitsResponse"},"LineageDetailOut":{"properties":{"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","title":"LineageDetailOut","description":"Payload of the lineage routes — the traceable-value graph (``null`` when no doc)."},"LinesReorderIn":{"properties":{"line_keys":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Line Keys","description":"Every line_key of the section in the desired display order.","examples":[["revenue:200","revenue:210","cost_of_sales:310"]]}},"type":"object","required":["line_keys"],"title":"LinesReorderIn","description":"Full arrangement of one section's lines — positions persist as ``sort_override``."},"LinesReorderResult":{"properties":{"section_key":{"type":"string","title":"Section Key"},"updated":{"type":"integer","title":"Updated"}},"type":"object","required":["section_key","updated"],"title":"LinesReorderResult","description":"Docs model for the reorder ack — the section + how many rows were repositioned."},"LinkClientResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"}},"type":"object","required":["ac_job_uuid"],"title":"LinkClientResponse","description":"Ack for (re)linking a run to a client (PATCH .../client) — null clears the link."},"LinkFileRequest":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid","description":"Required. UUID of the job to attach this ZBox file to (must belong to your firm, else 422).","examples":["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]}},"type":"object","required":["job_uuid"],"title":"LinkFileRequest"},"LinkLiveAccepted":{"properties":{"linked":{"type":"integer","title":"Linked"},"already":{"type":"integer","title":"Already"},"batch_id":{"type":"string","title":"Batch Id"},"ingesting":{"type":"integer","title":"Ingesting","default":0},"skipped":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Skipped","default":[]}},"type":"object","required":["linked","already","batch_id"],"title":"LinkLiveAccepted"},"LinkLiveRequest":{"properties":{"provider":{"type":"string","title":"Provider","description":"Live provider key to pull from (must be a live integration, e.g. 'sharepoint', 'fyi').","examples":["sharepoint"]},"target_type":{"type":"string","title":"Target Type","description":"Where to attach the files — must be 'job' or 'client' (else 422).","examples":["job"]},"target_uuid":{"type":"string","title":"Target Uuid","description":"UUID of the target job or client (per `target_type`); must belong to your firm.","examples":["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]},"file_ids":{"items":{"type":"string"},"type":"array","title":"File Ids","description":"External file ids to link; provide `file_ids` and/or `folder_ids` (both empty links nothing).","default":[],"examples":[["01ABCDEFGHFILEID"]]},"folder_ids":{"items":{"type":"string"},"type":"array","title":"Folder Ids","description":"External folder ids — snapshots every file under them; provide `file_ids` and/or `folder_ids`.","default":[],"examples":[["01ABCDEFGHFOLDERID"]]},"files":{"items":{"$ref":"#/components/schemas/LiveFileMeta"},"type":"array","title":"Files","description":"Browse-time metadata for `file_ids` (real name/type) — for providers (e.g. FYI) that can't re-resolve a doc by id.","default":[]},"categorize":{"type":"boolean","title":"Categorize","description":"Also auto-categorize after ingest. False = quick link (pull + tag only).","default":true},"mapping_id_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mapping Id Ref","description":"Folder-mapping UUID when this link came from a resolved folder tag (the assist banner's confirm) — stamps rule-driven provenance so untag can cascade-unlink. Omit for a manual pick."}},"type":"object","required":["provider","target_type","target_uuid"],"title":"LinkLiveRequest","description":"Materialize-on-link a live provider's files/folders to a job or client."},"LinkNodeRequest":{"properties":{"provider":{"type":"string","title":"Provider","description":"Integration provider key whose folder files to link.","examples":["sharepoint"]},"folder_ids":{"items":{"type":"string"},"type":"array","title":"Folder Ids","description":"External folder-node ids; every file under them is linked.","examples":[["01ABCDEFGHFOLDERID"]]},"job_uuid":{"type":"string","title":"Job Uuid","description":"UUID of the firm-owned job to link the folder files to (422 if not yours).","examples":["b3f1c2d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]}},"type":"object","required":["provider","folder_ids","job_uuid"],"title":"LinkNodeRequest"},"LinkNodeResult":{"properties":{"linked":{"type":"integer","title":"Linked"},"already":{"type":"integer","title":"Already"}},"type":"object","required":["linked","already"],"title":"LinkNodeResult","description":"`POST /zbox/integrations/link` — counts of newly-linked / already-linked files\nmaterialized under the picked provider folders."},"LiveFileMeta":{"properties":{"id":{"type":"string","title":"Id","description":"External file id — must match an entry in the link request's `file_ids`.","examples":["01ABCDEFGHFILEID"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Id"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id","description":"FYI-specific: document version id for the S3 ingest + preview."},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"}},"type":"object","required":["id"],"title":"LiveFileMeta","description":"Browse-time metadata for a picked live file, carried through on link so the\nreal name/type is persisted. Some providers (FYI) can't re-resolve a single doc\nby id at link time, so the value known during browse is authoritative."},"LoginBeginRequest":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Optional. The user's email; informational for this step only — the backend does not require it to list providers.","examples":["director@acme.co.nz"]},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider","description":"Optional IdP filter: google|microsoft|apple|cognito. Omit to receive redirect URLs for every configured provider.","examples":["google"]}},"type":"object","title":"LoginBeginRequest","description":"Step-1 login discovery. Both fields are OPTIONAL — the frontend posts an\nempty body (`{}`) here to fetch the SSO provider URLs (or the 'password'\nsignal). The backend does not dereference these to list providers."},"LoginBeginResponse":{"properties":{"mode":{"type":"string","title":"Mode"},"urls":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Urls"}},"additionalProperties":true,"type":"object","required":["mode"],"title":"LoginBeginResponse","description":"`/auth/login` step-1 result: either ``mode='redirect'`` with per-provider\nhosted-UI URLs (Cognito enabled) or ``mode='password'`` (local flow)."},"LoginOtpStagedResponse":{"properties":{"mode":{"type":"string","title":"Mode"},"expires_in":{"type":"integer","title":"Expires In"},"email_hint":{"type":"string","title":"Email Hint"}},"type":"object","required":["mode","expires_in","email_hint"],"title":"LoginOtpStagedResponse","description":"Password / forced-new-password result: OTP has been staged (pre_session\ncookie set); the frontend proceeds to the OTP screen."},"LoginPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Required. Account email for the manual (email + password) login.","examples":["director@acme.co.nz"]},"password":{"type":"string","maxLength":255,"minLength":1,"title":"Password","description":"Required. The account password (validated against the app DB only — never Cognito).","examples":["S3cure!Passw0rd"]}},"type":"object","required":["email","password"],"title":"LoginPasswordRequest"},"LoginReminderRequest":{"properties":{"recipients":{"items":{"type":"string","format":"email"},"type":"array","minItems":1,"title":"Recipients","description":"Non-empty list of recipient emails to send the reminder to (required).","examples":[["partner@acmeaccounting.co.nz"]]},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message","description":"Reminder body text included in the email (required).","examples":["Please log in to complete your onboarding."]}},"type":"object","required":["recipients","message"],"title":"LoginReminderRequest"},"LoginReminderResponse":{"properties":{"sent":{"type":"integer","title":"Sent"},"failed":{"items":{"type":"string"},"type":"array","title":"Failed","default":[]},"total":{"type":"integer","title":"Total"}},"type":"object","required":["sent","total"],"title":"LoginReminderResponse"},"ManualCitation":{"properties":{"source_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Uri"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","title":"ManualCitation"},"ManualGlUploadResult":{"properties":{"which":{"type":"string","title":"Which"},"gl_year":{"title":"Gl Year"},"rows_inserted":{"type":"integer","title":"Rows Inserted"}},"type":"object","required":["which","gl_year","rows_inserted"],"title":"ManualGlUploadResult","description":"Result of a manual one-year GL upload (`POST .../manual-gl`)."},"ManualHit":{"properties":{"content":{"type":"string","title":"Content"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"citation":{"$ref":"#/components/schemas/ManualCitation"}},"type":"object","required":["content","citation"],"title":"ManualHit"},"ManualJournalCreateResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"manual_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manual Journal Id"},"status":{"type":"string","title":"Status"},"validation_issues":{"items":{"type":"string"},"type":"array","title":"Validation Issues"},"attachment_count":{"type":"integer","title":"Attachment Count","default":0}},"type":"object","required":["manual_journal_uuid","manual_journal_id","status"],"title":"ManualJournalCreateResponse"},"ManualJournalDetailResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"manual_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manual Journal Id"},"source_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Source Id"},"journal_type":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Journal Type"},"journal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Name"},"narration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narration"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"auto_reversing_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Reversing Date"},"show_journal_on_cash_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Show Journal On Cash Basis"},"line_amount_types":{"type":"string","title":"Line Amount Types","default":"Inclusive"},"default_narration_to_journal_line":{"type":"boolean","title":"Default Narration To Journal Line","default":false},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name"},"partner_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Journal Id"},"partner_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Sync Status"},"needs_partner_sync":{"type":"boolean","title":"Needs Partner Sync","default":false},"reversal_of_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reversal Of Uuid"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"lines":{"items":{"$ref":"#/components/schemas/JournalLineDetail"},"type":"array","title":"Lines"},"attachments":{"items":{"$ref":"#/components/schemas/MjAttachment"},"type":"array","title":"Attachments"}},"type":"object","required":["manual_journal_uuid","manual_journal_id"],"title":"ManualJournalDetailResponse","description":"A single manual journal — header + every line — for the detail/edit view."},"ManualJournalListItem":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"manual_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manual Journal Id"},"narration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narration"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name"},"total_debit":{"type":"number","title":"Total Debit","default":0.0},"total_credit":{"type":"number","title":"Total Credit","default":0.0},"partner_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Journal Id"},"partner_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Sync Status"},"needs_partner_sync":{"type":"boolean","title":"Needs Partner Sync","default":false},"needs_local_sync":{"type":"boolean","title":"Needs Local Sync","default":false},"last_sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync Error"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["manual_journal_uuid","manual_journal_id","narration","date","status","source"],"title":"ManualJournalListItem","description":"One row in the job's manual-journal list (header + computed totals)."},"ManualJournalListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ManualJournalListItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ManualJournalListResponse"},"ManualJournalUpdateResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"manual_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manual Journal Id"},"status":{"type":"string","title":"Status"},"validation_issues":{"items":{"type":"string"},"type":"array","title":"Validation Issues"},"needs_partner_sync":{"type":"boolean","title":"Needs Partner Sync","default":false}},"type":"object","required":["manual_journal_uuid","manual_journal_id","status"],"title":"ManualJournalUpdateResponse"},"ManualRevisionStatus":{"properties":{"revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revision Id"},"ctag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ctag"},"content_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Hash"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"kb_ingestion_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Ingestion Job Id"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","title":"ManualRevisionStatus","description":"Latest KB revision metadata (the ``latest_revision`` row) — every field is\noptional because the route returns ``{}`` when no revision exists yet. Docs-only\n(the handler returns the raw repo dict); extra keys pass through."},"MapJobsRequest":{"properties":{"jobMappings":{"items":{"$ref":"#/components/schemas/JobMappingItem"},"type":"array","title":"Jobmappings","description":"Required. XPM jobs to import and assign to Zato clients."},"replace_fy_conflicts":{"type":"boolean","title":"Replace Fy Conflicts","description":"Optional (defaults to false). When true, a job whose financial year already exists on the client replaces the existing job (set after the user resolves the conflict in the UI).","default":false,"examples":[false]}},"type":"object","required":["jobMappings"],"title":"MapJobsRequest"},"MapJobsResult":{"properties":{"linked":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Linked"},"conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conflicts"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors"}},"type":"object","required":["linked","conflicts","errors"],"title":"MapJobsResult","description":"Result of importing XPM jobs: linked jobs, FY conflicts, and per-job errors."},"MappedFolder":{"properties":{"provider":{"type":"string","title":"Provider"},"folder_id":{"type":"string","title":"Folder Id"},"label":{"type":"string","title":"Label"},"kind":{"type":"string","enum":["client_folder","job_folder"],"title":"Kind"},"target_uuid":{"type":"string","title":"Target Uuid"},"fiscal_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"type":"string","enum":["manual","auto_exact","auto_fuzzy","auto_ai"],"title":"Origin","default":"manual"},"mapping_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mapping Uuid"},"linked_count":{"type":"integer","title":"Linked Count","default":0}},"type":"object","required":["provider","folder_id","label","kind","target_uuid"],"title":"MappedFolder","description":"One provider folder tagged to a client/job, as an entry point on the\nentity's ZBox screen. `linked_count` is the live number of files this folder's\ntag has linked (active `zbox_links`); the browser opens rooted at `folder_id`."},"MappedFoldersResponse":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/MappedFolder"},"type":"array","title":"Folders"}},"type":"object","required":["folders"],"title":"MappedFoldersResponse","description":"Provider folders mapped to one entity — its ZBox entry points (Phase 4 L1)."},"MappingItem":{"properties":{"zato_job_uuid":{"type":"string","title":"Zato Job Uuid","description":"Target Zato job UUID the FYI folder maps to. Required — persisted as the mapping's target_uuid_ref.","examples":["9b2c1d4e-5f6a-4b8c-9d0e-1a2b3c4d5e6f"]},"zato_client_uuid":{"type":"string","title":"Zato Client Uuid","description":"Zato client UUID the job belongs to (wizard context; not persisted by the folder-mapping write).","examples":["b1d4c7e2-3f6a-4b8c-9d0e-1a2b3c4d5e6f"]},"fyi_entity_id":{"type":"string","title":"Fyi Entity Id","description":"FYI entity id the job sits under (wizard context; not persisted by the folder-mapping write).","examples":["12345"]},"fyi_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fyi Job Id","description":"FYI job/folder id to link. Optional: a row without it is skipped (no mapping written).","examples":["67890"]}},"type":"object","required":["zato_job_uuid","zato_client_uuid","fyi_entity_id"],"title":"MappingItem","description":"One job-level FYI→Zato link (from the mapping wizard save)."},"MappingReadinessOut":{"properties":{"needs_type":{"type":"integer","title":"Needs Type"},"unmapped":{"type":"integer","title":"Unmapped"},"unapproved":{"type":"integer","title":"Unapproved"},"blocking":{"type":"boolean","title":"Blocking"}},"type":"object","required":["needs_type","unmapped","unapproved","blocking"],"title":"MappingReadinessOut","description":"Client COA-mapping readiness counts."},"MappingRow":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"section_index":{"type":"integer","title":"Section Index"},"parent_key":{"type":"string","title":"Parent Key"},"account_uuid_ref":{"type":"string","title":"Account Uuid Ref"}},"type":"object","required":["wp_code","section_index","parent_key","account_uuid_ref"],"title":"MappingRow"},"MarkLineQueryRequest":{"properties":{"query_uuid":{"type":"string","title":"Query Uuid","description":"UUID of the client query raised for this line.","examples":["q1a2b3c4-5678-90ab-cdef-1234567890ab"]}},"type":"object","required":["query_uuid"],"title":"MarkLineQueryRequest","description":"Record the client query raised for one result line (by bs_index)."},"MarkLineQueryResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"bs_index":{"type":"integer","title":"Bs Index"},"query_uuid_ref":{"type":"string","title":"Query Uuid Ref"}},"type":"object","required":["ac_job_uuid","bs_index","query_uuid_ref"],"title":"MarkLineQueryResponse","description":"Ack for linking a client query to a result line (POST .../lines/{bs}/query)."},"MarkReadOut":{"properties":{"notification_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Uuid"},"unread_count":{"type":"integer","title":"Unread Count"}},"type":"object","required":["unread_count"],"title":"MarkReadOut"},"MarkReadResult":{"properties":{"workpaper_code":{"type":"string","title":"Workpaper Code"},"marked":{"type":"integer","title":"Marked","default":0}},"type":"object","required":["workpaper_code"],"title":"MarkReadResult","description":"`mark_as_read` ack — `marked` is how many of the WP's notes were touched for\nthe current reader."},"MasterConfigOut":{"properties":{"version":{"type":"string","title":"Version"},"parents":{"additionalProperties":true,"type":"object","title":"Parents"}},"type":"object","required":["version","parents"],"title":"MasterConfigOut"},"MasterGroup":{"properties":{"questionnaire_group_id":{"type":"integer","title":"Questionnaire Group Id"},"questionnaire_group_uuid":{"type":"string","title":"Questionnaire Group Uuid"},"questionnaire_group_name":{"type":"string","title":"Questionnaire Group Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"}},"type":"object","required":["questionnaire_group_id","questionnaire_group_uuid","questionnaire_group_name"],"title":"MasterGroup"},"MeResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"firm_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Firm Id"},"firm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Uuid"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"user_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Type"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"eligible_personas":{"items":{"type":"string"},"type":"array","title":"Eligible Personas"},"eligible_memberships":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Eligible Memberships"},"portal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal"},"role":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Role"},"navigation_flags":{"additionalProperties":true,"type":"object","title":"Navigation Flags"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"setup_complete":{"type":"boolean","title":"Setup Complete"},"onboarding_completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Onboarding Completed At"},"session":{"$ref":"#/components/schemas/MeSessionSettings"}},"additionalProperties":true,"type":"object","required":["user_id","email","avatar_url","firm_id","firm_uuid","firm_name","user_type","persona_id","eligible_personas","eligible_memberships","portal","role","navigation_flags","permissions","provider","client_uuid","client_name","setup_complete","session"],"title":"MeResponse","description":"The authenticated user's full session context (`/auth/me`)."},"MeSessionSettings":{"properties":{"idle_warn_seconds":{"type":"integer","title":"Idle Warn Seconds"},"max_seconds":{"type":"integer","title":"Max Seconds"},"extend_allowed":{"type":"boolean","title":"Extend Allowed"}},"type":"object","required":["idle_warn_seconds","max_seconds","extend_allowed"],"title":"MeSessionSettings","description":"Session-lifetime hints the frontend SessionWatcher reads."},"MemoryActivityEvent":{"properties":{"event_uuid":{"type":"string","title":"Event Uuid"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"verb":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verb"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"actor_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Label"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","required":["event_uuid","at","verb","summary","actor_label","client_uuid","client_name","job_uuid","job_name","payload"],"title":"MemoryActivityEvent","description":"One activity-log event with denormalised client/job labels\n(``tools.get_activity`` / ``tools.list_recent_actions`` → ``_activity_dict``)."},"MemoryClientDetail":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Code"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"branch_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Branch Id Ref"}},"type":"object","required":["client_uuid","client_name","client_code","status","email","ird_number","branch_id_ref"],"title":"MemoryClientDetail","description":"Live client detail (``tools.get_client`` → ``_client_dict``)."},"MemoryJobDetail":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"status_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Id Ref"},"job_type_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Type Id Ref"},"client_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id Ref"}},"type":"object","required":["job_uuid","job_name","job_code","period","status_id_ref","job_type_id_ref","client_id_ref"],"title":"MemoryJobDetail","description":"Live job detail (``tools.get_job`` → ``_job_dict``)."},"MentionUser":{"properties":{"user_id":{"type":"integer","title":"User Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["user_id"],"title":"MentionUser"},"MessageDetailOut":{"properties":{"message_uuid":{"type":"string","title":"Message Uuid"},"firm_uuid_ref":{"type":"string","title":"Firm Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"tier":{"type":"string","title":"Tier"},"template_kind":{"type":"string","title":"Template Kind"},"message_category":{"type":"string","title":"Message Category"},"recipient_email_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email Hash"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"status":{"type":"string","title":"Status"},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"attempts":{"type":"integer","title":"Attempts"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Queued At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"events":{"items":{"$ref":"#/components/schemas/DeliveryEventOut"},"type":"array","title":"Events"}},"type":"object","required":["message_uuid","firm_uuid_ref","tier","template_kind","message_category","status","attempts"],"title":"MessageDetailOut"},"MessageListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MessageOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"MessageListResponse","description":"A page of delivery-log rows plus the count in this page."},"MessageOut":{"properties":{"message_uuid":{"type":"string","title":"Message Uuid"},"firm_uuid_ref":{"type":"string","title":"Firm Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"tier":{"type":"string","title":"Tier"},"template_kind":{"type":"string","title":"Template Kind"},"message_category":{"type":"string","title":"Message Category"},"recipient_email_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email Hash"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"status":{"type":"string","title":"Status"},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"attempts":{"type":"integer","title":"Attempts"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"queued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Queued At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["message_uuid","firm_uuid_ref","tier","template_kind","message_category","status","attempts"],"title":"MessageOut"},"Meta":{"properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","title":"Meta","description":"Envelope metadata. `message` is the backend-owned user-facing success line;\n`request_id` echoes the correlation id stamped by RequestContextMiddleware."},"MissingAccount":{"properties":{"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_code_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code Reference"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"is_pl":{"type":"boolean","title":"Is Pl","default":false}},"type":"object","title":"MissingAccount"},"MjAttachment":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"file_extension":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Extension"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["file_uuid","file_name"],"title":"MjAttachment","description":"One supporting file attached to a manual journal (a ZBox file back-linked via\n``manual_journal_uuid_ref``). Metadata only — the browser fetches the bytes via the\nZBox ``/files/{file_uuid}/view-url`` (presigned) or ``/stream`` route."},"MoveFileSectionIn":{"properties":{"section_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Key","description":"Stable section identity from the config DTO (`acc:<account_uuid>` / `inst:<wp>:<n>` / `par:<parent_key>` / `single:main`) to place the file into. Null (or omitted) moves the file back to the workpaper base ('available'). Nullable by design — send null to un-place a file.","examples":["inst:TLN:1"]},"section_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section Index","description":"Legacy render-index placement, accepted for backward-compat with older clients only. Ignored server-side; `section_key` is the authority and wins when both are sent.","examples":[1]}},"type":"object","title":"MoveFileSectionIn","description":"Lift-and-shift a file into a workpaper section (null ``section_key`` = back to the WP base/'available').\n\n``section_key`` is the stable section identity from the config DTO (``acc:<uuid>`` / ``inst:<wp>:<n>`` / …),\nso the placement is account-pinned. ``section_index`` is accepted for backward-compat (older clients) but the\nkey wins when both are sent."},"MyOrgListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/MyOrgRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"MyOrgListResponse"},"MyOrgRow":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"open_count":{"type":"integer","title":"Open Count"},"in_progress_count":{"type":"integer","title":"In Progress Count"},"has_org_request":{"type":"boolean","title":"Has Org Request"}},"type":"object","required":["firm_uuid","firm_name","open_count","in_progress_count","has_org_request"],"title":"MyOrgRow"},"NavigationCard":{"properties":{"action_name":{"type":"string","title":"Action Name"},"title":{"type":"string","title":"Title"},"label":{"type":"string","title":"Label"},"route":{"type":"string","title":"Route"},"values":{"additionalProperties":{"type":"string"},"type":"object","title":"Values"}},"type":"object","required":["action_name","title","label","route"],"title":"NavigationCard","description":"Fallback for a write the user can't execute in-chat: name where to send them\n(the page/component) to do it themselves. Used only when no executable\n``ActionCard`` could be built (unknown action / missing permission)."},"NoteDeleteResult":{"properties":{"note_uuid":{"type":"string","title":"Note Uuid"},"file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Uuid"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["note_uuid"],"title":"NoteDeleteResult","description":"`delete_note` ack. `file_uuid` is present only when a single attachment was\nremoved (a whole-note soft-delete omits it); `deleted` is always true on success."},"NoteFile":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["file_uuid"],"title":"NoteFile"},"NoteOut":{"properties":{"note_uuid":{"type":"string","title":"Note Uuid"},"workpaper_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Code"},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name"},"cell_field_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cell Field Id"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"created_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"visitors":{"items":{"$ref":"#/components/schemas/NoteVisitor"},"type":"array","title":"Visitors","default":[]},"note_files":{"items":{"$ref":"#/components/schemas/NoteFile"},"type":"array","title":"Note Files","default":[]},"is_pinned":{"type":"boolean","title":"Is Pinned","default":false},"is_tagged":{"type":"boolean","title":"Is Tagged","default":false},"tagged_user_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tagged User Id Ref"},"follow_up_point_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Follow Up Point Id"},"is_review_note_status":{"type":"boolean","title":"Is Review Note Status","default":false}},"type":"object","required":["note_uuid"],"title":"NoteOut"},"NoteVisitor":{"properties":{"user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"},"is_read":{"type":"boolean","title":"Is Read","default":false}},"type":"object","title":"NoteVisitor"},"NotesListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WorkpaperNotes"},"type":"array","title":"Data","default":[]},"total_notes":{"type":"integer","title":"Total Notes","default":0},"total_workpapers":{"type":"integer","title":"Total Workpapers","default":0}},"type":"object","title":"NotesListOut","description":"`get_by_workpaper` response: grouped by WP, with job-wide totals."},"NotificationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NotificationOut"},"type":"array","title":"Items"},"unread_count":{"type":"integer","title":"Unread Count"},"next_before_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Before Id"}},"type":"object","required":["items","unread_count"],"title":"NotificationListResponse"},"NotificationOut":{"properties":{"notification_uuid":{"type":"string","title":"Notification Uuid"},"kind":{"type":"string","title":"Kind"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"title":{"type":"string","title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"deep_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deep Link"},"action_required":{"type":"boolean","title":"Action Required","default":false},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["notification_uuid","kind","title","created_at"],"title":"NotificationOut"},"OkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["ok"],"title":"OkResponse","description":"Generic success ack."},"OneDriveCredentialsRequest":{"properties":{"ONEDRIVE_TENANT_ID":{"type":"string","maxLength":128,"minLength":1,"title":"Onedrive Tenant Id","description":"Azure AD tenant (directory) ID for the app-only (client-credentials) flow. Required.","examples":["9f4c2e1a-3b7d-4e5f-8a1b-2c3d4e5f6a7b"]},"ONEDRIVE_CLIENT_ID":{"type":"string","maxLength":128,"minLength":1,"title":"Onedrive Client Id","description":"Azure app registration (client) ID. Required.","examples":["1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"]},"ONEDRIVE_CLIENT_SECRET":{"type":"string","title":"Onedrive Client Secret","description":"Azure client secret. Required on first connect; on RE-connect leave blank to keep the already-stored secret (the GET never echoes it back).","default":"","examples":["Xy8Q~aBcD1efGhIjKlMnOpQrStUvWxYz0123abcd"]},"ONEDRIVE_DRIVE_ID":{"type":"string","title":"Onedrive Drive Id","description":"A specific OneDrive drive id to read. Provide EITHER this OR ONEDRIVE_DRIVE_USER (at least one is required); a drive id overrides the drive user.","default":"","examples":["b!AbCdEfGhIjKlMnOpQrStUvWxYz0123456789"]},"ONEDRIVE_DRIVE_USER":{"type":"string","title":"Onedrive Drive User","description":"A user UPN or object-id whose OneDrive to read. Provide EITHER this OR ONEDRIVE_DRIVE_ID (at least one is required).","default":"","examples":["user@contoso.onmicrosoft.com"]}},"type":"object","required":["ONEDRIVE_TENANT_ID","ONEDRIVE_CLIENT_ID"],"title":"OneDriveCredentialsRequest","description":"Connect payload entered in the ZIP portal. App-only (client-credentials) flow.\n\nProvide ONE of DRIVE_ID / DRIVE_USER (the drive to read). On RE-connect the\nsecret may be left blank to keep the saved one (the GET never returns the\nplaintext secret, so the form can't echo it back)."},"OpeningBalanceResolution":{"properties":{"method":{"type":"string","title":"Method"},"opening_rows_inserted":{"type":"integer","title":"Opening Rows Inserted"},"imported_from_tb":{"type":"integer","title":"Imported From Tb","default":0},"file_uuid":{"type":"string","title":"File Uuid"}},"type":"object","required":["method","opening_rows_inserted","file_uuid"],"title":"OpeningBalanceResolution"},"OpeningBalanceStatus":{"properties":{"status":{"type":"string","title":"Status"},"has_opening":{"type":"boolean","title":"Has Opening"},"opening_row_count":{"type":"integer","title":"Opening Row Count","default":0},"account_count":{"type":"integer","title":"Account Count","default":0},"missing_accounts":{"items":{"$ref":"#/components/schemas/MissingAccount"},"type":"array","title":"Missing Accounts","default":[]},"gl_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Year"},"prior_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Year"},"prior_tb_available":{"type":"boolean","title":"Prior Tb Available","default":false}},"type":"object","required":["status","has_opening"],"title":"OpeningBalanceStatus","description":"Opening-balance assessment for an uploaded GL file."},"OptionCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Display name for the new option. Required, non-empty, and unique within the category (case-insensitive).","examples":["North"]}},"type":"object","required":["name"],"title":"OptionCreate"},"OptionPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New option name (rename). Omit to leave unchanged; must stay unique within the category.","examples":["South"]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Set false to archive the option, true to restore. Omit to leave unchanged.","examples":[true]}},"type":"object","title":"OptionPatch","description":"Partial update — send only the field(s) to change; omit the rest."},"OrgSupportDetail":{"properties":{"firm_uuid":{"type":"string","title":"Firm Uuid"},"firm_name":{"type":"string","title":"Firm Name"},"can_modify":{"type":"boolean","title":"Can Modify"},"request_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Uuid"},"request_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Type"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"assignee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Email"},"assignee_user_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Uuid"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"events":{"items":{"$ref":"#/components/schemas/SupportRequestEventRow"},"type":"array","title":"Events"}},"type":"object","required":["firm_uuid","firm_name","can_modify","request_uuid","request_type","status","assignee_email","assignee_user_uuid","owner_name","owner_email","events"],"title":"OrgSupportDetail"},"OrganisationsResponse":{"properties":{"organisations":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Organisations"},"connected":{"type":"boolean","title":"Connected","default":true}},"type":"object","required":["organisations"],"title":"OrganisationsResponse","description":"ORGANISATION tenants accessible via the Xero GL token."},"OwnershipEventOut":{"properties":{"event_type":{"type":"string","title":"Event Type"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"to_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Email"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["event_type"],"title":"OwnershipEventOut"},"ParticipantOut":{"properties":{"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_original":{"type":"boolean","title":"Is Original"},"invited_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invited By Email"}},"type":"object","required":["email","is_original"],"title":"ParticipantOut"},"PartnerAddRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Partner's full name (required).","examples":["Jane Director"]},"email":{"type":"string","format":"email","title":"Email","description":"Partner login email; 409 if it already exists (required).","examples":["jane@acmeaccounting.co.nz"]},"role_level":{"type":"integer","enum":[1,2,3,4,5,6],"title":"Role Level","description":"Practice role level 1-6 (1=Admin, 2=Jr Accountant, 3=KFT Outsource, 4=Accountant, 5=Manager, 6=Director) (required).","examples":[4]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional mobile (E.164); validated server-side.","examples":["+64211234567"]}},"type":"object","required":["name","email","role_level"],"title":"PartnerAddRequest"},"PartnerAddResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"role_name":{"type":"string","title":"Role Name"},"role_level":{"type":"integer","title":"Role Level"},"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email","role_name","role_level","invitation_email_sent"],"title":"PartnerAddResponse"},"PartnerAttachmentOut":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"}},"type":"object","required":["file_uuid"],"title":"PartnerAttachmentOut"},"PartnerBatchFile":{"properties":{"file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Uuid"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"file_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Index"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"},"zbox_file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zbox File Uuid"},"registered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registered At"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","title":"PartnerBatchFile","description":"One file's status inside an upload batch (see ``batch_status``)."},"PartnerBatchStatus":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"},"file_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Count"},"registered_count":{"type":"integer","title":"Registered Count"},"files":{"items":{"$ref":"#/components/schemas/PartnerBatchFile"},"type":"array","title":"Files"}},"type":"object","required":["batch_id","registered_count"],"title":"PartnerBatchStatus","description":"Upload-batch status envelope-body (see ``batch_status``)."},"PartnerClientList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PartnerClientOut"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["page","page_size","total"],"title":"PartnerClientList","description":"Paginated envelope-body for the clients listing."},"PartnerClientOut":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"ird_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ird Number"},"business_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Structure"},"balance_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Date"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["client_uuid"],"title":"PartnerClientOut","description":"A firm client as exposed by the partner API (see ``_client_out``). Carries\n0..N dynamic ``<provider>_tenant_uuid`` keys, so extra keys are allowed."},"PartnerClientsResponse":{"properties":{"clients":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clients"}},"type":"object","required":["clients"],"title":"PartnerClientsResponse","description":"A client list (Xero-connected Zato clients, or XPM practice clients)."},"PartnerCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Partner's full name (required).","examples":["Jane Director"]},"email":{"type":"string","format":"email","title":"Email","description":"Partner login email; must be unique across all users (required).","examples":["jane@acmeaccounting.co.nz"]},"role_level":{"type":"integer","enum":[1,2,3,4,5,6],"title":"Role Level","description":"Practice role level 1-6 (1=Admin, 2=Jr Accountant, 3=KFT Outsource, 4=Accountant, 5=Manager, 6=Director) (required).","examples":[6]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional mobile (E.164); validated server-side.","examples":["+64211234567"]},"branch_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Branch Index","description":"Optional 0-based index into this request's `branches` list, assigning the partner to that branch.","examples":[0]}},"type":"object","required":["name","email","role_level"],"title":"PartnerCreate","description":"One row of the legacy partners table on the Add-Practice modal."},"PartnerInvitationResult":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"role_name":{"type":"string","title":"Role Name"},"role_level":{"type":"integer","title":"Role Level"},"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email","role_name","role_level","invitation_email_sent"],"title":"PartnerInvitationResult"},"PartnerJobList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PartnerJobOut"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["page","page_size","total"],"title":"PartnerJobList","description":"Paginated envelope-body for the jobs listings."},"PartnerJobOut":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"status_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Id Ref"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"assignees":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Assignees"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["job_uuid"],"title":"PartnerJobOut","description":"A firm job as exposed by the partner API (see ``_job_out``). Carries 0..N\ndynamic ``<provider>_tenant_uuid`` keys, so extra keys are allowed."},"PartnerJobsResponse":{"properties":{"jobs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"PartnerJobsResponse","description":"An XPM job list (wizard jobs, synced jobs, or per-client jobs)."},"PartnerQueryDetail":{"properties":{"query_uuid":{"type":"string","title":"Query Uuid"},"query_type":{"type":"string","title":"Query Type"},"description":{"type":"string","title":"Description"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"},"is_resolved":{"type":"boolean","title":"Is Resolved"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"},"message_count":{"type":"integer","title":"Message Count","default":0},"last_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message"},"last_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"responses":{"items":{"$ref":"#/components/schemas/PartnerQueryResponseOut"},"type":"array","title":"Responses"}},"type":"object","required":["query_uuid","query_type","description","is_resolved"],"title":"PartnerQueryDetail"},"PartnerQueryList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PartnerQueryOut"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["page","page_size","total"],"title":"PartnerQueryList","description":"Paginated envelope-body for the queries listing."},"PartnerQueryOut":{"properties":{"query_uuid":{"type":"string","title":"Query Uuid"},"query_type":{"type":"string","title":"Query Type"},"description":{"type":"string","title":"Description"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"},"is_resolved":{"type":"boolean","title":"Is Resolved"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"},"message_count":{"type":"integer","title":"Message Count","default":0},"last_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message"},"last_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["query_uuid","query_type","description","is_resolved"],"title":"PartnerQueryOut"},"PartnerQueryResponseOut":{"properties":{"response_uuid":{"type":"string","title":"Response Uuid"},"kind":{"type":"string","title":"Kind"},"body":{"type":"string","title":"Body"},"is_client_visible":{"type":"boolean","title":"Is Client Visible"},"responded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Responded By"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"attachments":{"items":{"$ref":"#/components/schemas/PartnerAttachmentOut"},"type":"array","title":"Attachments"}},"type":"object","required":["response_uuid","kind","body","is_client_visible"],"title":"PartnerQueryResponseOut"},"PartnerUserList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PartnerUserOut"},"type":"array","title":"Items"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["page","page_size","total"],"title":"PartnerUserList","description":"Paginated envelope-body for the users listing."},"PartnerUserOut":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["user_uuid","is_active"],"title":"PartnerUserOut","description":"A firm user as exposed by the partner API (see ``_user_out``)."},"PendingChangesOut":{"properties":{"has_pending":{"type":"boolean","title":"Has Pending"},"gl":{"additionalProperties":true,"type":"object","title":"Gl"},"coa_changed":{"title":"Coa Changed"},"files_changed":{"title":"Files Changed"},"affected_wps":{"title":"Affected Wps"},"structure_delta":{"title":"Structure Delta"},"head_version":{"title":"Head Version"},"draft_version":{"title":"Draft Version"},"reason_per_wp":{"title":"Reason Per Wp"},"extraction_inflight":{"title":"Extraction Inflight"}},"additionalProperties":true,"type":"object","required":["has_pending"],"title":"PendingChangesOut","description":"Payload of ``GET /jobs/{job}/pending`` — what a Run would pick up right now."},"PendingColumnsResponse":{"properties":{"candidates":{"items":{"type":"string"},"type":"array","title":"Candidates"}},"type":"object","title":"PendingColumnsResponse","description":"Unrecognized manual-GL upload columns staged for a client that aren't tagged\nas tracking categories yet — the drawer surfaces these to tag."},"PendingMappingItem":{"properties":{"request_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Uuid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Uuid"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"predicted_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Parent Key"},"predicted_parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Parent Name"},"current_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Parent Key"},"is_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Approved"},"needs_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Review"},"similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"},"confidence_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Tier"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"applied_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applied At"}},"additionalProperties":true,"type":"object","title":"PendingMappingItem","description":"One `GET .../pending-mappings` review row. Extra keys pass through."},"PendingMappingsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PendingMappingItem"},"type":"array","title":"Items"},"pending_count":{"type":"integer","title":"Pending Count"},"all_done":{"type":"boolean","title":"All Done"}},"type":"object","required":["items","pending_count","all_done"],"title":"PendingMappingsResponse","description":"`GET /coa/clients/{uuid}/pending-mappings` — the review grid + counts."},"PermissionRefItem":{"properties":{"level":{"type":"integer","title":"Level"},"role":{"type":"string","title":"Role"},"responsibility":{"type":"string","title":"Responsibility"}},"type":"object","required":["level","role","responsibility"],"title":"PermissionRefItem","description":"One row of the static permissions reference catalog (role level → summary)."},"PermissionsReferenceResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PermissionRefItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"PermissionsReferenceResponse","description":"Payload for the Tab 2 permissions reference panel (`{\"items\": [...]}`)."},"PersonaMeResponse":{"properties":{"active_persona":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Persona"},"eligible_personas":{"items":{"type":"string"},"type":"array","title":"Eligible Personas"},"navigation_manifest":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Navigation Manifest"},"nav_items":{"additionalProperties":true,"type":"object","title":"Nav Items"},"dashboard_manifest":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dashboard Manifest"},"theme_tokens":{"additionalProperties":true,"type":"object","title":"Theme Tokens"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"},"policy_caps":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Policy Caps"},"landing_route":{"type":"string","title":"Landing Route"}},"type":"object","required":["active_persona","eligible_personas","navigation_manifest","nav_items","theme_tokens","capabilities","landing_route"],"title":"PersonaMeResponse"},"PlanTask":{"properties":{"id":{"type":"string","title":"Id","description":"Stable id of this sub-task (referenced by depends_on + waves).","examples":["t1"]},"goal":{"type":"string","title":"Goal","description":"What this sub-task set out to do.","examples":["List the client's open jobs"]},"depends_on":{"items":{"type":"string"},"type":"array","title":"Depends On","description":"Ids of sub-tasks that must finish first."},"status":{"type":"string","title":"Status","description":"Sub-task outcome: 'done' or 'failed'.","default":"done"}},"type":"object","required":["id","goal"],"title":"PlanTask","description":"One sub-task in a multi-step plan Ziffy ran (read-only data gathering)."},"PlanView":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/PlanTask"},"type":"array","title":"Tasks","description":"The plan's sub-tasks."},"waves":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","title":"Waves","description":"Execution waves: each inner list is task ids that ran in parallel; waves ran in order."}},"type":"object","title":"PlanView","description":"The plan Ziffy executed for a complex question: the sub-tasks + the execution\nwaves. Each wave's task ids ran in parallel; waves ran in order."},"PostToXeroResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"partner_journal_id":{"type":"string","title":"Partner Journal Id"},"partner_sync_status":{"type":"string","title":"Partner Sync Status"}},"type":"object","required":["manual_journal_uuid","partner_journal_id","partner_sync_status"],"title":"PostToXeroResponse"},"PpmGlAssistOut":{"properties":{"has_matches":{"type":"boolean","title":"Has Matches","default":false},"matched_accounts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Matched Accounts"},"transactions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transactions"},"prepayment_types":{"items":{"type":"string"},"type":"array","title":"Prepayment Types"},"notification":{"type":"string","title":"Notification","default":""}},"type":"object","title":"PpmGlAssistOut","description":"Payload of ``GET /jobs/{job}/ppm/gl-assist`` — the PPM GL-based method's candidate accounts.\n\n``has_matches`` gates the frontend Yes/No notification (``notification`` carries the ATO-rules\nprompt string). ``matched_accounts`` are the keyword-matched Expense accounts; ``transactions`` are\ntheir pickable GL lines (each tagged with its account + a suggested category); ``prepayment_types``\nis the five-category list the picker offers. Nested rows stay loose (engine-shaped)."},"PrepareClientCopyRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"client_uuid the questionnaire is being customized for.","examples":["9c2f1a7b-3d4e-5f60-7182-93a4b5c6d7e8"]},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year","description":"Financial year of the client copy to create/edit.","examples":["2025-2026"]},"clone_from":{"type":"string","title":"Clone From","description":"Seed a brand-new copy from the current 'firm' template or from the client's 'prior_year' customized copy of the same template.","default":"firm","examples":["firm","prior_year"]}},"type":"object","required":["client_uuid"],"title":"PrepareClientCopyRequest"},"PreviewIn":{"properties":{"definition":{"$ref":"#/components/schemas/WorkpaperDefinition","description":"The candidate definition to compute in memory (never touches a stored job doc)."},"sample_rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sample Rows","description":"Optional sample rows merged into the FIRST table before compute, to see formulas light up.","examples":[[{"amount":1200,"description":"Prepaid insurance"}]]}},"type":"object","required":["definition"],"title":"PreviewIn"},"PreviewOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"section":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Section"},"issues":{"items":{"$ref":"#/components/schemas/ValidationIssue"},"type":"array","title":"Issues"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ok"],"title":"PreviewOut"},"PriorDocOut":{"properties":{"doc":{"additionalProperties":true,"type":"object","title":"Doc"},"prior_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Job Uuid"}},"type":"object","title":"PriorDocOut","description":"Payload of ``GET /{job}/prior-doc`` — the linked prior-year job's doc."},"PriorLinkRequest":{"properties":{"prior_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Job Uuid","description":"Prior-year job UUID to link this job to. Must be a DIFFERENT job for the SAME client. Send `null` (or omit) to CLEAR/unlink the prior-year link; send a uuid to confirm/set it.","examples":["b7c1e2d3-4f5a-6789-abcd-ef0123456789"]}},"type":"object","title":"PriorLinkRequest","description":"Confirm / change (set a uuid) / clear (null) a job's prior-year link."},"PriorSuggestionResponse":{"properties":{"suggested_job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Job Uuid"},"confidence":{"type":"number","title":"Confidence"},"reason":{"type":"string","title":"Reason"},"prior_financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Financial Year"},"requires_confirmation":{"type":"boolean","title":"Requires Confirmation"}},"type":"object","required":["suggested_job_uuid","confidence","reason","prior_financial_year","requires_confirmation"],"title":"PriorSuggestionResponse","description":"Confidence-scored prior-year job suggestion (`PriorSuggestion.as_dict()`).\nNever auto-linked — the UI confirms when `requires_confirmation` is true."},"PriorYearSettingsResponse":{"properties":{"auto_link_enabled":{"type":"boolean","title":"Auto Link Enabled"},"auto_link_threshold":{"type":"number","title":"Auto Link Threshold"},"block_sign_off_on_comparatives":{"type":"boolean","title":"Block Sign Off On Comparatives"}},"type":"object","required":["auto_link_enabled","auto_link_threshold","block_sign_off_on_comparatives"],"title":"PriorYearSettingsResponse","description":"Firm-level Prior Year config as returned by the settings endpoints — mirrors\nthe dict from `PracticeService.get_prior_year_settings`."},"ProviderTreeNode":{"properties":{"key":{"type":"string","title":"Key"},"kind":{"type":"string","title":"Kind"},"label":{"type":"string","title":"Label"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Id"},"has_children":{"type":"boolean","title":"Has Children","default":false},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"tag":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tag"},"structural_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structural Role"},"structural_assumed":{"type":"boolean","title":"Structural Assumed","default":false},"children":{"items":{"$ref":"#/components/schemas/ProviderTreeNode"},"type":"array","title":"Children","default":[]}},"type":"object","required":["key","kind","label"],"title":"ProviderTreeNode","description":"A node in the Integration Browser tree (provider root or folder). Lazy:\n`children` is empty until the FE expands the node and fetches one level via\n/integrations/folder; `has_children` advertises whether it CAN expand."},"PublishedReportDetailResponse":{"properties":{"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"report_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Name"},"report_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Type"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"fields":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Fields"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"from_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Date"},"to_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Date"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"net_gst":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Net Gst"}},"additionalProperties":true,"type":"object","title":"PublishedReportDetailResponse","description":"One published report by ReportID — normalised rows merged with shaped GST fields.\n\nKeys vary by report shape (BAS uses ``rows``; GST uses ``fields``), so extra\nkeys are allowed."},"PublishedReportsResponse":{"properties":{"reports":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reports"}},"type":"object","required":["reports"],"title":"PublishedReportsResponse","description":"List of published Xero reports (BAS / GST statements) for the picker."},"QueryCreateIn":{"properties":{"query_type":{"type":"string","title":"Query Type"},"description":{"type":"string","minLength":1,"title":"Description"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"source_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Key"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"},"is_client_visible":{"type":"boolean","title":"Is Client Visible","default":false},"is_auto_generated":{"type":"boolean","title":"Is Auto Generated","default":false},"is_batch_query":{"type":"boolean","title":"Is Batch Query","default":false}},"type":"object","required":["query_type","description"],"title":"QueryCreateIn"},"QueryListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/QueryOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"QueryListOut"},"QueryOut":{"properties":{"query_uuid":{"type":"string","title":"Query Uuid"},"query_type":{"type":"string","title":"Query Type"},"firm_id_ref":{"type":"integer","title":"Firm Id Ref"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"source_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Source Id Ref"},"source_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Key"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"},"description":{"type":"string","title":"Description"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year"},"group_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Uuid"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"is_client_visible":{"type":"boolean","title":"Is Client Visible"},"is_auto_generated":{"type":"boolean","title":"Is Auto Generated"},"is_batch_query":{"type":"boolean","title":"Is Batch Query"},"is_pushed_batch_query":{"type":"boolean","title":"Is Pushed Batch Query"},"is_ignored":{"type":"boolean","title":"Is Ignored"},"is_resolved":{"type":"boolean","title":"Is Resolved"},"client_responded":{"type":"boolean","title":"Client Responded","default":false},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"investigator_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Investigator Uuid Ref"},"investigator_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Investigator Name"},"investigation_assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Investigation Assigned At"},"response_json":{"additionalProperties":true,"type":"object","title":"Response Json"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["query_uuid","query_type","firm_id_ref","source_id_ref","sub_context","description","is_client_visible","is_auto_generated","is_batch_query","is_pushed_batch_query","is_ignored","is_resolved","resolved_at","created_at","updated_at"],"title":"QueryOut"},"QueryPatchIn":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_client_visible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Client Visible"},"query_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Type"},"sub_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Context"}},"type":"object","title":"QueryPatchIn"},"QuerySourceOut":{"properties":{"source_id":{"type":"integer","title":"Source Id"},"source_key":{"type":"string","title":"Source Key"},"label":{"type":"string","title":"Label"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["source_id","source_key","label","is_active"],"title":"QuerySourceOut"},"QueryTemplatesInfo":{"properties":{"country":{"type":"string","title":"Country"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"found":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Found"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"workpapers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Workpapers"}},"additionalProperties":true,"type":"object","required":["country"],"title":"QueryTemplatesInfo","description":"Static per-workpaper client query (PBC) templates reference. The shape\nvaries: without a wp_code it's a compact index (``count`` + ``workpapers``);\nwith one it's that workpaper's template(s) (``found`` + template fields).\nDocs-only — extra entry keys pass through."},"QuestionnaireFileUploadOut":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"original_filename":{"type":"string","title":"Original Filename"}},"type":"object","required":["file_uuid","original_filename"],"title":"QuestionnaireFileUploadOut","description":"Ack for a questionnaire answer-file upload (the stored file's id + name)."},"RawStatusResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"is_connected":{"type":"boolean","title":"Is Connected"},"xero_tenant_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xero Tenant Uuid"},"expected_resource_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Resource Total"},"resources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Resources"}},"additionalProperties":true,"type":"object","required":["client_uuid","is_connected"],"title":"RawStatusResponse","description":"Per-resource raw-import watermark for a client's bound tenant.\n\n``xero_tenant_uuid`` / ``expected_resource_total`` are present only when the\nclient is connected; ``resources`` is one dict per synced resource cursor."},"ReassignRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Display name of the new owner; set as current_owner_name unconditionally.","examples":["John Doe"]},"email":{"type":"string","title":"Email","description":"Email of the person to hand ownership to; a brand-new participant is created and emailed a fresh magic link.","examples":["new.owner@clientco.com"]}},"type":"object","required":["name","email"],"title":"ReassignRequest"},"RecallHit":{"properties":{"kind":{"type":"string","title":"Kind"},"event_uuid":{"type":"string","title":"Event Uuid"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"verb":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verb"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"score":{"type":"number","title":"Score"},"matched":{"items":{"type":"string"},"type":"array","title":"Matched"}},"type":"object","required":["kind","event_uuid","at","verb","summary","stage","client_uuid","job_uuid","trace_id","confidence","score","matched"],"title":"RecallHit","description":"One fused, scored recall pointer with its red/green/blue stage and matched\nlegs (``recall._hit`` fields + the ``score``/``matched`` added by ``recall._fuse``).\n``matched`` lists the legs that surfaced this hit (explainability)."},"RecallLogEntry":{"properties":{"recall_uuid":{"type":"string","title":"Recall Uuid"},"at":{"type":"string","format":"date-time","title":"At"},"actor_user_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Actor User Id Ref"},"actor_kind":{"type":"string","title":"Actor Kind"},"grain":{"type":"string","title":"Grain"},"query_text":{"type":"string","title":"Query Text"},"mode":{"type":"string","title":"Mode"},"k":{"type":"integer","title":"K"},"result_count":{"type":"integer","title":"Result Count"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"}},"type":"object","required":["recall_uuid","at","actor_user_id_ref","actor_kind","grain","query_text","mode","k","result_count","latency_ms","trace_id"],"title":"RecallLogEntry","description":"One retrieval-audit row (``recall.list_recall_log`` — mirrors\n``memory_recall_log`` columns selected by the query)."},"RecallResult":{"properties":{"recall_uuid":{"type":"string","title":"Recall Uuid"},"query":{"type":"string","title":"Query"},"grain":{"type":"string","title":"Grain"},"mode":{"type":"string","title":"Mode"},"hits":{"items":{"$ref":"#/components/schemas/RecallHit"},"type":"array","title":"Hits"}},"type":"object","required":["recall_uuid","query","grain","mode","hits"],"title":"RecallResult","description":"The hybrid recall result envelope payload (``recall.recall``)."},"RecentErrorOut":{"properties":{"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","title":"RecentErrorOut"},"RecentErrorsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecentErrorOut"},"type":"array","title":"Items"},"source":{"type":"string","title":"Source"},"precision":{"type":"string","title":"Precision","default":"job"}},"type":"object","required":["items","source"],"title":"RecentErrorsResponse"},"RecipientFormResponse":{"properties":{"invitation_uuid":{"type":"string","title":"Invitation Uuid"},"questionnaire_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Questionnaire Title"},"status":{"type":"string","title":"Status"},"role":{"type":"string","title":"Role"},"can_edit":{"type":"boolean","title":"Can Edit"},"can_reclaim":{"type":"boolean","title":"Can Reclaim","default":true},"can_reassign":{"type":"boolean","title":"Can Reassign","default":true},"current_owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Owner Email"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections","default":[]}},"type":"object","required":["invitation_uuid","status","role","can_edit"],"title":"RecipientFormResponse"},"RecipientUploadResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"original_filename":{"type":"string","title":"Original Filename"}},"type":"object","required":["file_uuid","original_filename"],"title":"RecipientUploadResponse"},"RecodeBatchRow":{"properties":{"recode_batch_id":{"type":"integer","title":"Recode Batch Id"},"to_code":{"type":"string","title":"To Code"},"requested":{"type":"integer","title":"Requested","default":0},"recoded":{"type":"integer","title":"Recoded","default":0},"failed":{"type":"integer","title":"Failed","default":0},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["recode_batch_id","to_code"],"title":"RecodeBatchRow"},"RecodeBulkItem":{"properties":{"bs_index":{"type":"integer","title":"Bs Index","description":"0-based bank-statement line index to recode.","examples":[3]},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code","description":"Target account code; null/blank clears the line.","examples":["4000"]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional per-line note (defaults to 'Recoded').","examples":["Recoded"]}},"type":"object","required":["bs_index"],"title":"RecodeBulkItem"},"RecodeBulkRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/RecodeBulkItem"},"type":"array","title":"Lines","description":"Lines to recode; an empty list is a no-op."}},"type":"object","title":"RecodeBulkRequest","description":"Recode MANY lines in one request (bulk/multi-apply) — one round-trip, one metric recompute."},"RecodeBulkResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"updated":{"type":"integer","title":"Updated","default":0},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"}},"type":"object","required":["ac_job_uuid"],"title":"RecodeBulkResponse","description":"Ack for a bulk recode (POST .../recode-bulk) — count updated + recomputed metrics."},"RecodeHistoryResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"batches":{"items":{"$ref":"#/components/schemas/RecodeBatchRow"},"type":"array","title":"Batches"}},"type":"object","required":["client_uuid"],"title":"RecodeHistoryResponse"},"RecodeLineInput":{"properties":{"account_code":{"type":"string","minLength":1,"title":"Account Code","description":"REQUIRED. The line's CURRENT (source) account — the bare code to move away from.","examples":["453"]},"net":{"type":"number","title":"Net","description":"REQUIRED. Signed net to move (debit − credit); the amount this recode reclassifies.","examples":[125.5]},"source_id":{"type":"string","title":"Source Id","description":"The original transaction's id — the recode-at-source target. Required for a method='source' at-source edit (with source_type); omit to force a journal.","default":"","examples":["a1b2c3d4-0000-1111-2222-333344445555"]},"source_type":{"type":"string","title":"Source Type","description":"The source document kind — ACCREC | ACCPAY | SPEND | RECEIVE | MANJOURNAL | …. Paired with source_id to edit at source; omit to force a journal.","default":"","examples":["ACCPAY"]},"description":{"type":"string","title":"Description","description":"Optional line description (kept for journals).","default":""},"contact":{"type":"string","title":"Contact","description":"Optional contact name (kept for journals).","default":"","examples":["Acme Supplies Ltd"]},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Optional line date, YYYY-MM-DD.","examples":["2026-03-31"]}},"type":"object","required":["account_code","net"],"title":"RecodeLineInput","description":"One posted line to reclassify. Carries the source-transaction reference so recode-at-source\nedits the ORIGINAL document by id (no heuristic match); the net/contact are kept for journals."},"RecodeLineResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"bs_index":{"type":"integer","title":"Bs Index"},"updated":{"type":"boolean","title":"Updated","default":false},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"}},"type":"object","required":["ac_job_uuid","bs_index"],"title":"RecodeLineResponse","description":"Ack for a single-line recode (PUT .../lines/{bs}/recode) — with recomputed metrics."},"RecodeResultResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"to_code":{"type":"string","title":"To Code","default":""},"recoded":{"type":"integer","title":"Recoded","default":0},"recoded_at_source":{"type":"integer","title":"Recoded At Source","default":0},"recoded_via_journal":{"type":"integer","title":"Recoded Via Journal","default":0},"failed":{"type":"integer","title":"Failed","default":0},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors"}},"type":"object","required":["client_uuid"],"title":"RecodeResultResponse"},"RecodingAccount":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name","default":""}},"type":"object","required":["code"],"title":"RecodingAccount"},"RecodingFilterOptions":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"connected":{"type":"boolean","title":"Connected","default":true},"accounts":{"items":{"$ref":"#/components/schemas/RecodingAccount"},"type":"array","title":"Accounts"},"contacts":{"items":{"type":"string"},"type":"array","title":"Contacts"},"date_min":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Min"},"date_max":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Max"}},"type":"object","required":["client_uuid"],"title":"RecodingFilterOptions","description":"Server-rendered filter facets over the FULL ledger (not the loaded page) — drives the\naccount dropdown, contact suggestions, and date bounds before any transactions are loaded."},"RecodingTransactionsResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"connected":{"type":"boolean","title":"Connected","default":true},"total":{"type":"integer","title":"Total","default":0},"rows":{"items":{"$ref":"#/components/schemas/RecodingTxnRow"},"type":"array","title":"Rows"},"accounts":{"items":{"$ref":"#/components/schemas/RecodingAccount"},"type":"array","title":"Accounts"}},"type":"object","required":["client_uuid"],"title":"RecodingTransactionsResponse"},"RecodingTxnRow":{"properties":{"id":{"type":"integer","title":"Id"},"date":{"type":"string","title":"Date","default":""},"account_code":{"type":"string","title":"Account Code","default":""},"account_name":{"type":"string","title":"Account Name","default":""},"account_type":{"type":"string","title":"Account Type","default":""},"description":{"type":"string","title":"Description","default":""},"reference":{"type":"string","title":"Reference","default":""},"contact":{"type":"string","title":"Contact","default":""},"debit":{"type":"number","title":"Debit","default":0.0},"credit":{"type":"number","title":"Credit","default":0.0},"net":{"type":"number","title":"Net","default":0.0},"source_id":{"type":"string","title":"Source Id","default":""},"source_type":{"type":"string","title":"Source Type","default":""},"recodable":{"type":"boolean","title":"Recodable","default":true},"recode_block_reason":{"type":"string","title":"Recode Block Reason","default":""},"source_editable":{"type":"boolean","title":"Source Editable","default":true},"source_block_reason":{"type":"string","title":"Source Block Reason","default":""},"pending":{"type":"boolean","title":"Pending","default":false},"pending_to_code":{"type":"string","title":"Pending To Code","default":""}},"type":"object","required":["id"],"title":"RecodingTxnRow"},"ReferenceInWpRequest":{"properties":{"to_wp":{"type":"string","title":"To Wp","description":"Target workpaper code to reference the file INTO (the file also stays on its home WP). Required.","examples":["ACP"]}},"type":"object","required":["to_wp"],"title":"ReferenceInWpRequest","description":"Reference a file into another workpaper (drag A→B) — the file stays on its home WP too."},"ReferenceResult":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"to_wp":{"type":"string","title":"To Wp"},"referenced":{"type":"boolean","title":"Referenced"}},"type":"object","required":["file_uuid","to_wp","referenced"],"title":"ReferenceResult","description":"Ack for referencing a file into another workpaper (the file stays on its home WP too)."},"RefreshApplyRequest":{"properties":{"accept_question_uuids":{"items":{"type":"string"},"type":"array","title":"Accept Question Uuids","description":"Master question_uuids of the deltas the firm accepts (the rest are rejected). Ignored when accept_all=true.","examples":[["a1b2c3d4-0000-0000-0000-000000000001"]]},"accept_all":{"type":"boolean","title":"Accept All","description":"Accept every master delta; when true accept_question_uuids is not needed.","default":false}},"type":"object","title":"RefreshApplyRequest"},"RefreshApplyResult":{"properties":{"applied":{"type":"integer","title":"Applied"}},"type":"object","required":["applied"],"title":"RefreshApplyResult"},"RefreshDiff":{"properties":{"entity_questionnaire_group_uuid":{"type":"string","title":"Entity Questionnaire Group Uuid"},"deltas":{"items":{"$ref":"#/components/schemas/RefreshQuestionDelta"},"type":"array","title":"Deltas","default":[]}},"type":"object","required":["entity_questionnaire_group_uuid"],"title":"RefreshDiff"},"RefreshQuestionDelta":{"properties":{"change_type":{"type":"string","title":"Change Type"},"question_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Uuid"},"section_name":{"type":"string","title":"Section Name"},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"After"}},"type":"object","required":["change_type","section_name"],"title":"RefreshQuestionDelta"},"RefreshSessionResponse":{"properties":{"persona":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Persona"},"role":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Role"},"portal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal"},"navigation_flags":{"additionalProperties":true,"type":"object","title":"Navigation Flags"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"landing_route":{"type":"string","title":"Landing Route"}},"additionalProperties":true,"type":"object","required":["persona","role","portal","navigation_flags","permissions","landing_route"],"title":"RefreshSessionResponse","description":"Re-hydrated session context returned by `/auth/refresh` (the rotated\naccess/refresh tokens ride in httpOnly cookies, not the body)."},"RefreshedResponse":{"properties":{"refreshed":{"type":"boolean","title":"Refreshed"}},"type":"object","required":["refreshed"],"title":"RefreshedResponse","description":"Ack for a forced token refresh."},"RegenerateTokenOut":{"properties":{"integration_token":{"type":"string","title":"Integration Token"}},"type":"object","required":["integration_token"],"title":"RegenerateTokenOut"},"ReloadOut":{"properties":{"published":{"type":"integer","title":"Published"}},"type":"object","required":["published"],"title":"ReloadOut"},"RemapGlRequest":{"properties":{"section_key":{"type":"string","title":"Section Key","description":"Target section's stable placement key. Must resolve to a COA parent (``par:<parent_key>``) to be a valid GL re-map target. Required.","examples":["par:RENT"]}},"type":"object","required":["section_key"],"title":"RemapGlRequest","description":"Re-map a GL account to a section's COA parent (a chart_of_accounts.parent_id change). ``section_key`` is\nthe target section's stable key (``par:<parent_key>``)."},"RemapGlResult":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"parent_key":{"type":"string","title":"Parent Key"},"wp_code":{"type":"string","title":"Wp Code"},"remapped":{"type":"boolean","title":"Remapped"}},"type":"object","required":["account_uuid","parent_key","wp_code","remapped"],"title":"RemapGlResult","description":"Ack for re-mapping a GL account to a section's COA parent (a real ``parent_id`` change)."},"RemoveClientsFromGroupRequest":{"properties":{"client_uuids":{"items":{"type":"string"},"type":"array","title":"Client Uuids","description":"client_uuids to remove from the group (clears their group_id_ref). Required; each must belong to the caller's firm.","examples":[["a1b2c3d4-1111-2222-3333-444455556666"]]}},"type":"object","required":["client_uuids"],"title":"RemoveClientsFromGroupRequest"},"RemoveSectionOut":{"properties":{"removed":{"items":{"type":"string"},"type":"array","title":"Removed"}},"type":"object","required":["removed"],"title":"RemoveSectionOut","description":"`DELETE .../parents/{parent_key}` — the numbered instance keys removed."},"RemovedResponse":{"properties":{"removed":{"type":"boolean","title":"Removed"}},"type":"object","required":["removed"],"title":"RemovedResponse","description":"Ack for a delete/disconnect — `removed` is false when there was nothing to remove."},"RenameGroupRequest":{"properties":{"name":{"type":"string","title":"Name","description":"New template name (non-blank).","examples":["FY26 Annual Accounts Checklist"]}},"type":"object","required":["name"],"title":"RenameGroupRequest"},"RenameSectionIn":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New display name for the section. Partial-update PATCH: optional by design — omit to leave the current name unchanged.","examples":["Directors' Loan"]},"section_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Key","description":"Stable section identity (`acc:<account_uuid>` / `par:<parent_key>` / `single:main` / `inst:<wp>:<n>`) from the config DTO. When present and NOT an `inst:` key, the rename is persisted by key onto the workpaper-view doc (so a derived per-account or per-parent heading can be renamed); omitted (or an `inst:` key) uses the legacy URL `section_index` path. Nullable for backward-compat.","examples":["acc:3f9a5c1e-2b44-4d1a-9c77-0a1b2c3d4e5f"]}},"type":"object","title":"RenameSectionIn","description":"Partial-update PATCH — rename ANY section's display name; identity, placements and mappings\nare preserved."},"ReopenRequest":{"properties":{"preserve_answers":{"type":"boolean","title":"Preserve Answers","description":"Keep the recipient's saved answers when reopening; set false to clear all answers on reopen.","default":true}},"type":"object","title":"ReopenRequest"},"ReportData":{"properties":{"report":{"$ref":"#/components/schemas/ReportSummary"},"sections":{"items":{"$ref":"#/components/schemas/SectionDTO"},"type":"array","title":"Sections","default":[]},"ai_notes":{"items":{"$ref":"#/components/schemas/AiNoteDTO"},"type":"array","title":"Ai Notes","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]}},"type":"object","required":["report"],"title":"ReportData"},"ReportListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportSummary"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ReportListResponse","description":"Docs wrapper for ``GET /reporting/jobs/{job_uuid}/reports`` — the ``{\"items\": [...]}`` payload."},"ReportSummary":{"properties":{"report_uuid":{"type":"string","title":"Report Uuid"},"job_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid Ref"},"client_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid Ref"},"template_key":{"type":"string","title":"Template Key"},"template_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Version"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"balance_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Balance Ok"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"has_output":{"type":"boolean","title":"Has Output","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["report_uuid","template_key","status"],"title":"ReportSummary"},"ReportVersionsResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"report_type":{"type":"string","title":"Report Type"},"versions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Versions"}},"type":"object","required":["job_uuid","report_type","versions"],"title":"ReportVersionsResponse","description":"All snapshot versions of a report for a job, newest first."},"RequestOtpRequest":{"properties":{"token":{"type":"string","title":"Token","description":"Raw magic-link token from the invitation email; hashed and resolved to a participant unguarded (401 if invalid).","examples":["3f9a1c7e2b8d4056a1c7e2b8d4056a1c"]}},"type":"object","required":["token"],"title":"RequestOtpRequest"},"RequestOtpResponse":{"properties":{"pre_session_token":{"type":"string","title":"Pre Session Token"},"masked_email":{"type":"string","title":"Masked Email"},"dev_mode":{"type":"boolean","title":"Dev Mode","default":false}},"type":"object","required":["pre_session_token","masked_email"],"title":"RequestOtpResponse"},"ResetClientMappingsOut":{"properties":{"reset":{"type":"boolean","title":"Reset"},"client_uuid":{"type":"string","title":"Client Uuid"},"accounts_cleared":{"type":"integer","title":"Accounts Cleared"}},"type":"object","required":["reset","client_uuid","accounts_cleared"],"title":"ResetClientMappingsOut","description":"`POST /coa/clients/{uuid}/reset-mappings` — mappings wiped + row count."},"ResetCoaFileOut":{"properties":{"file_cleared":{"type":"boolean","title":"File Cleared"},"accounts_deleted":{"type":"integer","title":"Accounts Deleted"},"mappings_removed":{"type":"integer","title":"Mappings Removed"},"instances_removed":{"type":"integer","title":"Instances Removed","default":0},"jobs_reset":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Jobs Reset"}},"type":"object","required":["file_cleared","accounts_deleted","mappings_removed"],"title":"ResetCoaFileOut","description":"`DELETE /coa/clients/{uuid}/coa-file` — reset counts + the per-job cascade\noutcomes (present when a manual chart was actually cleared)."},"ResetJobOut":{"properties":{"removed":{"additionalProperties":{"type":"integer"},"type":"object","title":"Removed"}},"type":"object","title":"ResetJobOut","description":"Payload of ``DELETE /jobs/{job}/reset`` — per-target removed/affected row counts."},"ResetPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Required. The account email being reset.","examples":["director@acme.co.nz"]},"code":{"type":"string","maxLength":16,"minLength":4,"title":"Code","description":"Required. The reset code emailed by the forgot-password step.","examples":["482913"]},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password","description":"Required. The new password (8-128 chars).","examples":["N3w!Secur3Pass"]}},"type":"object","required":["email","code","new_password"],"title":"ResetPasswordRequest"},"ResetPasswordResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"sent":{"type":"boolean","title":"Sent"}},"type":"object","required":["user_uuid","email","sent"],"title":"ResetPasswordResponse"},"ResetTbOut":{"properties":{"deleted":{"type":"integer","title":"Deleted"},"untagged":{"type":"boolean","title":"Untagged"}},"type":"object","required":["deleted","untagged"],"title":"ResetTbOut","description":"`POST /coa/jobs/{uuid}/tb/reset` — rows deleted + whether a slot file untagged."},"ResetThresholdsRequest":{"properties":{"keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Keys","description":"Optional. Leaf paths to selectively reset ('section/leaf' for GL, 'code' for WP); only those rows re-inherit the parent default. Omit the whole field to reset the entire scope override.","examples":[["gl_code_materiality_thresholds/transactional_threshold"]]}},"type":"object","title":"ResetThresholdsRequest","description":"Optional body on a reset (DELETE). ``keys`` are leaf paths (\"section/leaf\"\nfor GL, \"code\" for WP); when present only those rows re-inherit the default,\nwhen omitted the whole scope override is reset."},"ResetWpThresholdsRequest":{"properties":{"keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Keys","description":"Optional. Leaf paths (WP codes) to selectively reset — only those rows re-inherit the default. Omit (or send no body) to reset the entire scope override.","examples":[["FIA","DEP"]]}},"type":"object","title":"ResetWpThresholdsRequest","description":"Optional body on a reset (DELETE). ``keys`` are leaf paths (WP codes); when\npresent only those rows re-inherit the default, when omitted the whole scope\noverride is reset."},"ResolveAccountTypeIn":{"properties":{"account_type_id":{"type":"integer","minimum":1.0,"title":"Account Type Id","description":"REQUIRED. Zato account-type id to assign to the account (pick from GET /coa/account-types).","examples":[12]},"apply_to_token":{"type":"boolean","title":"Apply To Token","description":"When true (default), teach the provider token→type map and re-resolve sibling accounts sharing the same token.","default":true,"examples":[true]}},"type":"object","required":["account_type_id"],"title":"ResolveAccountTypeIn"},"ResolveAccountTypeOut":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"account_type_id":{"type":"integer","title":"Account Type Id"},"zato_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Account Type"},"review_status":{"type":"string","title":"Review Status"},"siblings_updated":{"type":"integer","title":"Siblings Updated"},"types_complete":{"type":"boolean","title":"Types Complete"},"firm_propagation_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Propagation Run Id"}},"type":"object","required":["account_uuid","account_type_id","review_status","siblings_updated","types_complete"],"title":"ResolveAccountTypeOut","description":"`PUT .../accounts/{uuid}/account-type` — the resolved type + whether all\naccount types for the client are now complete (frontend's automap cue)."},"ResolveOpeningRequest":{"properties":{"method":{"type":"string","title":"Method","description":"Required. How to fill missing opening rows. 'zero' opens every missing account at 0; 'import_tb' opens balance-sheet accounts at the prior-year trial-balance closing (P&L always 0). Any other value is rejected (422/validation).","examples":["zero","import_tb"]}},"type":"object","required":["method"],"title":"ResolveOpeningRequest"},"ResolveRequestPayload":{"properties":{"resolution_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Note","description":"Optional free-text note recorded when resolving the request. May be omitted entirely — the resolve endpoint accepts an empty body.","examples":["Fixed the failing Xero sync and confirmed with the client."]}},"type":"object","title":"ResolveRequestPayload"},"ResolvedTarget":{"properties":{"kind":{"type":"string","enum":["client_folder","job_folder"],"title":"Kind"},"target_type":{"type":"string","title":"Target Type"},"target_uuid":{"type":"string","title":"Target Uuid"},"target_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Label"},"fiscal_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fiscal Year"},"matched_folder_id":{"type":"string","title":"Matched Folder Id"},"matched_folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Folder Label"},"inherited":{"type":"boolean","title":"Inherited","default":false},"mapping_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mapping Uuid"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},"type":"object","required":["kind","target_type","target_uuid","matched_folder_id"],"title":"ResolvedTarget","description":"The Zato client/job a folder resolves to — its OWN active tag, else the\nnearest tagged ancestor. `mapping_uuid` lets a link created from this resolution\nstamp `zbox_links.mapping_id_ref` (honest provenance + cascade-unlink)."},"ResplitDocumentEntry":{"properties":{"page_range":{"type":"string","title":"Page Range","description":"A desired document's page range within the bunch, e.g. '1-2'. Required per entry.","examples":["1-2"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Category for this entry (one of GET /categories). Defaults to 'Others'.","examples":["Bank Statement"]},"supplier_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier Name","description":"Supplier name for this entry. Optional.","examples":["Acme Ltd"]}},"type":"object","required":["page_range"],"title":"ResplitDocumentEntry"},"ResplitRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ResplitDocumentEntry"},"type":"array","title":"Documents","description":"The bunch's desired documents. The backend merges overlaps and gap-fills uncovered pages into 'Others' remainders, so the result is always a complete partition of pages 1..N. An empty list resets the bunch to a single 'Others' document."}},"type":"object","title":"ResplitRequest"},"ResponseCreateIn":{"properties":{"body":{"type":"string","minLength":1,"title":"Body"},"kind":{"type":"string","title":"Kind","default":"comment"},"is_client_visible":{"type":"boolean","title":"Is Client Visible","default":false}},"type":"object","required":["body"],"title":"ResponseCreateIn"},"ResponseListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ResponseOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ResponseListOut","description":"``GET /queries/{uuid}/responses`` payload — a query's thread messages."},"ResponseOut":{"properties":{"response_uuid":{"type":"string","title":"Response Uuid"},"query_id_ref":{"type":"integer","title":"Query Id Ref"},"author_uuid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Uuid Ref"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"kind":{"type":"string","title":"Kind"},"body":{"type":"string","title":"Body"},"is_client_visible":{"type":"boolean","title":"Is Client Visible"},"is_internal":{"type":"boolean","title":"Is Internal","default":false},"is_deleted":{"type":"boolean","title":"Is Deleted"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["response_uuid","query_id_ref","kind","body","is_client_visible","is_deleted","created_at","updated_at"],"title":"ResponseOut"},"ResponsePatchIn":{"properties":{"body":{"type":"string","minLength":1,"title":"Body"}},"type":"object","required":["body"],"title":"ResponsePatchIn"},"RestoreExtractedIn":{"properties":{"cols":{"items":{"type":"string"},"type":"array","title":"Cols","description":"Columns to restore to their preserved extracted value; empty ⇒ restore EVERY overridden cell on the row (or the scalar cell addressed by ``row_id``).","examples":[["gross","gst"]]}},"type":"object","title":"RestoreExtractedIn","description":"Body for POST /{job}/{wp}/rows/{row_id}/restore-extracted (the manual→extracted toggle).\nEmpty ``cols`` ⇒ restore EVERY overridden cell on the row (or the scalar cell addressed by ``row_id``)."},"RestoreResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"status":{"type":"string","title":"Status"},"needs_partner_sync":{"type":"boolean","title":"Needs Partner Sync","default":false}},"type":"object","required":["manual_journal_uuid","status"],"title":"RestoreResponse"},"ResyncDispatchResponse":{"properties":{"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"mode":{"type":"string","title":"Mode"},"tenant_uuid":{"type":"string","title":"Tenant Uuid"}},"type":"object","required":["run_id","mode","tenant_uuid"],"title":"ResyncDispatchResponse","description":"Dispatched tenant raw-material resync — progress streams on the tenant topic."},"ResyncResult":{"properties":{"status":{"type":"string","title":"Status"},"revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revision Id"}},"type":"object","required":["status"],"title":"ResyncResult","description":"Result of a manual KB re-sync (``run_once``). ``status`` is one of\nnot_configured|not_found|locked|unchanged|ingested|failed; ``revision_id`` is\npresent when a revision was recorded/touched."},"ReverseCheckResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Services"}},"type":"object","required":["ok","services"],"title":"ReverseCheckResponse","description":"Services → backend reachability fan-out. Each item is the remote\n``/reach-backend`` body (service-owned shape) or a failure stub, so the list\nis typed loosely."},"RevokedApiKeyAck":{"properties":{"key_uuid":{"type":"string","title":"Key Uuid"},"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["key_uuid","revoked"],"title":"RevokedApiKeyAck","description":"Ack returned when a partner API key is revoked."},"RowEditIn":{"properties":{"row_id":{"type":"string","title":"Row Id","description":"The target row's stable ``_id`` (required — identifies which row to edit).","examples":["row_3f2a"]},"cells":{"additionalProperties":true,"type":"object","title":"Cells","description":"Edited cells for this row as ``{col: value}``.","examples":[{"description":"Insurance","gross":120.5}]}},"type":"object","required":["row_id"],"title":"RowEditIn"},"RuleEditShape":{"properties":{"condition_id":{"type":"integer","title":"Condition Id"},"rule_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"field_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Column"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"triggered_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triggered Condition"},"operator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator"},"field_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Value"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"action_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Message"},"applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicability"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"gst_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst Applicability"},"entity_type":{"items":{"type":"string"},"type":"array","title":"Entity Type"},"year_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Year Applicability"},"auto_apply":{"type":"boolean","title":"Auto Apply"},"keywords":{"type":"string","title":"Keywords"},"reclassification_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reclassification From"},"from_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Account"},"reclassification_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reclassification To"},"to_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Account"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"account_code":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Account Code"},"client_name":{"items":{"type":"string"},"type":"array","title":"Client Name"},"condition_specific_type":{"type":"string","title":"Condition Specific Type"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"value1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value1"},"value2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value2"},"small":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Small"},"medium":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Medium"},"enterprise":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enterprise"},"small_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Small Th"},"medium_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Medium Th"},"enterprise_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Enterprise Th"}},"additionalProperties":true,"type":"object","required":["condition_id","rule_name","name","field_column","field","triggered_condition","operator","field_value","value","action_message","applicability","status","gst_applicability","entity_type","year_applicability","auto_apply","keywords","reclassification_from","from_account","reclassification_to","to_account","description","account_code","client_name","condition_specific_type","severity","value1","value2","small","medium","enterprise","small_th","medium_th","enterprise_th"],"title":"RuleEditShape","description":"One rule shaped for the edit form (``serializers.edit_shape``). Carries the\nduplicated field aliases the RuleModal edit-populate expects; extra keys allowed."},"RuleListItem":{"properties":{"condition_id":{"type":"integer","title":"Condition Id"},"condition_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition Name"},"account_codes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Account Codes"},"account_ids":{"items":{"type":"integer"},"type":"array","title":"Account Ids"},"field_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Column"},"triggered_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triggered Condition"},"field_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Value"},"data_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Type"},"action_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Message"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"gst_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst Applicability"},"year_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Year Applicability"},"applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicability"},"company":{"type":"string","title":"Company"},"trust":{"type":"string","title":"Trust"},"partnership":{"type":"string","title":"Partnership"},"sole_traders":{"type":"string","title":"Sole Traders"},"non_profit":{"type":"string","title":"Non Profit"},"keywords":{"type":"string","title":"Keywords"},"from_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Account"},"to_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Account"},"created_by":{"type":"string","title":"Created By"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"condition_specific_type":{"type":"string","title":"Condition Specific Type"},"clients":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clients"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"value1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value1"},"value2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value2"},"small":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Small"},"medium":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Medium"},"enterprise":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enterprise"},"small_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Small Th"},"medium_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Medium Th"},"enterprise_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Enterprise Th"}},"additionalProperties":true,"type":"object","required":["condition_id","condition_name","account_codes","account_ids","field_column","triggered_condition","field_value","data_type","action_message","description","gst_applicability","year_applicability","applicability","company","trust","partnership","sole_traders","non_profit","keywords","from_account","to_account","created_by","created_at","status","condition_specific_type","clients","severity","value1","value2","small","medium","enterprise","small_th","medium_th","enterprise_th"],"title":"RuleListItem","description":"One rule as shaped for the rule-builder list (``serializers.list_item``).\nNested account/client entries are documented loosely; extra keys allowed."},"RuleWriteRequest":{"properties":{"rule_name":{"type":"string","title":"Rule Name","description":"Human-readable rule name. Required (non-empty).","examples":["Large expense over 10k"]},"account_code":{"items":{"type":"integer"},"type":"array","title":"Account Code","description":"zato_account_id values the rule targets. Required — at least one; the mapping grid is written one row per account.","examples":[[41,87]]},"field":{"type":"string","title":"Field","description":"Predicate column to test → field_column. Required. One of: Debit / Credit / Running Balance / GST Rate / GST / Description / Source.","examples":["Debit"]},"operator":{"type":"string","title":"Operator","description":"Comparison operator → triggered_condition. Required. Numeric: > < >= <= = != ; keyword: Contains / Does not contain / exactly matches ; or 'range'. Must be compatible with the chosen field.","examples":[">"]},"value":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Value","description":"Predicate field value. Required for single-value numeric operators, and for keyword operators when `keywords` is empty. A single number/string, or a list for keyword sets. Omit for operator='range'.","examples":[10000]},"value1":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Value1","description":"Range lower bound. Required together with value2 ONLY when operator='range'; ignored otherwise.","examples":[1000]},"value2":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Value2","description":"Range upper bound. Required together with value1 ONLY when operator='range'; ignored otherwise.","examples":[5000]},"keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keywords","description":"Comma-separated keyword(s). Required (or `value`) ONLY when operator is a keyword operator (Contains / Does not contain / exactly matches).","examples":["fuel,parking"]},"data_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Type","description":"Optional. Predicate data type; derived from field/operator when omitted ('string' vs 'double precision').","examples":["double precision"]},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity","description":"Optional severity label.","examples":["high"]},"action_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Message","description":"Optional message shown when the rule triggers.","examples":["Review large expense"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional free-text description."},"entity_type":{"items":{"type":"string"},"type":"array","title":"Entity Type","description":"Business structures the rule applies to → company/trust/partnership/sole_traders/non_profit flags. Required — at least one.","examples":[["company","trust"]]},"gst_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gst Applicability","description":"Optional GST applicability filter."},"year_applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Year Applicability","description":"Optional financial-year applicability filter."},"applicability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicability","description":"Optional applicability filter."},"reclassification_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reclassification From","description":"Optional reclassification source account label."},"reclassification_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reclassification To","description":"Optional reclassification target account label."},"auto_apply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Apply","description":"Optional auto-apply flag ('Yes'/'No')."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Optional rule status; defaults to 'active' on create.","examples":["active"]},"condition_specific_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition Specific Type","description":"Scope hint. Send 'client' (with client_ids) for CLIENT scope; omit / empty / 'organization' for firm-wide.","examples":["client"]},"client_ids":{"items":{"type":"string"},"type":"array","title":"Client Ids","description":"Client UUIDs for CLIENT scope. Required (non-empty) only when condition_specific_type='client'; empty means firm-wide.","examples":[["b1f2c3d4-0000-4a11-8b22-000000000001"]]},"small":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Small","description":"Optional 'small' size-threshold flag (legacy)."},"medium":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Medium","description":"Optional 'medium' size-threshold flag (legacy)."},"enterprise":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enterprise","description":"Optional 'enterprise' size-threshold flag (legacy)."},"small_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Small Th","description":"Optional numeric 'small' size threshold value."},"medium_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Medium Th","description":"Optional numeric 'medium' size threshold value."},"enterprise_th":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Enterprise Th","description":"Optional numeric 'enterprise' size threshold value."}},"type":"object","required":["rule_name","account_code","field","operator","entity_type"],"title":"RuleWriteRequest","description":"Create/full-replace-update body. Permissive — the UI sends a wide,\nloosely-typed shape. The five fields below are REQUIRED by\n``validate_rule_data`` (unconditional; both create and update run it), so\nSwagger marks them mandatory."},"Run":{"properties":{"run_id":{"type":"string","title":"Run Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","enum":["queued","running","completed","failed"],"title":"Status","default":"queued"},"started_at":{"type":"string","title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"summary":{"type":"string","title":"Summary","default":""},"steps":{"items":{"$ref":"#/components/schemas/RunStep"},"type":"array","title":"Steps","default":[]}},"type":"object","required":["run_id","kind"],"title":"Run"},"RunFilled":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"rows":{"type":"integer","title":"Rows"},"reconciled":{"type":"boolean","title":"Reconciled","default":false}},"type":"object","required":["wp_code","rows"],"title":"RunFilled"},"RunIn":{"properties":{"wp_codes":{"items":{"type":"string"},"type":"array","title":"Wp Codes","description":"Scope the run to these workpaper codes; empty ⇒ run every WP on the job.","examples":[["EXP","ACP"]]},"force":{"type":"boolean","title":"Force","description":"Re-run every targeted WP even if its inputs are unchanged; default only re-runs changed WPs.","default":false,"examples":[false]}},"type":"object","title":"RunIn"},"RunOut":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"job_uuid_ref":{"type":"string","title":"Job Uuid Ref"},"filled":{"items":{"$ref":"#/components/schemas/RunFilled"},"type":"array","title":"Filled"},"skipped":{"items":{"type":"string"},"type":"array","title":"Skipped"},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["run_id","status","job_uuid_ref"],"title":"RunOut"},"RunStep":{"properties":{"seq":{"type":"integer","title":"Seq"},"service":{"type":"string","title":"Service"},"stage":{"type":"string","title":"Stage"},"agent":{"type":"string","title":"Agent","default":""},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message","default":""},"input_summary":{"type":"string","title":"Input Summary","default":""},"output_summary":{"type":"string","title":"Output Summary","default":""},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"elapsed_ms":{"type":"number","title":"Elapsed Ms","default":0.0},"timestamp":{"type":"string","title":"Timestamp"},"extra":{"additionalProperties":true,"type":"object","title":"Extra","default":{}}},"type":"object","required":["seq","service","stage","status"],"title":"RunStep"},"SaveClientMappingsResult":{"properties":{"saved":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Saved"},"blocked":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Blocked"}},"type":"object","required":["saved","blocked"],"title":"SaveClientMappingsResult","description":"Result of saving Zato ↔ XPM client mappings: what was saved vs blocked."},"SaveDefinitionIn":{"properties":{"definition":{"$ref":"#/components/schemas/WorkpaperDefinition","description":"The full workpaper definition to create or version-bump."},"config_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config Uuid","description":"Config UUID of an existing definition to version-bump; omit/null to create a new one.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"publish":{"type":"boolean","title":"Publish","description":"When true, validate+save then publish into the run set in one call (publishes only if valid).","default":false}},"type":"object","required":["definition"],"title":"SaveDefinitionIn"},"SaveDefinitionOut":{"properties":{"config_uuid":{"type":"string","title":"Config Uuid"},"version":{"type":"integer","title":"Version"},"published":{"type":"boolean","title":"Published","default":false},"validation":{"$ref":"#/components/schemas/ValidationResult"}},"type":"object","required":["config_uuid","version","validation"],"title":"SaveDefinitionOut"},"SaveIn":{"properties":{"edits":{"items":{"$ref":"#/components/schemas/RowEditIn"},"type":"array","title":"Edits","description":"Per-row cell edits, each addressed by the row's ``_id``."},"adds":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Adds","description":"New rows to add — ``[{fields:{...}}]`` or ``[{...}]``."},"deletes":{"items":{"type":"string"},"type":"array","title":"Deletes","description":"Row ``_id``s to delete.","examples":[["row_3f2a"]]},"scalars":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Scalars","description":"Scalar / summary (non-table) cell edits addressed by cell ``_id`` — ``[{cell_id, value, cell_formula?}]`` (``cell_formula`` is the UX-01 in-cell formula text)."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional free-text reason for this save (one per save) — recorded on every edited cell's audit row and shown in the lineage ValueHistory."},"cell_reasons":{"additionalProperties":{"type":"string"},"type":"object","title":"Cell Reasons","description":"Per-cell reasons keyed by the canonical ``field_id`` (``<row_id>~<col>`` for a table cell, the bare ``cell_id`` for a scalar); each overrides the save-level ``reason`` for its own cell."}},"type":"object","title":"SaveIn"},"SaveMappingsRequest":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/MappingItem"},"type":"array","title":"Mappings","description":"Job-level FYI folder → Zato job mappings to upsert (one per FYI job). Required.","examples":[[{"fyi_entity_id":"12345","fyi_job_id":"67890","zato_client_uuid":"b1d4c7e2-3f6a-4b8c-9d0e-1a2b3c4d5e6f","zato_job_uuid":"9b2c1d4e-5f6a-4b8c-9d0e-1a2b3c4d5e6f"}]]}},"type":"object","required":["mappings"],"title":"SaveMappingsRequest"},"SaveParentIn":{"properties":{"section_index":{"type":"integer","title":"Section Index","description":"Section instance index the mapping is saved under; 0 is the base/first section.","default":0,"examples":[0]},"account_uuids":{"items":{"type":"string"},"type":"array","title":"Account Uuids","description":"The FULL replacement set of client COA account UUIDs mapped to this parent — replaces any prior set; an empty list clears the mapping. Single-account parents (e.g. Bank) accept at most one (else 422 SINGLE_ACCOUNT_ONLY).","examples":[["3f9a5c1e-2b44-4d1a-9c77-0a1b2c3d4e5f"]]}},"type":"object","title":"SaveParentIn","description":"Auto-save one parent's mapped accounts (a full replace-set for that parent)."},"SavedCountResponse":{"properties":{"saved":{"type":"integer","title":"Saved"}},"type":"object","required":["saved"],"title":"SavedCountResponse","description":"Ack for an upsert — number of rows saved."},"ScaffoldOut":{"properties":{"definition":{"$ref":"#/components/schemas/WorkpaperDefinition"}},"type":"object","required":["definition"],"title":"ScaffoldOut","description":"A blank Definition scaffold wrapper seeding the Create wizard."},"ScanItemOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"status":{"type":"string","title":"Status"}},"type":"object","required":["wp_code","status"],"title":"ScanItemOut"},"ScanListOut":{"properties":{"scans":{"items":{"$ref":"#/components/schemas/ScanItemOut"},"type":"array","title":"Scans"}},"type":"object","required":["scans"],"title":"ScanListOut"},"ScanStartOut":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"ScanStartOut","description":"A per-workpaper scan runs in the background; the client polls its status."},"SectionDTO":{"properties":{"key":{"type":"string","title":"Key"},"type":{"type":"string","title":"Type"},"title":{"type":"string","title":"Title"},"is_included":{"type":"boolean","title":"Is Included","default":true},"sort_order":{"type":"integer","title":"Sort Order","default":0},"editable":{"additionalProperties":true,"type":"object","title":"Editable","default":{}},"columns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Columns","default":[]},"lines":{"items":{"$ref":"#/components/schemas/LineDTO"},"type":"array","title":"Lines","default":[]},"block":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Block"}},"type":"object","required":["key","type","title"],"title":"SectionDTO"},"SectionPatchIn":{"properties":{"is_included":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Included","description":"Include or exclude the section. Optional partial update — omit to leave unchanged.","examples":[false]},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order","description":"New position of the section within the report. Optional; omit to leave unchanged.","examples":[3]},"title_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title Override","description":"Custom title that overrides the template's default section heading. Optional.","examples":["Statement of Financial Position"]},"block":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Block","description":"Section-specific editable block payload (bounded config for the section, e.g. narrative or layout overrides). Optional.","examples":[{"note":"custom narrative"}]}},"type":"object","title":"SectionPatchIn","description":"Partial update of a report section — every field is optional; send only what changes."},"SectionPatchResult":{"properties":{"section_key":{"type":"string","title":"Section Key"}},"type":"object","required":["section_key"],"title":"SectionPatchResult","description":"Docs model for the ``PATCH .../sections/{section_key}`` ack — echoes the section key."},"SectionRef":{"properties":{"entity_questionnaire_section_uuid":{"type":"string","title":"Entity Questionnaire Section Uuid"}},"type":"object","required":["entity_questionnaire_section_uuid"],"title":"SectionRef"},"SendTestRequest":{"properties":{"recipient_email":{"type":"string","title":"Recipient Email","description":"Where to send the demo email. Optional — defaults to demo-client@example.com when omitted.","default":"demo-client@example.com","examples":["admin@zatohq.com"]}},"type":"object","title":"SendTestRequest","description":"In-portal demo send — fires a sample email for the current firm/tier so an\nadmin can watch the whole pipeline in the Delivery Log (+ the Integrated\ntester). ORG-scoped; not a real client comm."},"ServicePing":{"properties":{"service":{"type":"string","title":"Service"},"ok":{"type":"boolean","title":"Ok"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"elapsed_ms":{"type":"number","title":"Elapsed Ms"},"detail":{"title":"Detail"}},"type":"object","required":["service","ok","status_code","elapsed_ms","detail"],"title":"ServicePing","description":"One service ``/healthz`` probe result (see ``router._ping``). Every key is\nalways present; ``detail`` is the parsed JSON body on success, else an error\nstring."},"ServicesHealthResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"services":{"items":{"$ref":"#/components/schemas/ServicePing"},"type":"array","title":"Services"}},"type":"object","required":["ok","services"],"title":"ServicesHealthResponse","description":"Combined fan-out health across every registered (non-skipped) service."},"SesEventAck":{"properties":{"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["status","detail"],"title":"SesEventAck","description":"Ack for the SES/SNS event-ingest webhook (P1 stub)."},"SessionHistory":{"properties":{"session_id":{"type":"string","title":"Session Id"},"turns":{"items":{"$ref":"#/components/schemas/TurnView"},"type":"array","title":"Turns"}},"type":"object","required":["session_id"],"title":"SessionHistory"},"SessionResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserPayload"},"persona":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Persona"},"role":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Role"},"portal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal"},"navigation_flags":{"additionalProperties":true,"type":"object","title":"Navigation Flags"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"landing_route":{"type":"string","title":"Landing Route"}},"type":"object","required":["user","persona","role","portal","navigation_flags","permissions","landing_route"],"title":"SessionResponse"},"SessionSummary":{"properties":{"session_id":{"type":"string","title":"Session Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_active_at":{"type":"string","format":"date-time","title":"Last Active At"}},"type":"object","required":["session_id","created_at","last_active_at"],"title":"SessionSummary","description":"One chat thread in the user's Ziffy history list."},"SetCategoryRequest":{"properties":{"parent_key":{"type":"string","title":"Parent Key","description":"Required. The CoA parent key the chosen pool entry maps under, OR a ledger-slot key (e.g. 'gl_current' / 'trial_balance').","examples":["INCOME"]},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"The pool entry's source group (e.g. 'xero', 'ird'); pairs with `sub_key` to pick the exact pool entry so label/provenance match the pick.","examples":["xero"]},"sub_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Key","description":"The pool entry's CSV file_category key (pairs with `source`).","examples":["sales"]},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping","description":"Per-account mapping tag for a per-account / section-level file; omit for a plain category pick."},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid","description":"When set, writes a per-JOB category OVERRIDE onto the (file, job) link (file base untouched); omit for the firm-level path (D10). REQUIRED when `parent_key` is a ledger slot (GL / Trial Balance).","examples":["c4e2d3f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f"]}},"type":"object","required":["parent_key"],"title":"SetCategoryRequest"},"SetCoaLinkRequest":{"properties":{"coa_account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coa Account Uuid","description":"The target Zato COA bank account's immutable account_uuid to link this connected feed account to. Optional/nullable by design: send null (or omit the field entirely) to UNLINK — null is the meaningful 'clear the link' value on this set/clear endpoint.","examples":["3f9a1c2e-7b40-4d1a-9c88-0a1b2c3d4e5f"]}},"type":"object","title":"SetCoaLinkRequest","description":"Link (with a uuid) or unlink (null) a connected bank account to a Zato COA bank account."},"SetFavouriteIn":{"properties":{"favourite":{"type":"boolean","title":"Favourite","description":"True favourites the WP (pinned to the top of the job sidebar); false unfavourites it. Defaults to True when omitted.","default":true,"examples":[true]}},"type":"object","title":"SetFavouriteIn","description":"Favourite/unfavourite a workpaper for this job — the per-job \"pin to the top\" flag.\n\nFlips the stored doc section's ``favourite`` boolean so the sidebar lists favourited\nWPs together in a pinned section above the category groups (per-job, shared)."},"SetFavouriteOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"favourite":{"type":"boolean","title":"Favourite"},"updated":{"type":"boolean","title":"Updated"}},"type":"object","required":["wp_code","favourite","updated"],"title":"SetFavouriteOut","description":"Payload of ``PUT /{job}/{wp}/favourite`` — the applied favourite flip."},"SetGroupIn":{"properties":{"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","description":"Target sidebar group (any valid group, incl. 'Workpaper Bank'). A blank/null value CLEARS the override, reverting the WP to its default grouping.","examples":["Assets"]}},"type":"object","title":"SetGroupIn","description":"Move a workpaper to a user-chosen sidebar GROUP for this job.\n\nPersists a per-job ``wp_group_override`` on the stored section so the WP appears under\nthe chosen group (any valid group, incl. 'Workpaper Bank'). ``group=None``/blank CLEARS\nthe override, reverting to the default grouping (auto-move on fill, or the Bank for a\n``bank_default`` WP like RSV)."},"SetGroupOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Group"},"updated":{"type":"boolean","title":"Updated"}},"type":"object","required":["wp_code","updated"],"title":"SetGroupOut","description":"Payload of ``PUT /{job}/{wp}/group`` — the applied sidebar-group override."},"SetHiddenCabinetsRequest":{"properties":{"cabinet_ids":{"items":{"type":"string"},"type":"array","title":"Cabinet Ids","description":"Full set of FYI cabinet ids to hide from the picker — REPLACES the firm's current hidden set (send [] to unhide all). Required.","examples":[["cab-101","cab-102"]]}},"type":"object","required":["cabinet_ids"],"title":"SetHiddenCabinetsRequest"},"SetHiddenIn":{"properties":{"hidden":{"type":"boolean","title":"Hidden","description":"True hides the WP from the job sidebar (shown only under *Show hidden*); false unhides it. Defaults to True (hide) when omitted.","default":true,"examples":[true]}},"type":"object","title":"SetHiddenIn","description":"Toggle a workpaper's per-job sidebar visibility — the Z1 'hide WP' flag.\n\nFlips the stored doc section's ``hidden`` boolean so the sidebar's\n*Show hidden* toggle controls whether the WP is listed (per-job, shared)."},"SetHiddenOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"hidden":{"type":"boolean","title":"Hidden"},"updated":{"type":"boolean","title":"Updated"}},"type":"object","required":["wp_code","hidden","updated"],"title":"SetHiddenOut","description":"Payload of ``PUT /{job}/{wp}/visibility`` — the applied hide/show flip."},"SetNewPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Required. The account email completing the forced new-password challenge.","examples":["cs.admin@zatohq.com"]},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password","description":"Required. The chosen new password (8-128 chars).","examples":["N3w!Secur3Pass"]},"session_token":{"type":"string","maxLength":4096,"minLength":8,"title":"Session Token","description":"Required. The Cognito challenge session token returned by the password step (mode=password_change_required).","examples":["AYABeFake.challenge.session.token"]}},"type":"object","required":["email","new_password","session_token"],"title":"SetNewPasswordRequest","description":"Used to complete Cognito's NEW_PASSWORD_REQUIRED challenge (first login\nafter a temp password from the welcome / invite email)."},"SetPrimaryContactRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"client_uuid of the group member to mark as the primary contact. Required; must already be a member of the group.","examples":["a1b2c3d4-1111-2222-3333-444455556666"]}},"type":"object","required":["client_uuid"],"title":"SetPrimaryContactRequest"},"SetSectionAccountsIn":{"properties":{"section_key":{"type":"string","title":"Section Key","description":"Stable section identity (`acc:<uuid>` / `par:<pk>` / `inst:<wp>:<n>` / `single:main`) whose owned accounts are being set.","examples":["inst:IIS:1"]},"account_uuids":{"items":{"type":"string"},"type":"array","title":"Account Uuids","description":"The FULL replacement set of account UUIDs this section owns within the workpaper (an empty list clears it). Each is removed from any OTHER section of the same WP — account → 1 section per WP.","examples":[["3f9a5c1e-2b44-4d1a-9c77-0a1b2c3d4e5f"]]}},"type":"object","required":["section_key"],"title":"SetSectionAccountsIn","description":"Set the accounts a section OWNS (attach / swap) — the FULL replacement set for that section. Enforces\naccount → exactly ONE section per workpaper (each incoming account is evicted from every other section)."},"SetSplitsRequest":{"properties":{"splits":{"items":{"$ref":"#/components/schemas/SplitLegInput"},"type":"array","title":"Splits","description":"Split legs; must sum to the line's gross. An empty list clears the split."}},"type":"object","title":"SetSplitsRequest","description":"Replace a line's split allocation. Empty list ⇒ clear (back to single-code)."},"SetStatusAck":{"properties":{"ok":{"type":"boolean","title":"Ok"},"status":{"type":"string","title":"Status"}},"type":"object","required":["ok","status"],"title":"SetStatusAck","description":"Ack for resolve/reopen — the new status plus the generic ok flag."},"SharePointCredentialsRequest":{"properties":{"SHAREPOINT_TENANT_ID":{"type":"string","maxLength":128,"minLength":1,"title":"Sharepoint Tenant Id","description":"Required. Azure AD tenant of the app registration — the onmicrosoft.com domain or the tenant GUID.","examples":["contoso.onmicrosoft.com"]},"SHAREPOINT_CLIENT_ID":{"type":"string","maxLength":128,"minLength":1,"title":"Sharepoint Client Id","description":"Required. Azure app registration's Application (client) ID.","examples":["11111111-2222-3333-4444-555555555555"]},"SHAREPOINT_CLIENT_SECRET":{"type":"string","title":"Sharepoint Client Secret","description":"Azure app client secret. Required on FIRST connect; on RE-connect leave blank to keep the already-stored secret (the GET never echoes it back, so the form can't resend it).","default":"","examples":["Abc8Q~exampleClientSecretValue1234567890"]},"SHAREPOINT_SITE":{"type":"string","maxLength":512,"minLength":1,"title":"Sharepoint Site","description":"Required. Full SharePoint site URL whose folder tree will be browsed.","examples":["https://contoso.sharepoint.com/sites/Practice"]}},"type":"object","required":["SHAREPOINT_TENANT_ID","SHAREPOINT_CLIENT_ID","SHAREPOINT_SITE"],"title":"SharePointCredentialsRequest","description":"Connect payload entered in the ZIP portal.\n\nOn RE-connect the secret may be left blank to keep the saved one (the GET\nnever returns the plaintext secret, so the form can't echo it back)."},"SignoffIssue":{"properties":{"code":{"type":"string","title":"Code"},"severity":{"type":"string","title":"Severity","default":"blocker"},"problem":{"type":"string","title":"Problem"},"resolution":{"type":"string","title":"Resolution"},"detail":{"items":{"type":"string"},"type":"array","title":"Detail"},"action":{"anyOf":[{"$ref":"#/components/schemas/SignoffIssueAction"},{"type":"null"}]},"needs":{"items":{"$ref":"#/components/schemas/CategoryNeed"},"type":"array","title":"Needs"}},"type":"object","required":["code","problem","resolution"],"title":"SignoffIssue","description":"One thing standing between a workpaper and sign-off: the problem, how to\nresolve it, and the action that takes the user there. Deterministic (no LLM)."},"SignoffIssueAction":{"properties":{"label":{"type":"string","title":"Label"},"href":{"type":"string","title":"Href"},"screen_key":{"type":"string","title":"Screen Key"},"permission":{"type":"string","title":"Permission"}},"type":"object","required":["label","href","screen_key","permission"],"title":"SignoffIssueAction","description":"Where to send the user to resolve an issue — a deep-link the Ready-to-Sign-off\nrow renders as an action button (its visibility gated by ``permission``)."},"SignoffIssuesSnapshot":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"workpapers":{"items":{"$ref":"#/components/schemas/WpSignoffIssues"},"type":"array","title":"Workpapers"},"job_issues":{"items":{"$ref":"#/components/schemas/SignoffIssue"},"type":"array","title":"Job Issues"},"signoff_action":{"anyOf":[{"$ref":"#/components/schemas/SignoffIssueAction"},{"type":"null"}]},"ready_count":{"type":"integer","title":"Ready Count","default":0},"total":{"type":"integer","title":"Total","default":0}},"type":"object","required":["job_uuid"],"title":"SignoffIssuesSnapshot","description":"The whole job's Ready-to-Sign-off checklist: per-workpaper issues + any\njob-level preconditions (unmapped CoA), computed deterministically on demand."},"SignoffReadiness":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"status":{"type":"string","title":"Status","default":"unknown"},"ready":{"type":"boolean","title":"Ready","default":false},"text":{"type":"string","title":"Text","default":""},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["wp_code"],"title":"SignoffReadiness","description":"One workpaper's persisted \"Ready to sign off\" review — the agent's full\nmulti-line ``text``, a parsed ``status`` (drives the row chip), and the\n``computed_at`` timestamp the panel shows as \"last calculated at\"."},"SignoffReadinessSnapshot":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"results":{"additionalProperties":{"$ref":"#/components/schemas/SignoffReadiness"},"type":"object","title":"Results"}},"type":"object","required":["job_uuid"],"title":"SignoffReadinessSnapshot","description":"Every persisted sign-off result for a job, keyed by ``wp_code`` so the panel\nhydrates each row's prior verdict + timestamp in one GET (empty until first run)."},"SourceListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/QuerySourceOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"SourceListOut","description":"``GET /queries/sources`` payload — the raise-query source dropdown rows."},"SourceOut":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"order":{"type":"integer","title":"Order"},"color":{"type":"string","title":"Color","default":"default"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"}},"type":"object","required":["key","label","order"],"title":"SourceOut"},"SourcesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SourceOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"SourcesResponse"},"SpanIn":{"properties":{"span_id":{"type":"string","title":"Span Id"},"parent_span_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Span Id"},"kind":{"type":"string","title":"Kind"},"name":{"type":"string","title":"Name"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"started_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Started Ms"},"elapsed_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Elapsed Ms"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens"},"input":{"anyOf":[{},{"type":"null"}],"title":"Input"},"output":{"anyOf":[{},{"type":"null"}],"title":"Output"},"prompt":{"anyOf":[{},{"type":"null"}],"title":"Prompt"},"completion":{"anyOf":[{},{"type":"null"}],"title":"Completion"}},"type":"object","required":["span_id","kind","name"],"title":"SpanIn","description":"One node in the turn's trace — a tier, a tool call, an MCP call, a sub-agent, or an\nLLM call. ``input``/``output``/``prompt``/``completion`` carry the raw content (masked\non capture before it reaches the portal-readable bundle)."},"SplitDocument":{"properties":{"document_uuid":{"type":"string","title":"Document Uuid"},"source_file_uuid":{"type":"string","title":"Source File Uuid"},"split_file_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Split File Uuid"},"file_alias_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Alias Name"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"supplier_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier Name"},"page_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Range"},"status":{"type":"string","title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["document_uuid","source_file_uuid","status"],"title":"SplitDocument"},"SplitLegInput":{"properties":{"account_code":{"type":"string","minLength":1,"title":"Account Code","description":"Account code for this leg ('<code>' or '<code> - <name>').","examples":["4000"]},"amount":{"type":"number","title":"Amount","description":"Gross amount for this account; legs must sum to the line's total.","examples":[125.5]},"tax_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type","description":"Optional Xero TaxType override for this leg.","examples":["INPUT2"]}},"type":"object","required":["account_code","amount"],"title":"SplitLegInput"},"SplitStatusResponse":{"properties":{"source_file_uuid":{"type":"string","title":"Source File Uuid"},"status":{"type":"string","title":"Status"},"is_running":{"type":"boolean","title":"Is Running","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["source_file_uuid","status"],"title":"SplitStatusResponse"},"StageCount":{"properties":{"stage":{"type":"string","title":"Stage"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["stage","count"],"title":"StageCount","description":"One real job-status bucket (the actual `statuses.status_name` values —\nnot force-fitted into an invented stage scheme)."},"StartResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status","default":"dispatched"},"gl_file_uuid":{"type":"string","title":"Gl File Uuid"},"bank_file_uuid":{"type":"string","title":"Bank File Uuid"},"bank_file_uuids":{"items":{"type":"string"},"type":"array","title":"Bank File Uuids"}},"type":"object","required":["ac_job_uuid","run_id","gl_file_uuid","bank_file_uuid"],"title":"StartResponse"},"StatusMessageResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"StatusMessageResponse","description":"Bare ``{status, message}`` bank-feed action ack. These handlers return a raw\ndict, not the standard ``{data, meta, errors}`` envelope, so the documented\nshape is the bare ack (not wrapped in ``Envelope[...]``)."},"StructureClassification":{"properties":{"structured":{"type":"boolean","title":"Structured","default":false},"levels":{"items":{"type":"string","enum":["client","job","fiscal_year","source","ignore"]},"type":"array","title":"Levels"},"outliers":{"items":{"$ref":"#/components/schemas/StructureOutlier"},"type":"array","title":"Outliers"}},"type":"object","title":"StructureClassification","description":"Whether the detected tree is a uniform hierarchy, and if so its ordered level\nchain + the folders that break it. `structured` picks the tagging UI: True → the\nlevel editor (edit `levels`, fix `outliers`); False → the per-folder review.\n`levels[0]` is the shallowest level (\"client\"); `levels[1:]` maps onto a client\nmark's `depth_roles`."},"StructureOutlier":{"properties":{"folder_id":{"type":"string","title":"Folder Id"},"folder_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Label"},"role":{"type":"string","enum":["client","job","fiscal_year","source","ignore"],"title":"Role"},"expected":{"type":"string","enum":["client","job","fiscal_year","source","ignore"],"title":"Expected"},"depth":{"type":"integer","title":"Depth"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"}},"type":"object","required":["folder_id","role","expected","depth"],"title":"StructureOutlier","description":"One folder whose AI role breaks its depth's dominant pattern — surfaced in the\nlevel editor so the human fixes it without leaving the structured view."},"SubContextOption":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"}},"type":"object","required":["value","label"],"title":"SubContextOption","description":"One sub-context choice derived from the selected source. ``value`` is what's\nstored in ``queries.sub_context`` (a human-readable \"CODE — Name\")."},"SubContextOptionsOut":{"properties":{"options":{"items":{"$ref":"#/components/schemas/SubContextOption"},"type":"array","title":"Options"},"allow_free_text":{"type":"boolean","title":"Allow Free Text"}},"type":"object","required":["options","allow_free_text"],"title":"SubContextOptionsOut"},"SuggestAutoJournalsRequest":{"properties":{"wp_code":{"type":"string","maxLength":64,"minLength":1,"title":"Wp Code","description":"The workpaper code to draft adjusting journals for (e.g. 'EXP')."}},"type":"object","required":["wp_code"],"title":"SuggestAutoJournalsRequest","description":"Body for the Auto Journals \"Get suggested journals\" trigger: which workpaper\nZiffy should draft adjusting manual journals for. Scope (job) is the path param."},"Suggestion":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"kind":{"type":"string","enum":["navigate","ask"],"title":"Kind"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"}},"type":"object","required":["id","label","kind"],"title":"Suggestion","description":"One next-step chip rendered under a Ziffy answer. ``navigate`` routes the user\nstraight to a page (``route``); ``ask`` sends ``prompt`` back to Ziffy as a\nfollow-up (e.g. to draft a manual journal via the write-action flow).\nThe catalogue + id→button mapping is owned by ``ziffy/suggestions.py``."},"SummaryCellOut":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"value":{"title":"Value"}},"additionalProperties":true,"type":"object","title":"SummaryCellOut"},"SupportRequestDetail":{"properties":{"request_uuid":{"type":"string","title":"Request Uuid"},"request_type":{"type":"string","title":"Request Type"},"subject":{"type":"string","title":"Subject"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"assignee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Email"},"created_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["request_uuid","request_type","subject","body","category","status","priority","firm_name","assignee_email","created_by_email","created_at","updated_at","resolved_at"],"title":"SupportRequestDetail"},"SupportRequestEventRow":{"properties":{"action":{"type":"string","title":"Action"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["action","note","actor_email","created_at"],"title":"SupportRequestEventRow"},"SupportRequestListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/SupportRequestRow"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["rows","total"],"title":"SupportRequestListResponse"},"SupportRequestRow":{"properties":{"request_uuid":{"type":"string","title":"Request Uuid"},"request_type":{"type":"string","title":"Request Type"},"subject":{"type":"string","title":"Subject"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"firm_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Name"},"firm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Uuid"},"assignee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Email"},"assignee_user_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Uuid"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["request_uuid","request_type","subject","category","status","priority","firm_name","firm_uuid","assignee_email","assignee_user_uuid","created_at","updated_at"],"title":"SupportRequestRow"},"SupportUserListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/SupportUserRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"SupportUserListResponse"},"SupportUserRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"},"role_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Key"}},"type":"object","required":["user_uuid","email","full_name","role_name","role_key"],"title":"SupportUserRow"},"SupportingDocRow":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Type"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"is_extract":{"type":"boolean","title":"Is Extract","default":false},"is_gl":{"type":"boolean","title":"Is Gl","default":false},"is_linked":{"type":"boolean","title":"Is Linked","default":false},"is_lazy":{"type":"boolean","title":"Is Lazy","default":false},"account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Uuid"},"link_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Origin"},"processing_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing State"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"linked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Linked At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["file_uuid","file_name"],"title":"SupportingDocRow"},"SupportingDocSection":{"properties":{"section_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section Index"},"section_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Key"},"parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Key"},"label":{"type":"string","title":"Label"},"files":{"items":{"$ref":"#/components/schemas/SupportingDocRow"},"type":"array","title":"Files","default":[]}},"type":"object","required":["label"],"title":"SupportingDocSection","description":"One WpViewMap section as the panel renders it: its supporting files (GL stubs first, then real files).\n``section_index`` is the int the mapping-page keys on; ``section_key`` is the STABLE placement identity\n(``acc:``/``inst:``/``par:``/``single:``) the in-drawer Edit organiser passes to the move endpoint; both are\n``None`` for the General / Unfiled group (a move there = back to base)."},"SupportingDocSectionsResponse":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"sections":{"items":{"$ref":"#/components/schemas/SupportingDocSection"},"type":"array","title":"Sections"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["wp_code","sections","total"],"title":"SupportingDocSectionsResponse","description":"The per-workpaper supporting docs, grouped by WpViewMap section (the relational Phase-8 shape)."},"SupportingDocsInfo":{"properties":{"country":{"type":"string","title":"Country"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"found":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Found"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"workpapers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Workpapers"}},"additionalProperties":true,"type":"object","required":["country"],"title":"SupportingDocsInfo","description":"Static per-workpaper supporting-docs reference. The shape varies: without a\nwp_code it's a compact index (``count`` + ``workpapers``); with one it's the\nsingle entry (``found`` + the workpaper's own fields). Docs-only — extra entry\nkeys (name, description, data sources, expected fields, remarks, …) pass\nthrough."},"SuppressRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","title":"SuppressRequest","description":"Optional note recorded on a workpaper-effect suppression."},"SuppressResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"mj_uuid":{"type":"string","title":"Mj Uuid"},"line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line Id"},"suppressed":{"type":"boolean","title":"Suppressed"},"recomputed":{"type":"boolean","title":"Recomputed","default":false}},"type":"object","required":["job_uuid","mj_uuid","suppressed"],"title":"SuppressResponse","description":"Result of a suppress / restore. ``recomputed`` is False on a no-op (the target was\nalready in the requested state), mirroring Z1's idempotent responses."},"SuppressionListResponse":{"properties":{"mj_uuids":{"items":{"type":"string"},"type":"array","title":"Mj Uuids"},"line_ids":{"items":{"type":"string"},"type":"array","title":"Line Ids"}},"type":"object","title":"SuppressionListResponse","description":"Every workpaper-effect suppression on a job: whole-journal uuids + per-line ids."},"SwitchPersonaRequest":{"properties":{"target_persona":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Persona","description":"Target persona slug to switch into. Optional individually, but at least one of target_persona / firm_uuid MUST be supplied (else 403).","examples":["practice"]},"firm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Uuid","description":"Firm UUID to switch into; disambiguates multiple firms within one persona (e.g. a practice user in two firms). Optional individually, but at least one of target_persona / firm_uuid MUST be supplied.","examples":["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}},"type":"object","title":"SwitchPersonaRequest"},"SwitchPersonaResponse":{"properties":{"persona":{"type":"string","title":"Persona"},"firm_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firm Uuid"},"landing_route":{"type":"string","title":"Landing Route"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","required":["persona","landing_route"],"title":"SwitchPersonaResponse","description":"`/auth/switch-persona` result — the new persona/firm context and landing\nroute (the re-minted access token rides in the cookie)."},"SyncCabinetsResponse":{"properties":{"cabinets_count":{"type":"integer","title":"Cabinets Count"}},"type":"object","required":["cabinets_count"],"title":"SyncCabinetsResponse","description":"Ack for a cabinet refresh — number of cabinets upserted."},"SyncError":{"properties":{"manual_journal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manual Journal Id"},"error":{"type":"string","title":"Error"}},"type":"object","required":["manual_journal_id","error"],"title":"SyncError"},"SyncFromXeroRequest":{"properties":{"resources":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Resources"}},"type":"object","title":"SyncFromXeroRequest","description":"Optional body for the unified Xero pull. Omitted / null ``resources`` pulls\nthe full default set (CoA + journals + Trial Balance)."},"SyncFromXeroResponse":{"properties":{"resources":{"items":{"type":"string"},"type":"array","title":"Resources"},"results":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Results"}},"type":"object","title":"SyncFromXeroResponse","description":"``POST /mj/journals/{job_uuid}/sync-from-xero`` payload — the unified Xero\npull's per-resource result map. ``resources`` lists what was synced (in\nCoA→journals→trial_balance order); ``results`` maps each resource name to its\nown sync summary (shape varies per resource — sync-owned)."},"SyncLocalResponse":{"properties":{"synced":{"type":"boolean","title":"Synced","default":true},"recomputed":{"type":"boolean","title":"Recomputed","default":false}},"type":"object","title":"SyncLocalResponse","description":"Response for POST /journals/{job_uuid}/sync-local."},"SyncResult":{"properties":{"pushed":{"type":"integer","title":"Pushed","default":0},"pushed_categories":{"type":"integer","title":"Pushed Categories","default":0},"pushed_options":{"type":"integer","title":"Pushed Options","default":0},"pulled":{"type":"integer","title":"Pulled","default":0},"conflicts":{"items":{"type":"string"},"type":"array","title":"Conflicts"},"needs_resolution":{"type":"boolean","title":"Needs Resolution","default":false},"request_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Uuid"},"tracking_schema":{"$ref":"#/components/schemas/TrackingSchemaResponse"}},"type":"object","required":["tracking_schema"],"title":"SyncResult"},"SyncStartedResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"SyncStartedResponse","description":"Ack for the background-sync kickoff (running immediately, off the loop)."},"SyncStatusOut":{"properties":{"status":{"type":"string","title":"Status"},"entities_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Entities Count"},"jobs_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jobs Count"},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["status"],"title":"SyncStatusOut"},"SyncToXeroRequest":{"properties":{"manual_journal_uuids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Manual Journal Uuids"}},"type":"object","title":"SyncToXeroRequest","description":"Optional body for the Xero push. Omitted / null ``manual_journal_uuids``\npushes EVERY pending journal (the pre-selection default); a list pushes only\nthe user-ticked journals (Z1 parity: the review screen's checkboxes)."},"SyncToXeroResponse":{"properties":{"created":{"type":"integer","title":"Created","default":0},"voided":{"type":"integer","title":"Voided","default":0},"updated":{"type":"integer","title":"Updated","default":0},"failed":{"type":"integer","title":"Failed","default":0},"synced":{"type":"integer","title":"Synced","default":0},"errors":{"items":{"$ref":"#/components/schemas/SyncError"},"type":"array","title":"Errors"}},"type":"object","title":"SyncToXeroResponse","description":"Result of a batch \"Sync with Xero\" (partner sync) over a job's journals."},"TaxOverrideBulkRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/TaxOverrideItem"},"type":"array","title":"Lines","description":"Lines whose tax override to set; empty ⇒ no-op."}},"type":"object","title":"TaxOverrideBulkRequest","description":"Set the per-line Xero TaxType override on MANY lines in one request (multi-apply)."},"TaxOverrideItem":{"properties":{"bs_index":{"type":"integer","title":"Bs Index","description":"0-based bank-statement line index to override.","examples":[3]},"tax_type_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type Override","description":"Xero TaxType code to force on the line; null/'' clears it (use account default).","examples":["OUTPUT2"]}},"type":"object","required":["bs_index"],"title":"TaxOverrideItem"},"TaxRateListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__mj__schemas__TaxRateItem"},"type":"array","title":"Items"}},"type":"object","title":"TaxRateListResponse","description":"``GET /mj/tax-rates/{job_uuid}`` payload — the client's tax-rate options."},"TaxRatesResponse":{"properties":{"region":{"type":"string","title":"Region","default":""},"provider":{"type":"string","title":"Provider","default":"xero"},"rates":{"items":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__TaxRateItem"},"type":"array","title":"Rates"}},"type":"object","title":"TaxRatesResponse"},"TbBalancesResponse":{"properties":{"items":{"additionalProperties":{"type":"number"},"type":"object","title":"Items"}},"type":"object","required":["items"],"title":"TbBalancesResponse","description":"`GET /coa/clients/{uuid}/tb-balances` — ``account_uuid -> TB balance``."},"TbBlockedOut":{"properties":{"line":{"type":"integer","title":"Line"},"tb_code":{"type":"string","title":"Tb Code"},"tb_name":{"type":"string","title":"Tb Name"},"searched_for":{"type":"string","title":"Searched For"},"kind":{"type":"string","title":"Kind"},"hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hint"},"tb_type":{"type":"string","title":"Tb Type","default":""},"can_create":{"type":"boolean","title":"Can Create","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"suggested_account_type_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suggested Account Type Id"},"suggested_type_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Type Name"}},"type":"object","required":["line","tb_code","tb_name","searched_for","kind"],"title":"TbBlockedOut","description":"A trial-balance row that cannot be resolved by re-pointing it at an existing\naccount. It may still be PROMOTED into the Chart of Accounts as a new account\nwhen ``can_create`` — see ``POST /jobs/{job_uuid}/tb/promote-blocked``."},"TbCandidateOut":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"}},"type":"object","required":["account_uuid","code","name"],"title":"TbCandidateOut","description":"A chart-of-accounts account a trial-balance row could resolve to."},"TbListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TbRowOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"TbListResponse","description":"`GET /coa/jobs/{uuid}/tb` — TB rows joined with the mapping projection."},"TbPreviewOut":{"properties":{"total":{"type":"integer","title":"Total"},"matched":{"type":"integer","title":"Matched"},"can_import":{"type":"boolean","title":"Can Import"},"suggestions":{"items":{"$ref":"#/components/schemas/TbSuggestionOut"},"type":"array","title":"Suggestions"},"blocked":{"items":{"$ref":"#/components/schemas/TbBlockedOut"},"type":"array","title":"Blocked"}},"type":"object","required":["total","matched","can_import"],"title":"TbPreviewOut","description":"Dry-run classification of a trial-balance file against the client's CoA."},"TbPromoteOut":{"properties":{"created":{"type":"integer","title":"Created"},"reactivated":{"type":"integer","title":"Reactivated"},"accounts":{"items":{"$ref":"#/components/schemas/TbPromotedOut"},"type":"array","title":"Accounts"},"needs_type_count":{"type":"integer","title":"Needs Type Count","default":0}},"type":"object","required":["created","reactivated"],"title":"TbPromoteOut","description":"Result of promoting blocked trial-balance rows into the Chart of Accounts."},"TbPromotedOut":{"properties":{"line":{"type":"integer","title":"Line"},"account_uuid":{"type":"string","title":"Account Uuid"},"account_code":{"type":"string","title":"Account Code"},"account_name":{"type":"string","title":"Account Name"},"account_type_id":{"type":"integer","title":"Account Type Id"},"reactivated":{"type":"boolean","title":"Reactivated"}},"type":"object","required":["line","account_uuid","account_code","account_name","account_type_id","reactivated"],"title":"TbPromotedOut","description":"An account created (or reactivated) from a blocked trial-balance row."},"TbRowOut":{"properties":{"coa_tb_id":{"type":"integer","title":"Coa Tb Id"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"account_type_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type Label"},"zato_account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Account Type"},"zato_account_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Account Class"},"ytd_debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ytd Debit"},"ytd_credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ytd Credit"},"balance":{"type":"number","title":"Balance","default":0.0},"gl_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gl Year"},"balance_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Balance Date"},"upload_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Type"},"parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Key"},"parent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Name"},"section":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section"},"workpaper_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Code"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"match_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Type"},"needs_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Review"}},"type":"object","required":["coa_tb_id"],"title":"TbRowOut"},"TbSuggestionOut":{"properties":{"line":{"type":"integer","title":"Line"},"tb_code":{"type":"string","title":"Tb Code"},"tb_name":{"type":"string","title":"Tb Name"},"kind":{"type":"string","title":"Kind"},"preselected_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preselected Uuid"},"candidates":{"items":{"$ref":"#/components/schemas/TbCandidateOut"},"type":"array","title":"Candidates"}},"type":"object","required":["line","tb_code","tb_name","kind"],"title":"TbSuggestionOut","description":"A non-exact match the user must confirm. ``preselected_uuid`` is set only for the\nhigh-confidence case (leading zero + names agree) — it TICKS the box, nothing more:\nthe server never applies a suggestion that wasn't explicitly confirmed."},"TbUploadOut":{"properties":{"inserted":{"type":"integer","title":"Inserted"},"updated":{"type":"integer","title":"Updated","default":0},"archived":{"type":"integer","title":"Archived","default":0},"total_accounts":{"type":"integer","title":"Total Accounts"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"upload_type":{"type":"string","enum":["csv","xlsx","xero"],"title":"Upload Type"}},"type":"object","required":["inserted","total_accounts","upload_type"],"title":"TbUploadOut"},"TeammateInviteRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Teammate's full name (required).","examples":["Jane Smith"]},"email":{"type":"string","format":"email","title":"Email","description":"Teammate's email; must be unique in the firm (409 on duplicate). Required.","examples":["jane@firm.co.nz"]},"role_level":{"type":"integer","enum":[1,2,3,4,5,6],"title":"Role Level","description":"Role level 1-6 (1=Admin, 2=Jr Accountant, 3=Zato Support, 4=Accountant, 5=Manager, 6=Director). Required.","examples":[4]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Optional contact phone."},"auth_type":{"type":"string","maxLength":32,"title":"Auth Type","description":"Login method: 'manual' or an SSO provider ('google_sso'/'microsoft_sso'/'apple_sso'). Defaults to 'manual'.","default":"manual"},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid","description":"Optional branch to assign the teammate to. The practice UI requires it, but the API treats it as optional (no branch assignment when omitted)."},"is_branch_head":{"type":"boolean","title":"Is Branch Head","description":"When true (and branch_uuid set), the teammate becomes that branch's manager. Only Manager (L5) / Director (L6) roles are eligible.","default":false}},"type":"object","required":["name","email","role_level"],"title":"TeammateInviteRequest"},"TeammateInviteResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"role_name":{"type":"string","title":"Role Name"},"role_level":{"type":"integer","title":"Role Level"},"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email","role_name","role_level","invitation_email_sent"],"title":"TeammateInviteResponse"},"TemplateListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TemplateSummary"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"TemplateListResponse","description":"Docs wrapper for ``GET /reporting/templates`` — the ``{\"items\": [...]}`` payload."},"TemplateRef":{"properties":{"entity_template_uuid":{"type":"string","title":"Entity Template Uuid"}},"type":"object","required":["entity_template_uuid"],"title":"TemplateRef"},"TemplateSummary":{"properties":{"template_key":{"type":"string","title":"Template Key"},"version":{"type":"string","title":"Version"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"}},"type":"object","required":["template_key","version"],"title":"TemplateSummary"},"ToggleResult":{"properties":{"condition_id":{"type":"integer","title":"Condition Id"},"status":{"type":"string","title":"Status"},"new_status":{"type":"string","title":"New Status"}},"type":"object","required":["condition_id","status","new_status"],"title":"ToggleResult","description":"Result of an active/inactive toggle. ``status`` and ``new_status`` carry the\nsame value (both kept for frontend back-compat)."},"ToggleSectionExpandIn":{"properties":{"expanded":{"type":"boolean","title":"Expanded","description":"Target state (required): true expands the section (show all underlying transactions), false collapses it. The WP is force-rerun so the face reflects the new flag.","examples":[true]}},"type":"object","required":["expanded"],"title":"ToggleSectionExpandIn","description":"Body for PATCH /{job}/{wp}/sections/{section_id}/expand (guideline #3's per-section\ncollapse/expand toggle — EXP only today). ``section_id`` is the section's stable\n``dsh_data[].section_id`` (e.g. ``par:advertising``)."},"TraceDetailResponse":{"properties":{"trace":{"$ref":"#/components/schemas/TraceListItem"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"spans":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Spans"}},"type":"object","required":["trace"],"title":"TraceDetailResponse","description":"The summary row + the masked span waterfall (read from the S3 bundle)."},"TraceEnvelope":{"properties":{"trace":{"$ref":"#/components/schemas/TraceMeta"},"spans":{"items":{"$ref":"#/components/schemas/SpanIn"},"type":"array","title":"Spans"}},"type":"object","required":["trace"],"title":"TraceEnvelope","description":"The full turn trace the agent POSTs to ``/ziffy-agent/trace``."},"TraceListItem":{"properties":{"response_id":{"type":"string","title":"Response Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"session_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Uuid"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"status":{"type":"string","title":"Status"},"error_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Kind"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"tool_calls":{"items":{"type":"string"},"type":"array","title":"Tool Calls"},"tool_call_count":{"type":"integer","title":"Tool Call Count","default":0},"mcp_call_count":{"type":"integer","title":"Mcp Call Count","default":0},"subagent_count":{"type":"integer","title":"Subagent Count","default":0},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cost_cents":{"type":"number","title":"Cost Cents","default":0},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"xray_trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xray Trace Id"},"client_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Client Id Ref"},"job_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Id Ref"},"user_id_ref":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id Ref"}},"type":"object","required":["response_id","created_at","status"],"title":"TraceListItem","description":"One row in the trace explorer — the index row's filterable summary."},"TraceListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/TraceListItem"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"TraceListResponse"},"TraceMeta":{"properties":{"response_id":{"type":"string","title":"Response Id"},"session_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Uuid"},"turn_seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Seq"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"status":{"type":"string","title":"Status","default":"ok"},"error_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Kind"},"model_tiers":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Model Tiers"},"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"cost_cents":{"type":"number","title":"Cost Cents","default":0},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"xray_trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xray Trace Id"},"otel_trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otel Trace Id"},"agentcore_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agentcore Session Id"}},"type":"object","required":["response_id"],"title":"TraceMeta","description":"Turn-level summary — becomes the index row's filterable dimensions."},"TrackingBulkRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/TrackingItem"},"type":"array","title":"Lines","description":"Lines whose tracking tags to set; empty ⇒ no-op."}},"type":"object","title":"TrackingBulkRequest","description":"Set the per-line tracking tags on MANY lines in one request (multi-apply)."},"TrackingCategoriesResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__TrackingCategoryItem"},"type":"array","title":"Categories"}},"type":"object","title":"TrackingCategoriesResponse"},"TrackingCategory":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active","default":true},"source":{"type":"string","title":"Source","default":"manual"},"options":{"items":{"$ref":"#/components/schemas/TrackingOption"},"type":"array","title":"Options"},"used":{"type":"boolean","title":"Used","default":false}},"type":"object","required":["id","name"],"title":"TrackingCategory"},"TrackingCategoryListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__mj__schemas__TrackingCategoryItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"TrackingCategoryListResponse"},"TrackingColumnTag":{"properties":{"header":{"type":"string","title":"Header","description":"The unrecognized manual-GL upload column header to tag.","examples":["Department"]},"category_name":{"type":"string","title":"Category Name","description":"The tracking category to map this column to (created if new).","examples":["Region"]}},"type":"object","required":["header","category_name"],"title":"TrackingColumnTag"},"TrackingColumnsApplyResult":{"properties":{"applied":{"type":"integer","title":"Applied","default":0},"notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notice"}},"type":"object","title":"TrackingColumnsApplyResult","description":"Ack for applying manual tracking columns — count of columns tagged, plus an\noptional notice when some categories were brought in archived (active cap full)."},"TrackingColumnsPending":{"properties":{"candidates":{"items":{"type":"string"},"type":"array","title":"Candidates","default":[]}},"type":"object","title":"TrackingColumnsPending","description":"Unrecognized columns offered as manual tracking-category candidates."},"TrackingItem":{"properties":{"bs_index":{"type":"integer","title":"Bs Index","description":"0-based bank-statement line index to tag.","examples":[3]},"tracking":{"items":{"$ref":"#/components/schemas/TrackingTag-Input"},"type":"array","title":"Tracking","description":"Up to 2 tracking tags for the line; an empty list clears them."}},"type":"object","required":["bs_index"],"title":"TrackingItem"},"TrackingOption":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active","default":true},"used":{"type":"boolean","title":"Used","default":false}},"type":"object","required":["id","name"],"title":"TrackingOption"},"TrackingSchemaResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"provider_name":{"type":"string","title":"Provider Name","default":"manual"},"provider_tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Tenant Id"},"is_xero_connected":{"type":"boolean","title":"Is Xero Connected","default":false},"synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synced At"},"max_categories":{"type":"integer","title":"Max Categories","default":0},"max_active":{"type":"integer","title":"Max Active","default":0},"pending_changes":{"type":"integer","title":"Pending Changes","default":0},"categories":{"items":{"$ref":"#/components/schemas/TrackingCategory"},"type":"array","title":"Categories"}},"type":"object","required":["client_uuid"],"title":"TrackingSchemaResponse"},"TrackingTag-Input":{"properties":{"category":{"type":"string","title":"Category","description":"Xero tracking category name.","examples":["Region"]},"option":{"type":"string","title":"Option","description":"Tracking option within the category.","examples":["North"]}},"type":"object","required":["category","option"],"title":"TrackingTag"},"TrackingTag-Output":{"properties":{"category":{"type":"string","title":"Category"},"option":{"type":"string","title":"Option"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"option_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Option Id"}},"type":"object","required":["category","option"],"title":"TrackingTag","description":"One Xero tracking tag on a line: a category name + the chosen option name\n(e.g. category='Department', option='Sales'). Xero allows up to 2 per line.\n\nThe Xero GUIDs are carried too when known (``category_id``/``option_id``) so\nsync can post by stable ID — rename-proof against later edits in Xero. Names\nremain the human-readable fallback for older rows / hand-crafted payloads."},"TransactionQueryRequest":{"properties":{"start":{"type":"string","format":"date","title":"Start","description":"Inclusive start of the date window to list transactions for (ISO YYYY-MM-DD). Required.","examples":["2026-06-01"]},"end":{"type":"string","format":"date","title":"End","description":"Inclusive end of the date window (ISO YYYY-MM-DD). Required; must be on or after start (an end earlier than start is rejected with a validation error).","examples":["2026-06-30"]}},"type":"object","required":["start","end"],"title":"TransactionQueryRequest","description":"The date window the user is viewing — drives the read-through fetch when it runs past coverage."},"TransactionsResponse":{"properties":{"bank_account_uuid":{"type":"string","title":"Bank Account Uuid"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"count":{"type":"integer","title":"Count","default":0},"synced_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced From"},"synced_through":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced Through"},"fetched":{"type":"boolean","title":"Fetched","default":false},"live_feed":{"type":"boolean","title":"Live Feed","default":false},"partial":{"type":"boolean","title":"Partial","default":false},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"transactions":{"items":{"$ref":"#/components/schemas/BankTransactionItem"},"type":"array","title":"Transactions"}},"type":"object","required":["bank_account_uuid"],"title":"TransactionsResponse","description":"A date-ranged page of an account's transactions + what we've synced through.\n\n``fetched`` = we pulled live this request; ``live_feed`` = a feed is connected for this account;\n``partial`` = a live fetch was attempted but errored, so the set may be incomplete and any balance\nderived from it must be treated as provisional (the follow-up persists that as a confidence flag)."},"TreeNode":{"properties":{"key":{"type":"string","title":"Key"},"kind":{"type":"string","title":"Kind"},"label":{"type":"string","title":"Label"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid"},"file_count":{"type":"integer","title":"File Count","default":0},"has_children":{"type":"boolean","title":"Has Children","default":false},"children":{"items":{"$ref":"#/components/schemas/TreeNode"},"type":"array","title":"Children","default":[]}},"type":"object","required":["key","kind","label"],"title":"TreeNode"},"TreeResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/TreeNode"},"type":"array","title":"Nodes","default":[]}},"type":"object","title":"TreeResponse","description":"`GET /zbox/tree` — the firm-rooted org tree (root + a page of clients/jobs)."},"Turn":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role","description":"Who authored this replayed history turn.","examples":["user"]},"content":{"type":"string","maxLength":4000,"minLength":1,"title":"Content","description":"The turn's text; a historical turn longer than 4000 chars is clipped, never rejected.","examples":["What's the status of the ACME FY24 job?"]},"interrupted":{"type":"boolean","title":"Interrupted","description":"True if the user cut Ziffy off mid-reply on this turn.","default":false}},"type":"object","required":["role","content"],"title":"Turn"},"TurnView":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"seq":{"type":"integer","title":"Seq"},"at":{"type":"string","format":"date-time","title":"At"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"tools_used":{"items":{"type":"string"},"type":"array","title":"Tools Used"}},"type":"object","required":["role","content","seq","at"],"title":"TurnView","description":"One chat turn within a thread (wire view of a conversation_turn)."},"UnreadCountOut":{"properties":{"unread_count":{"type":"integer","title":"Unread Count"}},"type":"object","required":["unread_count"],"title":"UnreadCountOut"},"UpdateCellIn":{"properties":{"col":{"type":"string","minLength":1,"title":"Col","description":"Column key of the cell to edit (required — identifies the cell within the row).","examples":["gross"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value","description":"New cell value; null clears it.","examples":[120.5]}},"type":"object","required":["col"],"title":"UpdateCellIn"},"UpdateClientThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. The threshold override document to upsert — a SPARSE DELTA (only the leaves you want to override), keyed section -> key -> entry; the backend deep-merges it onto the inherited chain. Each leaf is a ThresholdEntry (options / selected_value / is_active / is_custom / custom_value). Send {} to record an empty override.","examples":[{"gl_code_materiality_thresholds":{"transactional_threshold":{"is_active":true,"is_custom":false,"options":[50,100,500],"selected_value":500}}}]}},"type":"object","required":["threshold_data"],"title":"UpdateClientThresholdsRequest"},"UpdateClientTypeThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. The threshold override document to upsert — a SPARSE DELTA (only the leaves you want to override), keyed section -> key -> entry; the backend deep-merges it onto the inherited chain. Each leaf is a ThresholdEntry (options / selected_value / is_active / is_custom / custom_value). Send {} to record an empty override.","examples":[{"gl_code_materiality_thresholds":{"transactional_threshold":{"is_active":true,"is_custom":false,"options":[50,100,500],"selected_value":500}}}]}},"type":"object","required":["threshold_data"],"title":"UpdateClientTypeThresholdsRequest"},"UpdateClientTypeWpThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. Sparse WP-threshold delta document keyed by workpaper code -> leaf (shape: WpThresholdEntry — workpaper_name / threshold_type / threshold_value / is_active). Only the overridden keys need be sent; the backend deep-merges this onto the inherited (MASTER->ORG->...) document for the target scope.","examples":[{"FIA":{"is_active":true,"threshold_type":"amount","threshold_value":"1000","workpaper_name":"Fixed Assets"}}]}},"type":"object","required":["threshold_data"],"title":"UpdateClientTypeWpThresholdsRequest"},"UpdateClientWpThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. Sparse WP-threshold delta document keyed by workpaper code -> leaf (shape: WpThresholdEntry — workpaper_name / threshold_type / threshold_value / is_active). Only the overridden keys need be sent; the backend deep-merges this onto the inherited (MASTER->ORG->...) document for the target scope.","examples":[{"FIA":{"is_active":true,"threshold_type":"amount","threshold_value":"1000","workpaper_name":"Fixed Assets"}}]}},"type":"object","required":["threshold_data"],"title":"UpdateClientWpThresholdsRequest"},"UpdateJobThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. The threshold override document to upsert — a SPARSE DELTA (only the leaves you want to override), keyed section -> key -> entry; the backend deep-merges it onto the inherited chain. Each leaf is a ThresholdEntry (options / selected_value / is_active / is_custom / custom_value). Send {} to record an empty override.","examples":[{"gl_code_materiality_thresholds":{"transactional_threshold":{"is_active":true,"is_custom":false,"options":[50,100,500],"selected_value":500}}}]}},"type":"object","required":["threshold_data"],"title":"UpdateJobThresholdsRequest"},"UpdateJobTypeThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. The threshold override document to upsert — a SPARSE DELTA (only the leaves you want to override), keyed section -> key -> entry; the backend deep-merges it onto the inherited chain. Each leaf is a ThresholdEntry (options / selected_value / is_active / is_custom / custom_value). Send {} to record an empty override.","examples":[{"gl_code_materiality_thresholds":{"transactional_threshold":{"is_active":true,"is_custom":false,"options":[50,100,500],"selected_value":500}}}]}},"type":"object","required":["threshold_data"],"title":"UpdateJobTypeThresholdsRequest"},"UpdateJobTypeWpThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. Sparse WP-threshold delta document keyed by workpaper code -> leaf (shape: WpThresholdEntry — workpaper_name / threshold_type / threshold_value / is_active). Only the overridden keys need be sent; the backend deep-merges this onto the inherited (MASTER->ORG->...) document for the target scope.","examples":[{"FIA":{"is_active":true,"threshold_type":"amount","threshold_value":"1000","workpaper_name":"Fixed Assets"}}]}},"type":"object","required":["threshold_data"],"title":"UpdateJobTypeWpThresholdsRequest"},"UpdateJobWpThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. Sparse WP-threshold delta document keyed by workpaper code -> leaf (shape: WpThresholdEntry — workpaper_name / threshold_type / threshold_value / is_active). Only the overridden keys need be sent; the backend deep-merges this onto the inherited (MASTER->ORG->...) document for the target scope.","examples":[{"FIA":{"is_active":true,"threshold_type":"amount","threshold_value":"1000","workpaper_name":"Fixed Assets"}}]}},"type":"object","required":["threshold_data"],"title":"UpdateJobWpThresholdsRequest"},"UpdateMappingIn":{"properties":{"parent_key":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Parent Key","description":"Target parent key to map the account(s) to. Send null to un-map. Optional — omit to leave the current mapping unchanged.","examples":["sales"]},"section":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Section","description":"Optional numbered section instance of the parent (multi-parent bases only).","examples":[1]},"account_uuids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Account Uuids","description":"Optional bulk multi-select: extra account UUIDs to map to the same parent_key in one atomic doc write.","examples":[["a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"]]}},"type":"object","title":"UpdateMappingIn"},"UpdateMappingOut":{"properties":{"coa_tb_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Coa Tb Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"match_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Type"},"needs_review":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Needs Review"},"section":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section"}},"additionalProperties":true,"type":"object","title":"UpdateMappingOut","description":"`PUT /coa/jobs/{uuid}/mappings/{coa_tb_id}` — the new mapping entry (empty\n``{}`` when the row was unmapped). Extra keys pass through unchanged."},"UpdateOrgThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. The threshold override document to upsert — a SPARSE DELTA (only the leaves you want to override), keyed section -> key -> entry; the backend deep-merges it onto the inherited chain. Each leaf is a ThresholdEntry (options / selected_value / is_active / is_custom / custom_value). Send {} to record an empty override.","examples":[{"gl_code_materiality_thresholds":{"transactional_threshold":{"is_active":true,"is_custom":false,"options":[50,100,500],"selected_value":500}}}]}},"type":"object","required":["threshold_data"],"title":"UpdateOrgThresholdsRequest"},"UpdateOrgWpThresholdsRequest":{"properties":{"threshold_data":{"additionalProperties":true,"type":"object","title":"Threshold Data","description":"Required. Sparse WP-threshold delta document keyed by workpaper code -> leaf (shape: WpThresholdEntry — workpaper_name / threshold_type / threshold_value / is_active). Only the overridden keys need be sent; the backend deep-merges this onto the inherited (MASTER->ORG->...) document for the target scope.","examples":[{"FIA":{"is_active":true,"threshold_type":"amount","threshold_value":"1000","workpaper_name":"Fixed Assets"}}]}},"type":"object","required":["threshold_data"],"title":"UpdateOrgWpThresholdsRequest"},"UpdateQuestionsRequest":{"properties":{"questions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Questions","description":"Single-element list holding the edited question's info object; questions[0] replaces the FIRM question's config. Omitting it clears the info.","examples":[[{"is_required":true,"question_name":"Total revenue","question_type":"TEXTBOX"}]]}},"type":"object","title":"UpdateQuestionsRequest"},"UploadFileSpec":{"properties":{"file_name":{"type":"string","maxLength":512,"minLength":1,"title":"File Name","description":"REQUIRED. Original file name incl. extension; used to build the S3 key and shown in Zbox.","examples":["march-invoice.pdf"]},"content_type":{"type":"string","maxLength":255,"title":"Content Type","description":"MIME type of the file; defaults to application/octet-stream when omitted.","default":"application/octet-stream","examples":["application/pdf"]},"size":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Size","description":"File size in bytes if known (advisory only; not enforced).","examples":[248193]}},"additionalProperties":true,"type":"object","required":["file_name"],"title":"UploadFileSpec"},"UploadResponse":{"properties":{"source_file_uuid":{"type":"string","title":"Source File Uuid"},"file_name":{"type":"string","title":"File Name"},"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status","default":"dispatched"},"background_id":{"type":"string","title":"Background Id"},"duplicate":{"type":"boolean","title":"Duplicate","default":false}},"type":"object","required":["source_file_uuid","file_name","run_id","background_id"],"title":"UploadResponse"},"UploadUrlsRequest":{"properties":{"level":{"anyOf":[{"type":"string","enum":["firm","client","job"]},{"type":"null"}],"title":"Level","description":"IGNORED on input — the level is INFERRED from which ids are present (no client/job → firm; client only → client; job → job). Kept optional for back-compat; the response echoes the resolved level.","examples":["job"]},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Optional client scope (UUID). Omit for a firm-level batch; send to scope to a client of the key's firm. If job_uuid is also sent it must match the job's client.","examples":["81bee014-b346-4256-837b-584a9e6f41da"]},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid","description":"Optional job scope (UUID). When present the batch is job-level and the job's own client is authoritative.","examples":["6f9619ff-8b86-d011-b42d-00cf4fc964ff"]},"files":{"items":{"$ref":"#/components/schemas/UploadFileSpec"},"type":"array","minItems":1,"title":"Files","description":"REQUIRED. One or more files to mint presigned upload URLs for (at least one; capped by partner_max_files_per_request).","examples":[[{"content_type":"application/pdf","file_name":"march-invoice.pdf","size":248193}]]}},"additionalProperties":true,"type":"object","required":["files"],"title":"UploadUrlsRequest"},"UploadUrlsResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"level":{"type":"string","enum":["firm","client","job"],"title":"Level"},"files":{"items":{"$ref":"#/components/schemas/IssuedFile"},"type":"array","title":"Files"}},"type":"object","required":["batch_id","level","files"],"title":"UploadUrlsResponse"},"UploadedFile":{"properties":{"category_sub":{"type":"string","title":"Category Sub"},"file_uuid":{"type":"string","title":"File Uuid"},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping"}},"type":"object","required":["category_sub","file_uuid"],"title":"UploadedFile","description":"One uploaded ZBox file linked to the job, addressable for removal."},"UploadedFileResponse":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"file_name":{"type":"string","title":"File Name"},"provider":{"type":"string","title":"Provider"},"external_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Folder Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Parent Key"},"category_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Source"},"category_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Sub"},"category_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Category Confidence"},"account_mapping":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Mapping"},"wp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Code"},"processing_state":{"type":"string","title":"Processing State","default":"INGESTED"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"link_count":{"type":"integer","title":"Link Count","default":0},"linked_to_target":{"type":"boolean","title":"Linked To Target","default":false},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"web_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Url"},"jobs":{"items":{"$ref":"#/components/schemas/JobRef"},"type":"array","title":"Jobs","default":[]},"extraction":{"additionalProperties":true,"type":"object","title":"Extraction","default":{}},"clients":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clients","default":[]},"blob_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blob Ref"}},"type":"object","required":["file_uuid","file_name","provider"],"title":"UploadedFileResponse","description":"`POST /zbox/files/upload` — the newly-stored file row plus its client tags and\nthe resolved blob reference."},"UserPayload":{"properties":{"id":{"type":"string","title":"Id"},"uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uuid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["id"],"title":"UserPayload"},"UserUpdateInFirm":{"properties":{"user_uuid":{"type":"string","title":"User Uuid","description":"UUID of the firm user to update (required — identifies the row).","examples":["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"]},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"New full name; omit to leave unchanged.","examples":["Jane Director"]},"role_level":{"anyOf":[{"type":"integer","enum":[1,2,3,4,5,6]},{"type":"null"}],"title":"Role Level","description":"New practice role level 1-6; omit to leave unchanged.","examples":[4]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Toggle the user active/inactive; omit to leave unchanged."},"is_deleted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Deleted","description":"Set true to soft-delete this firm user (drops out of the list); omit to leave unchanged."}},"type":"object","required":["user_uuid"],"title":"UserUpdateInFirm","description":"One firm-user change inside FirmUpdateRequest.users. `user_uuid` identifies\nthe target and is required; the remaining fields are partial (omit = unchanged)."},"UsersDropdownOut":{"properties":{"users":{"items":{"$ref":"#/components/schemas/MentionUser"},"type":"array","title":"Users","default":[]}},"type":"object","title":"UsersDropdownOut"},"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"},"ValidationIssue":{"properties":{"path":{"type":"string","title":"Path"},"message":{"type":"string","title":"Message"},"severity":{"type":"string","enum":["error","warning"],"title":"Severity","default":"error"},"artifact":{"type":"string","enum":["recipe","structure","formula_map","identity","coherence","guidelines"],"title":"Artifact","default":"recipe"}},"type":"object","required":["path","message"],"title":"ValidationIssue"},"ValidationResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"issues":{"items":{"$ref":"#/components/schemas/ValidationIssue"},"type":"array","title":"Issues"},"normalized":{"anyOf":[{"$ref":"#/components/schemas/WorkpaperDefinition"},{"type":"null"}]}},"type":"object","required":["ok"],"title":"ValidationResult"},"VerifyDnsResponse":{"properties":{"dkim_status":{"type":"string","title":"Dkim Status"},"dmarc_status":{"type":"string","title":"Dmarc Status"},"mail_from_status":{"type":"string","title":"Mail From Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["dkim_status","dmarc_status","mail_from_status","detail"],"title":"VerifyDnsResponse","description":"DNS auth status for the firm's sending domain (DKIM/DMARC/MAIL-FROM) plus a\nhuman note — reflects the persisted pending state until SES is provisioned."},"VersionItem":{"properties":{"version":{"type":"integer","title":"Version"},"superseded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded At"}},"type":"object","required":["version"],"title":"VersionItem"},"VersionsOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VersionItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"VersionsOut","description":"A definition's saved version history."},"ViewUrlOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"ViewUrlOut","description":"A single short-lived view/download URL (empty string when unavailable)."},"ViewUrlResponse":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"demo":{"type":"boolean","title":"Demo","default":false}},"type":"object","title":"ViewUrlResponse"},"VisibilityIn":{"properties":{"wp_code":{"type":"string","title":"Wp Code","description":"Workpaper code to hide/show.","examples":["OCA"]},"country":{"type":"string","title":"Country","description":"Country pack of the WP.","default":"NZ","examples":["NZ","AU"]},"scope":{"type":"string","enum":["platform","firm","client"],"title":"Scope","description":"Visibility scope: platform-wide, a single firm, or a single client.","default":"platform"},"scope_id":{"type":"string","title":"Scope Id","description":"Firm/client id the scope applies to; empty string for the platform scope.","default":"","examples":[""]},"hidden":{"type":"boolean","title":"Hidden","description":"true hides the WP for the scope (drops it from the catalogue + run set); false shows it.","default":true},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional free-text reason for the override."}},"type":"object","required":["wp_code"],"title":"VisibilityIn"},"VisibilityItem":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"country":{"type":"string","title":"Country"},"scope":{"type":"string","title":"Scope"},"scope_id":{"type":"string","title":"Scope Id"},"hidden":{"type":"boolean","title":"Hidden"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["wp_code","country","scope","scope_id","hidden"],"title":"VisibilityItem"},"VisibilityListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VisibilityItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"VisibilityListOut","description":"The stored per-scope visibility overrides."},"VoidResponse":{"properties":{"manual_journal_uuid":{"type":"string","title":"Manual Journal Uuid"},"status":{"type":"string","title":"Status"},"needs_partner_sync":{"type":"boolean","title":"Needs Partner Sync"}},"type":"object","required":["manual_journal_uuid","status","needs_partner_sync"],"title":"VoidResponse"},"WatchSnapshot":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"workpapers":{"items":{"$ref":"#/components/schemas/WpReadiness"},"type":"array","title":"Workpapers"},"pending_count":{"type":"integer","title":"Pending Count","default":0}},"type":"object","required":["job_uuid"],"title":"WatchSnapshot"},"WebSearchRequest":{"properties":{"query":{"type":"string","maxLength":300,"minLength":1,"title":"Query","description":"Merchant / transaction text to search the web for.","examples":["AMZN Mktp AU Sydney"]},"count":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Count","description":"How many results to return (1-10).","default":4,"examples":[4]}},"type":"object","required":["query"],"title":"WebSearchRequest","description":"Research one transaction's merchant on the web (the v3 per-row search drawer)."},"WorkpaperDashboardOut":{"properties":{"summary":{"$ref":"#/components/schemas/app__modules__workpapers__schemas__DashboardSummary"},"workpaper_view":{"items":{"$ref":"#/components/schemas/WorkpaperViewRow"},"type":"array","title":"Workpaper View"},"account_view":{"items":{"$ref":"#/components/schemas/AccountViewRow"},"type":"array","title":"Account View"}},"type":"object","title":"WorkpaperDashboardOut","description":"The dual-view dashboard payload — both views in one response (Z1 parity:\ntab switching is client-side, no re-fetch)."},"WorkpaperDefinition":{"properties":{"wp_code":{"type":"string","title":"Wp Code","description":"Workpaper code — UPPER_SNAKE, 2-40 chars, starts with a letter. Identifies the WP.","examples":["OCA"]},"country":{"type":"string","title":"Country","description":"Country pack this definition belongs to.","default":"NZ","examples":["NZ","AU"]},"wp_name":{"type":"string","title":"Wp Name","description":"Human-readable WP name; defaults to wp_code when blank.","default":"","examples":["Other Current Assets"]},"recipe":{"additionalProperties":true,"type":"object","title":"Recipe","description":"The WorkpaperSpec JSON (declarative recipe). Portal-authored WPs may not declare Python hooks."},"structure":{"additionalProperties":true,"type":"object","title":"Structure","description":"The v1 template WP-entry (tables/cells) that renders the WP."},"formula_map":{"additionalProperties":true,"type":"object","title":"Formula Map","description":"The FormulaMap entry for this wp_code (cell formulas/addresses)."},"guidelines":{"type":"string","title":"Guidelines","description":"Guidelines markdown shown alongside the WP.","default":""},"intelligence":{"additionalProperties":true,"type":"object","title":"Intelligence","description":"Reserved AI config — not authored via this API; send {} or omit."},"status":{"type":"string","enum":["draft","published"],"title":"Status","description":"draft = not in the run set; published = live in the run set.","default":"draft"}},"type":"object","required":["wp_code"],"title":"WorkpaperDefinition","description":"The single authored object — decomposes into the 3 runtime artifacts + guidelines."},"WorkpaperExportOut":{"properties":{"pdf_url":{"type":"string","title":"Pdf Url"}},"type":"object","required":["pdf_url"],"title":"WorkpaperExportOut","description":"Response of the PDF export route — a presigned download URL for the generated PDF."},"WorkpaperFieldValuesOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Name"}},"additionalProperties":true,"type":"object","required":["wp_code"],"title":"WorkpaperFieldValuesOut","description":"Payload of ``GET /{job}/{wp}/field`` — a WP's field values, or one field.\n\nTwo shapes ride through: the whole-WP read carries ``fields`` + ``dsh``; the\nsingle-``field_id`` read carries ``field_id``/``found``/``label``/``value``.\nDocumented loosely (``extra='allow'``) so neither shape is dropped."},"WorkpaperListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobWorkpaperItem"},"type":"array","title":"Items"}},"type":"object","title":"WorkpaperListOut","description":"Payload of ``GET /{job}/workpapers`` — the job's workpapers + per-GL balance."},"WorkpaperNotes":{"properties":{"workpaper_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Code"},"workpaper_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workpaper Name"},"notes":{"items":{"$ref":"#/components/schemas/NoteOut"},"type":"array","title":"Notes","default":[]}},"type":"object","title":"WorkpaperNotes","description":"One workpaper's notes (the many-notes list for a single WP)."},"WorkpaperRunIn":{"properties":{"wp_codes":{"items":{"type":"string"},"type":"array","title":"Wp Codes","description":"Scope the async run to these workpaper codes; empty ⇒ all eligible workpapers.","examples":[["EXP"]]}},"type":"object","title":"WorkpaperRunIn","description":"Body for POST /workpapers/jobs/{job_uuid}/runs (async dispatch — the\nstudio's run-progress dock). Empty ``wp_codes`` ⇒ all eligible workpapers."},"WorkpaperRunResultOut":{"properties":{},"additionalProperties":true,"type":"object","title":"WorkpaperRunResultOut","description":"Payload of the run-result routes (``.../sections/{id}/expand``) — the raw\n``run_automation`` result (workpapers/filled/skipped/trace_id + engine extras)."},"WorkpaperSectionOut":{"properties":{},"additionalProperties":true,"type":"object","title":"WorkpaperSectionOut","description":"Payload of ``POST /{job}/{wp}/live-compute`` — the recomputed WorkpaperRecord\nsection dict (engine-owned shape; documented loosely, not persisted)."},"WorkpaperViewOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wp Name"},"section_type":{"type":"string","title":"Section Type","default":"Standard"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"summary":{"items":{"$ref":"#/components/schemas/SummaryCellOut"},"type":"array","title":"Summary"},"dsh":{"$ref":"#/components/schemas/DshOut"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"}},"type":"object","required":["wp_code"],"title":"WorkpaperViewOut"},"WorkpaperViewRow":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"gl_closing_bal":{"type":"number","title":"Gl Closing Bal","default":0.0},"wp_bal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wp Bal"},"variance":{"type":"number","title":"Variance","default":0.0},"reconciled":{"type":"boolean","title":"Reconciled","default":false},"account_count":{"type":"integer","title":"Account Count","default":0},"notes_count":{"type":"integer","title":"Notes Count","default":0},"has_unread_notes":{"type":"boolean","title":"Has Unread Notes","default":false},"accounts":{"items":{"$ref":"#/components/schemas/DashboardAccountRow"},"type":"array","title":"Accounts"},"prior_yr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Prior Yr"},"prior_variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Prior Variance"},"gl_vs_prior_variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gl Vs Prior Variance"}},"type":"object","required":["wp_code","wp_name"],"title":"WorkpaperViewRow","description":"One workpaper in the \"By Workpaper\" view (its accounts nested)."},"WorkspaceClient":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"selectable":{"type":"boolean","title":"Selectable","default":true},"jobs":{"items":{"$ref":"#/components/schemas/WorkspaceJob"},"type":"array","title":"Jobs"}},"type":"object","required":["client_uuid","client_name"],"title":"WorkspaceClient"},"WorkspaceJob":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"job_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Name"},"job_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Code"}},"type":"object","required":["job_uuid"],"title":"WorkspaceJob"},"WorkspaceSearchResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceClient"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","default":0},"limit":{"type":"integer","title":"Limit","default":50},"offset":{"type":"integer","title":"Offset","default":0}},"type":"object","title":"WorkspaceSearchResponse"},"WpCandidateOut":{"properties":{"candidate_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Candidate Uuid"},"origin":{"type":"string","title":"Origin"},"wp_code":{"type":"string","title":"Wp Code"},"candidate_key":{"type":"string","title":"Candidate Key"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"status":{"type":"string","title":"Status"}},"type":"object","required":["origin","wp_code","candidate_key","title","description","status"],"title":"WpCandidateOut","description":"A candidate returned to the client. candidate_uuid is None for derived\n(not-yet-persisted) missing-doc candidates."},"WpCandidatesResponse":{"properties":{"decisions":{"items":{"$ref":"#/components/schemas/WpDecisionOut"},"type":"array","title":"Decisions"},"anomalies":{"items":{"$ref":"#/components/schemas/WpCandidateOut"},"type":"array","title":"Anomalies"}},"type":"object","required":["decisions","anomalies"],"title":"WpCandidatesResponse"},"WpConfigAddableParent":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"}},"type":"object","required":["key","name"],"title":"WpConfigAddableParent","description":"One INDEPENDENT (non-sibling) base parent a ``+ Add`` may create another instance of — e.g. CAC's\nBeneficiary/Shareholder/Partner/Individual's Current Account. Populated only when a workpaper's numbered\nfamily has MORE THAN ONE such base (``config_loader.base_parent_keys`` > 1 entry); empty for a true single-\nfamily numbered WP (TLN/HPR/…), which keeps the one generic job-level \"+ Add Section\" unchanged."},"WpConfigBase":{"properties":{"files":{"items":{"$ref":"#/components/schemas/WpConfigFile"},"type":"array","title":"Files"}},"type":"object","title":"WpConfigBase"},"WpConfigCategory":{"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"is_multifiles":{"type":"boolean","title":"Is Multifiles","default":false}},"type":"object","title":"WpConfigCategory"},"WpConfigFile":{"properties":{"file_uuid":{"type":"string","title":"File Uuid"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["file_uuid"],"title":"WpConfigFile"},"WpConfigParentMap":{"properties":{"parent_key":{"type":"string","title":"Parent Key"},"account_uuids":{"items":{"type":"string"},"type":"array","title":"Account Uuids"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_multi":{"type":"boolean","title":"Is Multi","default":true}},"type":"object","required":["parent_key"],"title":"WpConfigParentMap"},"WpConfigSection":{"properties":{"section_index":{"type":"integer","title":"Section Index"},"section_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Key"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"mapping":{"items":{"$ref":"#/components/schemas/WpConfigParentMap"},"type":"array","title":"Mapping"},"files":{"items":{"$ref":"#/components/schemas/WpConfigFile"},"type":"array","title":"Files"},"manual":{"type":"boolean","title":"Manual","default":false}},"type":"object","required":["section_index"],"title":"WpConfigSection"},"WpConfigWorkpaper":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"name":{"type":"string","title":"Name"},"categories":{"items":{"$ref":"#/components/schemas/WpConfigCategory"},"type":"array","title":"Categories"},"base":{"$ref":"#/components/schemas/WpConfigBase"},"sections":{"items":{"$ref":"#/components/schemas/WpConfigSection"},"type":"array","title":"Sections"},"section_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Mode"},"addable_parents":{"items":{"$ref":"#/components/schemas/WpConfigAddableParent"},"type":"array","title":"Addable Parents"},"sectionable_parents":{"items":{"$ref":"#/components/schemas/WpConfigAddableParent"},"type":"array","title":"Sectionable Parents"},"account_rows_editable":{"type":"boolean","title":"Account Rows Editable","default":true}},"type":"object","required":["wp_code","name"],"title":"WpConfigWorkpaper","description":"The per-job config doc for one workpaper — the growing mapping-view artifact."},"WpDecisionOut":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"origin":{"type":"string","title":"Origin"},"candidate_key":{"type":"string","title":"Candidate Key"},"status":{"type":"string","title":"Status"},"query_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Uuid"}},"type":"object","required":["wp_code","origin","candidate_key","status"],"title":"WpDecisionOut","description":"A persisted decision on a missing-doc candidate (discarded/posted)."},"WpEditLogEntry":{"properties":{"wp_cell_edit_id":{"type":"integer","title":"Wp Cell Edit Id"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"editor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Editor Email"},"wp_code":{"type":"string","title":"Wp Code"},"field_id":{"type":"string","title":"Field Id"},"cell_ref":{"type":"string","title":"Cell Ref"},"col":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Col"},"value":{"title":"Value"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["wp_cell_edit_id","at","editor_email","wp_code","field_id","cell_ref","col","value","reason"],"title":"WpEditLogEntry","description":"One row from ``wp_cell_edit`` — a user-edited cell audit record."},"WpReadiness":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"ready":{"type":"boolean","title":"Ready"},"required_categories":{"items":{"type":"string"},"type":"array","title":"Required Categories"},"missing_categories":{"items":{"type":"string"},"type":"array","title":"Missing Categories"},"missing_needs":{"items":{"$ref":"#/components/schemas/CategoryNeed"},"type":"array","title":"Missing Needs"}},"type":"object","required":["wp_code","wp_name","ready"],"title":"WpReadiness"},"WpSignoffIssues":{"properties":{"wp_code":{"type":"string","title":"Wp Code"},"wp_name":{"type":"string","title":"Wp Name"},"ready":{"type":"boolean","title":"Ready"},"issue_count":{"type":"integer","title":"Issue Count","default":0},"issues":{"items":{"$ref":"#/components/schemas/SignoffIssue"},"type":"array","title":"Issues"}},"type":"object","required":["wp_code","wp_name","ready"],"title":"WpSignoffIssues","description":"A workpaper's sign-off issue checklist. ``ready`` when ``issues`` is empty."},"WriteResult":{"properties":{"condition_ids":{"items":{"type":"integer"},"type":"array","title":"Condition Ids"},"created":{"type":"integer","title":"Created","default":0},"updated":{"type":"integer","title":"Updated","default":0}},"type":"object","required":["condition_ids"],"title":"WriteResult"},"XeroAdoptTenantRequest":{"properties":{"xero_tenant_uuid":{"type":"string","title":"Xero Tenant Uuid","description":"Required. Zato xero_tenant_uuid of the authorised Xero org to adopt onto this client (from GET /clients/{uuid}/tenant-options).","examples":["7f3c1e2a-9b44-4d6f-8a12-0c9e5b7d1234"]}},"type":"object","required":["xero_tenant_uuid"],"title":"XeroAdoptTenantRequest","description":"Bind the chosen org to this client and overwrite its data from Xero."},"XeroAdoptTenantResult":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"xero_tenant_uuid":{"type":"string","title":"Xero Tenant Uuid"}},"type":"object","required":["client_uuid","client_name","xero_tenant_uuid"],"title":"XeroAdoptTenantResult","description":"Result of adopting one Xero org onto a client (overwrites the client's data)."},"XeroAdoptTenantsBatchRequest":{"properties":{"primary_tenant_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Tenant Uuid","description":"Optional. Org to bind to THIS client (overwrites its data). Omit if the user only wants to act on other orgs.","examples":["7f3c1e2a-9b44-4d6f-8a12-0c9e5b7d1234"]},"adopt_disconnected":{"items":{"type":"string"},"type":"array","title":"Adopt Disconnected","description":"Optional (defaults to empty). Tenant uuids of soft-deleted mappings to reconnect to their prior client.","examples":[[]]},"create_new":{"items":{"type":"string"},"type":"array","title":"Create New","description":"Optional (defaults to empty). Tenant uuids of new orgs to onboard as brand-new Zato clients.","examples":[[]]}},"type":"object","title":"XeroAdoptTenantsBatchRequest","description":"Batch adopt: bind the primary org to this client, reconnect previously-\ndisconnected ones, and create new clients for brand-new orgs."},"XeroAdoptTenantsResult":{"properties":{"this_client":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"This Client"},"onboarded":{"title":"Onboarded"}},"additionalProperties":true,"type":"object","title":"XeroAdoptTenantsResult","description":"Result of a batch adopt: the primary-org bind plus any newly onboarded orgs."},"XeroBankAccountItem":{"properties":{"account_id":{"type":"string","title":"Account Id"},"code":{"type":"string","title":"Code","default":""},"name":{"type":"string","title":"Name","default":""},"bank_account_number":{"type":"string","title":"Bank Account Number","default":""}},"type":"object","required":["account_id"],"title":"XeroBankAccountItem","description":"One ACTIVE Xero bank account the coded lines can be pushed to. Referenced by\nthe stable AccountID — many Xero bank accounts have no Code."},"XeroBankAccountsResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"eligible":{"type":"boolean","title":"Eligible","default":true},"bank_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Source"},"bank_columns":{"items":{"type":"string"},"type":"array","title":"Bank Columns"},"suggested_amount_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Amount Column"},"codable_count":{"type":"integer","title":"Codable Count","default":0},"already_pushed_count":{"type":"integer","title":"Already Pushed Count","default":0},"bank_accounts":{"items":{"$ref":"#/components/schemas/XeroBankAccountItem"},"type":"array","title":"Bank Accounts"}},"type":"object","required":["ac_job_uuid"],"title":"XeroBankAccountsResponse"},"XeroBoundClient":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","required":["client_uuid","client_name"],"title":"XeroBoundClient","description":"The Zato client a tenant is (or was) bound to — set only for reconnect candidates."},"XeroClientStatusResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"is_connected":{"type":"boolean","title":"Is Connected"},"xero_tenant_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xero Tenant Uuid"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"tenant_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Type"},"bound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bound At"}},"type":"object","required":["client_uuid","is_connected","xero_tenant_uuid","tenant_name","tenant_type","bound_at"],"title":"XeroClientStatusResponse"},"XeroConnectRequest":{"properties":{"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Optional. If provided, the FIRST tenant returned by Xero gets auto-bound to this client on callback (so the user doesn't have to pick afterwards).","examples":["550e8400-e29b-41d4-a716-446655440000"]},"token_type":{"type":"string","title":"Token Type","description":"Optional (defaults to 'XERO'). 'XERO' for accounting GL flow, 'XPM' for Practice Manager flow.","default":"XERO","examples":["XERO"]},"pick_org":{"type":"boolean","title":"Pick Org","description":"Optional (defaults to false). When true (client-scoped 'connect this client to Xero' flow), the callback only establishes the connection + discovers orgs — it does NOT auto-bind the first tenant or auto-onboard clients. The UI then lists the authorized orgs and the user picks one to adopt onto this client.","default":false,"examples":[false]}},"type":"object","title":"XeroConnectRequest","description":"Body of POST /xero/connect."},"XeroConnectResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorize_url","state"],"title":"XeroConnectResponse"},"XeroReportResponse":{"properties":{"report_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Id"},"report_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Name"},"report_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Type"},"report_titles":{"items":{},"type":"array","title":"Report Titles"},"report_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Date"},"updated_date_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated Date Utc"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["report_id","report_name","report_type","report_titles","report_date","updated_date_utc","rows"],"title":"XeroReportResponse","description":"A named live Xero report (Balance Sheet, P&L, …) in its native row structure."},"XeroSyncJobSummary":{"properties":{"xero_sync_job_uuid":{"type":"string","title":"Xero Sync Job Uuid"},"status":{"type":"string","title":"Status"},"resource_type":{"type":"string","title":"Resource Type"},"report_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Report Date"},"trace_id":{"type":"string","title":"Trace Id"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"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"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["xero_sync_job_uuid","status","resource_type","report_date","trace_id","error_message","started_at","finished_at","created_at","updated_at"],"title":"XeroSyncJobSummary"},"XeroSyncPreviewLine":{"properties":{"bs_index":{"type":"integer","title":"Bs Index"},"type":{"type":"string","title":"Type"},"amount":{"type":"number","title":"Amount"},"account_code":{"type":"string","title":"Account Code"},"from_code":{"type":"string","title":"From Code","default":""},"contact":{"type":"string","title":"Contact","default":""},"description":{"type":"string","title":"Description","default":""},"net":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net"},"gst":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gst"},"tax_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type"},"splits":{"anyOf":[{"items":{"$ref":"#/components/schemas/XeroSyncSplitLeg"},"type":"array"},{"type":"null"}],"title":"Splits"}},"type":"object","required":["bs_index","type","amount","account_code"],"title":"XeroSyncPreviewLine"},"XeroSyncPreviewResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"bank_account_id":{"type":"string","title":"Bank Account Id"},"to_push":{"type":"integer","title":"To Push","default":0},"to_recode":{"type":"integer","title":"To Recode","default":0},"to_match":{"type":"integer","title":"To Match","default":0},"total_spend":{"type":"number","title":"Total Spend","default":0.0},"total_receive":{"type":"number","title":"Total Receive","default":0.0},"lines":{"items":{"$ref":"#/components/schemas/XeroSyncPreviewLine"},"type":"array","title":"Lines"},"recodes":{"items":{"$ref":"#/components/schemas/XeroSyncPreviewLine"},"type":"array","title":"Recodes"},"matched":{"items":{"$ref":"#/components/schemas/XeroSyncPreviewLine"},"type":"array","title":"Matched"},"skipped":{"items":{"$ref":"#/components/schemas/XeroSyncSkip"},"type":"array","title":"Skipped"}},"type":"object","required":["ac_job_uuid","bank_account_id"],"title":"XeroSyncPreviewResponse"},"XeroSyncRequest":{"properties":{"bank_account_id":{"type":"string","minLength":1,"title":"Bank Account Id","description":"Xero AccountID of the target bank account (stable; bank accounts may have no Code).","examples":["297c2dc5-cc47-4afd-8ec8-74990b8761e9"]},"amount_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Column","description":"Which bank column holds the amount; omit to auto-detect server-side.","examples":["Amount"]},"spend_when_negative":{"type":"boolean","title":"Spend When Negative","description":"True: a negative amount = money out = SPEND. False: positive = SPEND.","default":true},"bs_indices":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Bs Indices","description":"Optional subset of bank-line indices to push; null/omitted ⇒ every coded line, empty list ⇒ nothing.","examples":[[0,2,5]]}},"type":"object","required":["bank_account_id"],"title":"XeroSyncRequest","description":"Push parameters confirmed by the user at review time."},"XeroSyncResultResponse":{"properties":{"ac_job_uuid":{"type":"string","title":"Ac Job Uuid"},"pushed":{"type":"integer","title":"Pushed","default":0},"recoded":{"type":"integer","title":"Recoded","default":0},"failed":{"type":"integer","title":"Failed","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors"}},"type":"object","required":["ac_job_uuid"],"title":"XeroSyncResultResponse"},"XeroSyncSkip":{"properties":{"bs_index":{"type":"integer","title":"Bs Index"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["bs_index","reason"],"title":"XeroSyncSkip"},"XeroSyncSplitLeg":{"properties":{"account_code":{"type":"string","title":"Account Code"},"amount":{"type":"number","title":"Amount"},"net":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net"},"gst":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gst"},"tax_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Type"}},"type":"object","required":["account_code","amount"],"title":"XeroSyncSplitLeg","description":"One allocation of a split line to an account (with its own net/GST)."},"XeroSyncTrialBalanceRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"Required. Zato client_uuid whose bound Xero tenant to sync.","examples":["550e8400-e29b-41d4-a716-446655440000"]},"job_uuid":{"type":"string","title":"Job Uuid","description":"Required. Zato job_uuid the synced trial balance is stored against.","examples":["9c1b2d3e-4f56-4789-a012-b3c4d5e6f789"]},"xero_tenant_uuid":{"type":"string","title":"Xero Tenant Uuid","description":"Required. Zato xero_tenant_uuid of the org to pull the trial balance from.","examples":["7f3c1e2a-9b44-4d6f-8a12-0c9e5b7d1234"]},"report_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Report Date","description":"Optional as-at date for the trial balance (defaults to today).","examples":["2026-03-31"]}},"type":"object","required":["client_uuid","job_uuid","xero_tenant_uuid"],"title":"XeroSyncTrialBalanceRequest"},"XeroTenantBindRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"Required. Zato client_uuid to bind this firm Xero tenant to.","examples":["550e8400-e29b-41d4-a716-446655440000"]}},"type":"object","required":["client_uuid"],"title":"XeroTenantBindRequest"},"XeroTenantBindResponse":{"properties":{"xero_tenant_uuid":{"type":"string","title":"Xero Tenant Uuid"},"client_uuid":{"type":"string","title":"Client Uuid"},"bound_at":{"type":"string","format":"date-time","title":"Bound At"}},"type":"object","required":["xero_tenant_uuid","client_uuid","bound_at"],"title":"XeroTenantBindResponse"},"XeroTenantCandidate":{"properties":{"tenant_uuid":{"type":"string","title":"Tenant Uuid"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"category":{"type":"string","title":"Category"},"bound_client":{"anyOf":[{"$ref":"#/components/schemas/XeroBoundClient"},{"type":"null"}]},"match_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Reason"}},"type":"object","required":["tenant_uuid","tenant_name","category"],"title":"XeroTenantCandidate","description":"One authorised Xero org, classified relative to the client being connected."},"XeroTenantListResponse":{"properties":{"tenants":{"items":{"$ref":"#/components/schemas/XeroTenantSummary"},"type":"array","title":"Tenants"}},"type":"object","required":["tenants"],"title":"XeroTenantListResponse"},"XeroTenantOptionsResponse":{"properties":{"this_client":{"$ref":"#/components/schemas/XeroBoundClient"},"candidates":{"items":{"$ref":"#/components/schemas/XeroTenantCandidate"},"type":"array","title":"Candidates"}},"type":"object","required":["this_client","candidates"],"title":"XeroTenantOptionsResponse","description":"All authorised orgs for the firm, classified for the connecting client."},"XeroTenantSummary":{"properties":{"xero_tenant_uuid":{"type":"string","title":"Xero Tenant Uuid"},"xero_tenant_external_id":{"type":"string","title":"Xero Tenant External Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"tenant_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Type"},"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid"},"is_active":{"type":"boolean","title":"Is Active"},"bound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Bound At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["xero_tenant_uuid","xero_tenant_external_id","tenant_name","tenant_type","client_uuid","is_active","bound_at","created_at"],"title":"XeroTenantSummary"},"XeroTrialBalanceResponse":{"properties":{"job_uuid":{"type":"string","title":"Job Uuid"},"report_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Date"},"rows":{"items":{"$ref":"#/components/schemas/XeroTrialBalanceRow"},"type":"array","title":"Rows"},"totals":{"additionalProperties":{"type":"number"},"type":"object","title":"Totals"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Status"}},"type":"object","required":["job_uuid","report_date","rows","totals","last_synced_at","sync_status"],"title":"XeroTrialBalanceResponse"},"XeroTrialBalanceRow":{"properties":{"xero_trial_balance_uuid":{"type":"string","title":"Xero Trial Balance Uuid"},"section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Debit"},"credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit"},"ytd_debit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ytd Debit"},"ytd_credit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ytd Credit"},"balance_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Type"},"account_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Uuid"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"}},"type":"object","required":["xero_trial_balance_uuid","section","account_code","account_name","debit","credit","ytd_debit","ytd_credit","balance_type"],"title":"XeroTrialBalanceRow"},"XpmAuthResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorize_url","state"],"title":"XpmAuthResponse","description":"The Xero authorize URL + minted OAuth state for the XPM connect popup."},"XpmAuthStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"}},"type":"object","required":["connected"],"title":"XpmAuthStatusResponse","description":"XPM connection poll result for the popup to check after it closes."},"XpmSyncResult":{"properties":{"tenants_synced":{"type":"integer","title":"Tenants Synced"},"pm_tenants":{"type":"integer","title":"Pm Tenants"},"jobs_upserted":{"type":"integer","title":"Jobs Upserted"}},"type":"object","required":["tenants_synced","pm_tenants","jobs_upserted"],"title":"XpmSyncResult","description":"Result of refreshing PRACTICEMANAGER tenant + connection state (no job import)."},"XpmTenantsResponse":{"properties":{"tenants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tenants"}},"type":"object","required":["tenants"],"title":"XpmTenantsResponse","description":"PRACTICEMANAGER tenants connected to the firm."},"ZatoJobOut":{"properties":{"id":{"type":"string","title":"Id"},"clientUuid":{"type":"string","title":"Clientuuid"},"clientName":{"type":"string","title":"Clientname"},"jobName":{"type":"string","title":"Jobname"},"fullName":{"type":"string","title":"Fullname"}},"type":"object","required":["id","clientUuid","clientName","jobName","fullName"],"title":"ZatoJobOut"},"ZatoJobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/ZatoJobOut"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"ZatoJobsResponse"},"app__api__envelope_models__Envelope_AssigneeListResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__domain_support__schemas__AssigneeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AssigneeListResponse]"},"app__api__envelope_models__Envelope_AssigneeListResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__assignments__router__AssigneeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[AssigneeListResponse]"},"app__api__envelope_models__Envelope_BranchListResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__organization__org_schemas__BranchListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BranchListResponse]"},"app__api__envelope_models__Envelope_BranchListResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__practice__schemas__BranchListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[BranchListResponse]"},"app__api__envelope_models__Envelope_ClientListResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__coa__schemas_responses__ClientListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientListResponse]"},"app__api__envelope_models__Envelope_ClientListResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__client_management__schemas__ClientListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientListResponse]"},"app__api__envelope_models__Envelope_ClientListResponse___3":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__client_portal__schemas__ClientListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientListResponse]"},"app__api__envelope_models__Envelope_ClientMappingsResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__xero__schemas_docs__ClientMappingsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientMappingsResponse]"},"app__api__envelope_models__Envelope_ClientMappingsResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__fyi__schemas__ClientMappingsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ClientMappingsResponse]"},"app__api__envelope_models__Envelope_CredentialStatusResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__sharepoint__schemas__CredentialStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CredentialStatusResponse]"},"app__api__envelope_models__Envelope_CredentialStatusResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__dropbox__schemas__CredentialStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CredentialStatusResponse]"},"app__api__envelope_models__Envelope_CredentialStatusResponse___3":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__googledrive__schemas__CredentialStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CredentialStatusResponse]"},"app__api__envelope_models__Envelope_CredentialStatusResponse___4":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__onedrive__schemas__CredentialStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CredentialStatusResponse]"},"app__api__envelope_models__Envelope_CredentialStatusResponse___5":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__fyi__schemas__CredentialStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[CredentialStatusResponse]"},"app__api__envelope_models__Envelope_FileViewUrlResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__zbox__schemas__FileViewUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileViewUrlResponse]"},"app__api__envelope_models__Envelope_FileViewUrlResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__questionnaire__schemas_recipient__FileViewUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FileViewUrlResponse]"},"app__api__envelope_models__Envelope_FirmUsersResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__organization__org_schemas__FirmUsersResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmUsersResponse]"},"app__api__envelope_models__Envelope_FirmUsersResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__practice__schemas__FirmUsersResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[FirmUsersResponse]"},"app__api__envelope_models__Envelope_JobListResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__coa__schemas_responses__JobListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobListResponse]"},"app__api__envelope_models__Envelope_JobListResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__jobs__schemas__JobListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobListResponse]"},"app__api__envelope_models__Envelope_JobTypeListResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__jobs__schemas__JobTypeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobTypeListResponse]"},"app__api__envelope_models__Envelope_JobTypeListResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__thresholds__materiality_thresholds__schemas__JobTypeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobTypeListResponse]"},"app__api__envelope_models__Envelope_JobTypeListResponse___3":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__thresholds__wp_threshold__schemas__JobTypeListResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[JobTypeListResponse]"},"app__api__envelope_models__Envelope_ResendInviteResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__organization__org_schemas__ResendInviteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResendInviteResponse]"},"app__api__envelope_models__Envelope_ResendInviteResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__practice__schemas__ResendInviteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[ResendInviteResponse]"},"app__api__envelope_models__Envelope_SaveCredentialsResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__sharepoint__schemas__SaveCredentialsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveCredentialsResponse]"},"app__api__envelope_models__Envelope_SaveCredentialsResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__dropbox__schemas__SaveCredentialsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveCredentialsResponse]"},"app__api__envelope_models__Envelope_SaveCredentialsResponse___3":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__onedrive__schemas__SaveCredentialsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveCredentialsResponse]"},"app__api__envelope_models__Envelope_SaveCredentialsResponse___4":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__fyi__schemas__SaveCredentialsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SaveCredentialsResponse]"},"app__api__envelope_models__Envelope_SendResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__messaging__schemas__SendResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SendResponse]"},"app__api__envelope_models__Envelope_SendResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__questionnaire__schemas__SendResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[SendResponse]"},"app__api__envelope_models__Envelope_WebSearchResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__WebSearchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WebSearchResponse]"},"app__api__envelope_models__Envelope_WebSearchResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/app__modules__knowledge__schemas__WebSearchResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{}},"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["data"],"title":"Envelope[WebSearchResponse]"},"app__modules__assignments__router__AssigneeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__assignments__router__AssigneeRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AssigneeListResponse"},"app__modules__assignments__router__AssigneeRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"type":{"type":"string","title":"Type","default":"member"}},"type":"object","required":["user_uuid"],"title":"AssigneeRow"},"app__modules__auth__schemas__VerifyOtpRequest":{"properties":{"code":{"type":"string","maxLength":10,"minLength":4,"title":"Code","description":"Required. The one-time passcode emailed after the password step (dev OTP = 123456). Paired with the pre_session cookie.","examples":["123456"]}},"type":"object","required":["code"],"title":"VerifyOtpRequest"},"app__modules__autocoding__schemas__BankAccountsResponse":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"provider":{"type":"string","title":"Provider","default":""},"accounts":{"items":{"$ref":"#/components/schemas/BankAccountItem"},"type":"array","title":"Accounts"},"coa_bank_accounts":{"items":{"$ref":"#/components/schemas/CoaBankOption"},"type":"array","title":"Coa Bank Accounts"}},"type":"object","required":["client_uuid"],"title":"BankAccountsResponse"},"app__modules__autocoding__schemas__LinkClientRequest":{"properties":{"client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Uuid","description":"Client UUID to link the run to; null clears the existing link.","examples":["c1f2e3d4-5678-90ab-cdef-1234567890ab"]}},"type":"object","title":"LinkClientRequest","description":"Link (or re-link) an autocoding run to a client (partial update)."},"app__modules__autocoding__schemas__RecodeRequest":{"properties":{"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code","description":"Target account code for the line; null clears the chosen code.","examples":["4000"]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional override note on the line (defaults to 'Recoded').","examples":["Recoded"]}},"type":"object","title":"RecodeRequest","description":"Manually set (or clear) one bank line's account code."},"app__modules__autocoding__schemas__TaxRateItem":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name","default":""},"rate_percent":{"type":"number","title":"Rate Percent","default":0.0}},"type":"object","required":["code"],"title":"TaxRateItem","description":"One switchable tax rate (provider TaxType code + label + percent)."},"app__modules__autocoding__schemas__TrackingCategoryItem":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name","default":""},"options":{"items":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__TrackingOptionItem"},"type":"array","title":"Options"}},"type":"object","title":"TrackingCategoryItem"},"app__modules__autocoding__schemas__TrackingOptionItem":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name","default":""}},"type":"object","title":"TrackingOptionItem"},"app__modules__autocoding__schemas__WebSearchResponse":{"properties":{"query":{"type":"string","title":"Query","default":""},"results":{"items":{"$ref":"#/components/schemas/app__modules__autocoding__schemas__WebSearchResult"},"type":"array","title":"Results"}},"type":"object","title":"WebSearchResponse"},"app__modules__autocoding__schemas__WebSearchResult":{"properties":{"title":{"type":"string","title":"Title","default":""},"url":{"type":"string","title":"Url","default":""},"snippet":{"type":"string","title":"Snippet","default":""}},"type":"object","title":"WebSearchResult"},"app__modules__client_management__schemas__ClientListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"ClientListResponse"},"app__modules__client_portal__schemas__ClientListResponse":{"properties":{"clients":{"items":{"$ref":"#/components/schemas/app__modules__client_portal__schemas__ClientOption"},"type":"array","title":"Clients"}},"type":"object","required":["clients"],"title":"ClientListResponse"},"app__modules__client_portal__schemas__ClientOption":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["client_uuid","client_name","is_active"],"title":"ClientOption"},"app__modules__coa__schemas__AddSectionIn":{"properties":{"base_parent_key":{"type":"string","maxLength":255,"minLength":1,"title":"Base Parent Key","description":"REQUIRED. The multi-parent base parent key to create the next numbered section instance of (e.g. 'term_loan' → 'term_loan 1').","examples":["term_loan"]}},"type":"object","required":["base_parent_key"],"title":"AddSectionIn"},"app__modules__coa__schemas_responses__ClientListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClientOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ClientListResponse","description":"`GET /coa/clients` — firm clients for the COA picker."},"app__modules__coa__schemas_responses__JobListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JobListResponse","description":"`GET /coa/clients/{uuid}/jobs` — COA jobs for a client."},"app__modules__dashboard__schemas__DashboardSummary":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"scope":{"type":"string","title":"Scope"},"active_job_count":{"type":"integer","title":"Active Job Count"},"stage_counts":{"items":{"$ref":"#/components/schemas/StageCount"},"type":"array","title":"Stage Counts"},"sign_off_velocity_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sign Off Velocity Days"},"sign_off_velocity_sample_size":{"type":"integer","title":"Sign Off Velocity Sample Size"},"overdue_query_count":{"type":"integer","title":"Overdue Query Count"},"query_sla_days":{"type":"integer","title":"Query Sla Days"},"decision_items":{"items":{"$ref":"#/components/schemas/DecisionItem"},"type":"array","title":"Decision Items"},"decision_items_total":{"type":"integer","title":"Decision Items Total"},"narrative":{"type":"string","title":"Narrative"},"narrative_source":{"type":"string","title":"Narrative Source"}},"type":"object","required":["generated_at","scope","active_job_count","stage_counts","sign_off_velocity_days","sign_off_velocity_sample_size","overdue_query_count","query_sla_days","decision_items","decision_items_total","narrative","narrative_source"],"title":"DashboardSummary"},"app__modules__domain_support__schemas__AssigneeListResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/app__modules__domain_support__schemas__AssigneeRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"AssigneeListResponse"},"app__modules__domain_support__schemas__AssigneeRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Key"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"}},"type":"object","required":["user_uuid","email","full_name","role_key","role_name"],"title":"AssigneeRow"},"app__modules__dropbox__schemas__CredentialStatusResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"app_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Key"},"has_secret":{"type":"boolean","title":"Has Secret","default":false},"has_refresh_token":{"type":"boolean","title":"Has Refresh Token","default":false}},"type":"object","required":["is_connected"],"title":"CredentialStatusResponse"},"app__modules__dropbox__schemas__SaveCredentialsResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"is_verified":{"type":"boolean","title":"Is Verified"},"verify_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verify Error"}},"type":"object","required":["is_connected","is_verified"],"title":"SaveCredentialsResponse"},"app__modules__fyi__schemas__ClientMappingItem":{"properties":{"fyi_entity_id":{"type":"string","title":"Fyi Entity Id","description":"FYI entity id to map. Required.","examples":["12345"]},"zato_client_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zato Client Uuid","description":"Zato client UUID to link the entity to. Optional — null/omitted CLEARS the existing link for this entity.","examples":["b1d4c7e2-3f6a-4b8c-9d0e-1a2b3c4d5e6f"]}},"type":"object","required":["fyi_entity_id"],"title":"ClientMappingItem","description":"One entity→client mapping row. zato_client_uuid=None clears the link."},"app__modules__fyi__schemas__ClientMappingsResponse":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/ClientMappingRow"},"type":"array","title":"Mappings"}},"type":"object","required":["mappings"],"title":"ClientMappingsResponse"},"app__modules__fyi__schemas__CredentialStatusResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"access_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Id"},"has_secret":{"type":"boolean","title":"Has Secret","default":false},"access_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Secret"},"default_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Region"}},"type":"object","required":["is_connected"],"title":"CredentialStatusResponse"},"app__modules__fyi__schemas__SaveClientMappingsRequest":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/app__modules__fyi__schemas__ClientMappingItem"},"type":"array","title":"Mappings","description":"Entity → Zato client mapping rows to upsert. Required.","examples":[[{"fyi_entity_id":"12345","zato_client_uuid":"b1d4c7e2-3f6a-4b8c-9d0e-1a2b3c4d5e6f"}]]}},"type":"object","required":["mappings"],"title":"SaveClientMappingsRequest"},"app__modules__fyi__schemas__SaveCredentialsResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"is_verified":{"type":"boolean","title":"Is Verified"},"verify_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verify Error"},"default_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Region"}},"type":"object","required":["is_connected","is_verified"],"title":"SaveCredentialsResponse"},"app__modules__gl_rule_builder__schemas__AccountOption":{"properties":{"account_id":{"type":"integer","title":"Account Id"},"account_code":{"type":"string","title":"Account Code"},"account_name":{"type":"string","title":"Account Name"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"}},"type":"object","required":["account_id","account_code","account_name"],"title":"AccountOption","description":"COA-master parent account, shaped for the frontend AccountCode type."},"app__modules__gl_rule_builder__schemas__ClientOption":{"properties":{"client_id":{"type":"integer","title":"Client Id"},"client_uuid":{"type":"string","title":"Client Uuid"},"client_name":{"type":"string","title":"Client Name"},"business_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Structure"}},"type":"object","required":["client_id","client_uuid","client_name"],"title":"ClientOption"},"app__modules__googledrive__schemas__CredentialStatusResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"has_secret":{"type":"boolean","title":"Has Secret","default":false},"has_refresh_token":{"type":"boolean","title":"Has Refresh Token","default":false},"auth_mode":{"type":"string","title":"Auth Mode","default":"oauth"},"service_account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Account Email"},"redirect_uri":{"type":"string","title":"Redirect Uri","default":""},"shared_oauth_available":{"type":"boolean","title":"Shared Oauth Available","default":false}},"type":"object","required":["is_connected"],"title":"CredentialStatusResponse"},"app__modules__jobs__schemas__JobListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"JobListResponse"},"app__modules__jobs__schemas__JobTypeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__jobs__schemas__JobTypeOption"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JobTypeListResponse"},"app__modules__jobs__schemas__JobTypeOption":{"properties":{"job_type_id":{"type":"integer","title":"Job Type Id"},"job_type":{"type":"string","title":"Job Type"}},"type":"object","required":["job_type_id","job_type"],"title":"JobTypeOption","description":"One selectable job type for the create/edit dropdown (`GET /jobs/types`)."},"app__modules__knowledge__schemas__WebSearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"results":{"items":{"$ref":"#/components/schemas/app__modules__knowledge__schemas__WebSearchResult"},"type":"array","title":"Results"}},"type":"object","required":["query","results"],"title":"WebSearchResponse","description":"Web search results for a regulatory/standards query."},"app__modules__knowledge__schemas__WebSearchResult":{"properties":{"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"snippet":{"type":"string","title":"Snippet"}},"type":"object","required":["title","url","snippet"],"title":"WebSearchResult","description":"One web search hit."},"app__modules__messaging__schemas__SendRequest":{"properties":{"recipient_email":{"type":"string","title":"Recipient Email","description":"Recipient's email address. Required — dereferenced unconditionally (suppression check + email_hash) with no guard.","examples":["jane.doe@example.com"]},"template_kind":{"type":"string","title":"Template Kind","description":"Email template to render. Required — passed unconditionally to templates.render_ex(). One of: welcome, otp, invitation, support_request, akahu_link, questionnaire_invite, login_reminder, client_access_granted, review_signoff_rejected.","examples":["questionnaire_invite"]},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Template variables merged into the chosen template. Optional at the API level (defaults to {}), but the specific keys a template needs depend on template_kind (e.g. questionnaire_invite expects firm_name, questionnaire_title, access_url).","examples":[{"access_url":"https://app.example.com/client/questionnaire/abc","firm_name":"Acme Advisory","questionnaire_title":"FY26 Annual Questions"}]},"idempotency_key":{"type":"string","title":"Idempotency Key","description":"Caller-supplied dedupe key. Required — a repeat key returns the existing message instead of re-sending (get_by_idempotency, no guard).","examples":["resend-questionnaire-2026-07-06-abc123"]},"job_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Uuid","description":"Optional job to associate the message with.","examples":["9f1c2b7a4e5d4c8fabcd1234ef567890"]},"message_category":{"type":"string","enum":["transactional","operational","optional"],"title":"Message Category","description":"Deliverability class: transactional (exempt from unsubscribe), operational (default), or optional. Defaults to operational.","default":"operational","examples":["operational"]},"recipient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name","description":"Optional display name for the recipient.","examples":["Jane Doe"]}},"type":"object","required":["recipient_email","template_kind","idempotency_key"],"title":"SendRequest","description":"User-initiated send (CLIENT.COMMS__SEND). Most sends are system-triggered\nvia MessagingService.send directly; this is the explicit-resend surface.\n\nThe firm comes from the session (ctx.firm_uuid) and the client from the route\npath ({client_uuid}) so the two-decorator object check enforces access."},"app__modules__messaging__schemas__SendResponse":{"properties":{"message_uuid":{"type":"string","title":"Message Uuid"},"status":{"type":"string","title":"Status"}},"type":"object","required":["message_uuid","status"],"title":"SendResponse"},"app__modules__mj__schemas__TaxRateItem":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"rate_percent":{"type":"number","title":"Rate Percent","default":0.0}},"additionalProperties":true,"type":"object","required":["code","name"],"title":"TaxRateItem","description":"One GST/tax-rate option for the per-line tax picker, read from the client's\nsynced ``client_tax_rates`` catalog. Each entry is ``{code, name, rate_percent}``;\nextra keys carried through from the Xero sync (e.g. ``can_apply_to_*`` flags) are\npreserved (``extra='allow'``)."},"app__modules__mj__schemas__TrackingCategoryItem":{"properties":{"tracking_category_id":{"type":"string","title":"Tracking Category Id"},"name":{"type":"string","title":"Name"},"options":{"items":{"$ref":"#/components/schemas/app__modules__mj__schemas__TrackingOptionItem"},"type":"array","title":"Options"}},"type":"object","required":["tracking_category_id","name"],"title":"TrackingCategoryItem","description":"An ACTIVE Xero tracking category for the client's org + its options."},"app__modules__mj__schemas__TrackingOptionItem":{"properties":{"tracking_option_id":{"type":"string","title":"Tracking Option Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["tracking_option_id","name"],"title":"TrackingOptionItem"},"app__modules__onedrive__schemas__CredentialStatusResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"drive_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drive Id"},"drive_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drive User"},"has_secret":{"type":"boolean","title":"Has Secret","default":false}},"type":"object","required":["is_connected"],"title":"CredentialStatusResponse"},"app__modules__onedrive__schemas__SaveCredentialsResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"is_verified":{"type":"boolean","title":"Is Verified"},"verify_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verify Error"}},"type":"object","required":["is_connected","is_verified"],"title":"SaveCredentialsResponse"},"app__modules__organization__org_schemas__BranchListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BranchRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"BranchListResponse"},"app__modules__organization__org_schemas__BranchUpdateRequest":{"properties":{"branch_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Branch Name","description":"New branch name; omit to leave unchanged.","examples":["Auckland CBD"]},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"New branch address; omit to leave unchanged.","examples":["12 Queen St, Auckland 1010"]},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"New branch contact email; omit to leave unchanged.","examples":["auckland@acmeaccounting.co.nz"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"New branch phone (E.164); omit to leave unchanged.","examples":["+6493001234"]},"is_primary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Primary","description":"Set this branch as primary; omit to leave unchanged."}},"type":"object","title":"BranchUpdateRequest","description":"PARTIAL UPDATE of a branch — every field is optional; omit to leave unchanged."},"app__modules__organization__org_schemas__FirmUserRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"},"role_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Level"},"is_active":{"type":"boolean","title":"Is Active"},"is_invite_accepted":{"type":"boolean","title":"Is Invite Accepted"},"invited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invited At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobile Number"},"is_verified":{"type":"boolean","title":"Is Verified","default":false},"failed_login_attempts":{"type":"integer","title":"Failed Login Attempts","default":0},"auth_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Type"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["user_uuid","email","is_active","is_invite_accepted"],"title":"FirmUserRow"},"app__modules__organization__org_schemas__FirmUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__organization__org_schemas__FirmUserRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"FirmUsersResponse"},"app__modules__organization__org_schemas__ResendInviteResponse":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"sent":{"type":"boolean","title":"Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["user_uuid","email","sent"],"title":"ResendInviteResponse"},"app__modules__practice__schemas__BranchListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BranchResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"BranchListResponse"},"app__modules__practice__schemas__BranchUpdateRequest":{"properties":{"branch_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Branch Name","description":"New branch name."},"branch_code":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Branch Code","description":"New branch code."},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name","description":"New branch contact person."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address","description":"New branch address."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"New branch contact email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"New branch contact phone."},"is_primary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Primary","description":"Set as primary branch."},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"false => deactivate the branch."},"manager_user_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manager User Uuid","description":"user_uuid to (re)assign as branch head; must belong to your firm."}},"type":"object","title":"BranchUpdateRequest","description":"Partial update — every field is optional; send only what changes."},"app__modules__practice__schemas__FirmUserRow":{"properties":{"user_uuid":{"type":"string","title":"User Uuid"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Name"},"role_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Level"},"is_active":{"type":"boolean","title":"Is Active"},"is_locked":{"type":"boolean","title":"Is Locked","default":false},"locked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Locked At"},"is_invite_accepted":{"type":"boolean","title":"Is Invite Accepted"},"auth_type":{"type":"string","title":"Auth Type","default":"manual"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"branch_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Uuid"},"branch_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Name"},"is_branch_head":{"type":"boolean","title":"Is Branch Head","default":false}},"type":"object","required":["user_uuid","email","is_active","is_invite_accepted"],"title":"FirmUserRow"},"app__modules__practice__schemas__FirmUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__modules__practice__schemas__FirmUserRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FirmUsersResponse"},"app__modules__practice__schemas__ResendInviteResponse":{"properties":{"invitation_email_sent":{"type":"boolean","title":"Invitation Email Sent"},"invitation_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitation Token"}},"type":"object","required":["invitation_email_sent"],"title":"ResendInviteResponse"},"app__modules__questionnaire__schemas__SendRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"client_uuid of the recipient client; resolved via client_by_uuid unguarded (404 if unknown).","examples":["9c2f1a7b-3d4e-5f60-7182-93a4b5c6d7e8"]},"recipient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email","description":"Email of the original participant. Optional — when omitted the send falls back to the client's stored contact email; if the client has no email either, the send is rejected with a clear error.","examples":["owner@clientco.com"]},"recipient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name","description":"Display name of the recipient (nullable).","examples":["Jane Smith"]},"financial_year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Year","description":"Financial year for this send; also used for the duplicate-send guard (same client + period).","examples":["2025-2026"]},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start","description":"Optional coverage period start.","examples":["2025-04-01"]},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End","description":"Optional coverage period end.","examples":["2026-03-31"]},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"Optional due date shown to the recipient.","examples":["2026-05-15"]}},"type":"object","required":["client_uuid"],"title":"SendRequest"},"app__modules__questionnaire__schemas__SendResponse":{"properties":{"invitation_uuid":{"type":"string","title":"Invitation Uuid"},"access_url":{"type":"string","title":"Access Url"},"status":{"type":"string","title":"Status"}},"type":"object","required":["invitation_uuid","access_url","status"],"title":"SendResponse"},"app__modules__questionnaire__schemas_recipient__FileViewUrlResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"FileViewUrlResponse"},"app__modules__questionnaire__schemas_recipient__VerifyOtpRequest":{"properties":{"pre_session_token":{"type":"string","title":"Pre Session Token","description":"pre_session_token returned by /request-otp; loaded unguarded to resolve the pending session.","examples":["ps_8d4056a1c7e2b8d4056a1c7e2b8d4056"]},"code":{"type":"string","title":"Code","description":"OTP the participant received by email (dev: 123456).","examples":["123456"]}},"type":"object","required":["pre_session_token","code"],"title":"VerifyOtpRequest"},"app__modules__recoding__schemas__RecodeRequest":{"properties":{"to_code":{"type":"string","minLength":1,"title":"To Code","description":"REQUIRED. The NEW (target) account (bare code) every selected line is moved to.","examples":["429"]},"method":{"type":"string","title":"Method","description":"Recode mechanism. 'source' (default, like Xero Find & Recode) edits the original transaction in the provider and falls back to a journal when it's reconciled/locked; 'journal' always posts a reclassification manual journal (audited fallback).","default":"source","examples":["source"]},"lines":{"items":{"$ref":"#/components/schemas/RecodeLineInput"},"type":"array","title":"Lines","description":"The selected posted lines to reclassify. Empty is a no-op (0 recoded); send at least one line to recode."}},"type":"object","required":["to_code"],"title":"RecodeRequest"},"app__modules__sharepoint__schemas__CredentialStatusResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site"},"has_secret":{"type":"boolean","title":"Has Secret","default":false}},"type":"object","required":["is_connected"],"title":"CredentialStatusResponse"},"app__modules__sharepoint__schemas__SaveCredentialsResponse":{"properties":{"is_connected":{"type":"boolean","title":"Is Connected"},"is_verified":{"type":"boolean","title":"Is Verified"},"verify_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verify Error"}},"type":"object","required":["is_connected","is_verified"],"title":"SaveCredentialsResponse"},"app__modules__thresholds__materiality_thresholds__schemas__JobTypeListResponse":{"properties":{"organization_has_override":{"type":"boolean","title":"Organization Has Override","default":false},"job_types":{"items":{"$ref":"#/components/schemas/app__modules__thresholds__materiality_thresholds__schemas__JobTypeOption"},"type":"array","title":"Job Types"}},"type":"object","required":["job_types"],"title":"JobTypeListResponse"},"app__modules__thresholds__materiality_thresholds__schemas__JobTypeOption":{"properties":{"job_type_id":{"type":"integer","title":"Job Type Id"},"job_type":{"type":"string","title":"Job Type"},"has_override":{"type":"boolean","title":"Has Override","default":false}},"type":"object","required":["job_type_id","job_type"],"title":"JobTypeOption"},"app__modules__thresholds__wp_threshold__schemas__JobTypeListResponse":{"properties":{"organization_has_override":{"type":"boolean","title":"Organization Has Override","default":false},"job_types":{"items":{"$ref":"#/components/schemas/app__modules__thresholds__wp_threshold__schemas__JobTypeOption"},"type":"array","title":"Job Types"}},"type":"object","required":["job_types"],"title":"JobTypeListResponse"},"app__modules__thresholds__wp_threshold__schemas__JobTypeOption":{"properties":{"job_type_id":{"type":"integer","title":"Job Type Id"},"job_type":{"type":"string","title":"Job Type"},"has_override":{"type":"boolean","title":"Has Override","default":false}},"type":"object","required":["job_type_id","job_type"],"title":"JobTypeOption"},"app__modules__workpapers__schemas__DashboardSummary":{"properties":{"total_account_codes":{"type":"integer","title":"Total Account Codes","default":0},"custom_codes":{"type":"integer","title":"Custom Codes","default":0},"standard_codes":{"type":"integer","title":"Standard Codes","default":0},"manual_journals_total":{"type":"integer","title":"Manual Journals Total","default":0},"manual_journal_status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Manual Journal Status Counts"}},"type":"object","title":"DashboardSummary"},"app__modules__wp_mapping__schemas__AccountOption":{"properties":{"account_uuid":{"type":"string","title":"Account Uuid"},"account_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Code"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"}},"type":"object","required":["account_uuid"],"title":"AccountOption"},"app__modules__wp_mapping__schemas__AddSectionIn":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional display name for the added section. When omitted, the label defaults to the workpaper name plus the section number (e.g. 'Term Loan 2'). Ignored on the account-based multi-parent path (the section name is derived from the account).","examples":["Term Loan 2"]},"base_parent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Parent Key","description":"Which INDEPENDENT base parent to instantiate (see WpConfigAddableParent). Required only for a workpaper whose numbered family has MORE THAN ONE in-scope base (e.g. CAC); optional/ignored elsewhere — defaults to the WP's sole base (unchanged for TLN/HPR/… and every non-numbered WP). An out-of-scope key is rejected (422 INVALID_BASE_PARENT).","examples":["shareholder_current_account"]}},"type":"object","title":"AddSectionIn","description":"Add a section instance to a template (addable) workpaper."},"app__modules__xero__router_partner_sync__ClientMappingItem":{"properties":{"zatoClientUuid":{"type":"string","title":"Zatoclientuuid","description":"Required. Zato client_uuid to map to the XPM client.","examples":["550e8400-e29b-41d4-a716-446655440000"]},"xpmClientXeroId":{"type":"string","title":"Xpmclientxeroid","description":"Required. XPM client's Xero UUID to link to the Zato client.","examples":["a1b2c3d4-e5f6-7890-ab12-cd34ef567890"]}},"type":"object","required":["zatoClientUuid","xpmClientXeroId"],"title":"ClientMappingItem"},"app__modules__xero__router_partner_sync__SaveClientMappingsRequest":{"properties":{"mappings":{"items":{"$ref":"#/components/schemas/app__modules__xero__router_partner_sync__ClientMappingItem"},"type":"array","title":"Mappings","description":"Required. Confirmed Zato ↔ XPM client mappings to persist."},"replace_existing":{"type":"boolean","title":"Replace Existing","description":"Optional (defaults to false). When true, re-mapping a client to a different XPM client drops its old imported jobs instead of being blocked (set after a UI confirmation).","default":false,"examples":[false]}},"type":"object","required":["mappings"],"title":"SaveClientMappingsRequest"},"app__modules__xero__schemas_docs__BankAccountsResponse":{"properties":{"accounts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Accounts"}},"type":"object","required":["accounts"],"title":"BankAccountsResponse","description":"A client's Xero bank accounts (type + status) for the Bank Summary filters."},"app__modules__xero__schemas_docs__ClientMappingsResponse":{"properties":{"mappings":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Mappings"}},"type":"object","required":["mappings"],"title":"ClientMappingsResponse","description":"Existing Zato ↔ XPM client mappings."},"app__modules__zbox__schemas__FileViewUrlResponse":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"demo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Demo"}},"additionalProperties":true,"type":"object","title":"FileViewUrlResponse","description":"`GET /zbox/files/{file_uuid}/view-url` — a URL (presigned S3, local download,\nor in-house live-stream) OR a `demo`/unconfigured fallback. Fields vary by\nbackend, so all are optional."},"app__modules__zbox__schemas__LinkClientRequest":{"properties":{"client_uuid":{"type":"string","title":"Client Uuid","description":"UUID of the firm-level client to tag the file with (must belong to your firm).","examples":["a1b2c3d4-5e6a-7b8c-9d0e-1f2a3b4c5d6e"]}},"type":"object","required":["client_uuid"],"title":"LinkClientRequest"}}},"tags":[{"name":"auth","description":"Login, logout, token refresh, and Cognito callback — sets/clears the httpOnly auth cookies."},{"name":"personas","description":"Active persona resolution — navigation manifest + permission set for the signed-in user."},{"name":"profile","description":"The signed-in user's own profile and preferences."},{"name":"config","description":"Frontend bootstrap configuration (feature flags, environment hints)."},{"name":"health","description":"Liveness/readiness probes and dependency health."},{"name":"clients","description":"Client management — CRUD, search, and per-client sub-resources."},{"name":"client-groups","description":"Client groupings for bulk operations and reporting."},{"name":"client-portal","description":"Client-facing portal surface (restricted persona)."},{"name":"client-portal-queries","description":"Client portal view of queries raised against the client."},{"name":"client-portal-akahu","description":"Client portal Akahu bank-connection consent flow."},{"name":"client-portal-basiq","description":"Client portal Basiq bank-connection consent flow."},{"name":"jobs","description":"Engagement jobs — firm-scoped listing, creation, prior-year links, and CSV import."},{"name":"assignments","description":"Staff-to-job/client assignment management."},{"name":"practice","description":"Practice administration — roles, staff, and firm-level settings."},{"name":"company-office","description":"Company office reference data."},{"name":"domain-support","description":"In-app support requests and support-user administration."},{"name":"workpapers","description":"Workpaper documents — sections, cells, evidence, sign-off, and export."},{"name":"workpaper-studio","description":"Dev portal for authoring and publishing workpaper templates."},{"name":"wp-mapping","description":"Workpaper account-mapping between GL accounts and workpaper lines."},{"name":"wp-thresholds","description":"Per-workpaper thresholds configuration."},{"name":"materiality-thresholds","description":"Firm/job materiality threshold configuration."},{"name":"supporting-docs","description":"Supporting documents attached to workpapers and jobs."},{"name":"notes","description":"Notes attached to workpapers and other entities."},{"name":"queries","description":"Query lifecycle — raise, respond, resolve; batch send to clients."},{"name":"queries-batch","description":"Batched query operations across accounts/jobs."},{"name":"queries-investigation","description":"Query investigation workflows."},{"name":"questionnaire","description":"Staff-side questionnaire authoring and dispatch."},{"name":"questionnaire-recipient","description":"Recipient-side questionnaire completion (tokened access)."},{"name":"coa","description":"Chart-of-accounts jobs and AI automap — async runs with human confirm/override."},{"name":"coa-knowledge-base","description":"COA mapping knowledge base and learned account memory."},{"name":"gl","description":"General-ledger data views and imports."},{"name":"gl-rules","description":"GL autocoding rule builder."},{"name":"gl-scrutiny","description":"GL scrutiny checks and exception surfacing."},{"name":"autocoding","description":"Transaction autocoding — runs, review, splits, and bank-feed coding."},{"name":"recoding","description":"Recoding of previously coded transactions."},{"name":"mj","description":"Manual journals — creation, review, and posting."},{"name":"fixed-assets","description":"Fixed-asset register views and reconciliation."},{"name":"reporting","description":"Financial reporting outputs and report configuration."},{"name":"tracking","description":"Job/work item tracking views."},{"name":"xero","description":"Xero integration — OAuth connections, tenant selection, and data sync."},{"name":"xero-xpm","description":"Xero Practice Manager (XPM) sync."},{"name":"xero-partner-sync","description":"Xero partner-level bulk sync orchestration."},{"name":"akahu","description":"Akahu bank-feed integration (NZ) — connections and account links."},{"name":"basiq","description":"Basiq bank-feed integration (AU) — connections and account links."},{"name":"bank-feeds","description":"Unified bank-feed links and transaction retrieval."},{"name":"zbox","description":"ZBox document inbox — upload, preprocessing, and dispatch."},{"name":"pdf-splitter","description":"AI PDF splitting — carve multi-document PDFs into per-document artifacts."},{"name":"sharepoint","description":"SharePoint document-source integration."},{"name":"dropbox","description":"Dropbox document-source integration."},{"name":"googledrive","description":"Google Drive document-source integration."},{"name":"onedrive","description":"OneDrive document-source integration."},{"name":"fyi","description":"FYI document-management integration."},{"name":"integrations","description":"Cross-integration management surface."},{"name":"ziffy","description":"Ziffy AI assistant — conversations and actions."},{"name":"ziffy-agent","description":"Ziffy agent-tier endpoints (agent runtime lane)."},{"name":"hitl","description":"Human-in-the-loop approvals for gated agent actions."},{"name":"runs","description":"Async run tracking — status of dispatched background runs."},{"name":"realtime","description":"WebSocket edge (`/api/v1/ws`) — live run progress and push topics."},{"name":"activity","description":"Append-only activity/decision timeline."},{"name":"memory","description":"Agent memory records — semantic recall over prior decisions."},{"name":"knowledge","description":"Knowledge-base entries powering AI context."},{"name":"notifications","description":"In-app notification feed and read-state."},{"name":"grid-prefs","description":"Per-user AG Grid state persistence (columns, filters, sorts)."},{"name":"workspace","description":"Workspace bootstrap/summary for the signed-in user."},{"name":"cs","description":"Client services workflows."},{"name":"support","description":"Support-request creation."},{"name":"partner-api","description":"Partner Developer API (`/partner`) — API-key authed, scope-gated, firm-scoped access for third-party integrations."}]}