{"openapi":"3.1.0","info":{"title":"TrueIdiom API","version":"2026-09-01"},"paths":{"/api/auth/mfa/enroll":{"post":{"summary":"Mfa Enroll","operationId":"mfa_enroll_api_auth_mfa_enroll_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnrollRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Mfa Enroll Api Auth Mfa Enroll Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/mfa/confirm":{"post":{"summary":"Mfa Confirm","operationId":"mfa_confirm_api_auth_mfa_confirm_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnrollConfirmRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mfa Confirm Api Auth Mfa Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/mfa/recovery/regenerate":{"post":{"summary":"Mfa Regenerate Recovery Codes","description":"Mint a fresh recovery set for the signed-in user; the old set dies.\n\nSECURITY: session-authorized ONLY — a pending mid-sign-in challenge, which\nhas cleared just ONE factor, cannot mint recovery codes. Minting from\nthere would turn a stolen password into a standing second factor, i.e. an\nMFA bypass.","operationId":"mfa_regenerate_recovery_codes_api_auth_mfa_recovery_regenerate_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"title":"Response Mfa Regenerate Recovery Codes Api Auth Mfa Recovery Regenerate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/invites/preview":{"post":{"summary":"Preview Invite","description":"What an invite link opens, for the sign-in page's \"joining X\" banner.\n\nPublic and rate-limited, because the token IS the credential and the person\nholding it has no account yet. SECURITY: every failure — malformed, unknown\ntenant, wrong secret, expired, revoked — is the same 200 `{\"valid\": false}`.\nA 404 or a distinct message would turn this into a tenant-enumeration oracle\n(guess an id, learn whether that workspace exists) and would leak which half\nof a token was wrong.","operationId":"preview_invite_api_auth_invites_preview_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitePreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Invite Api Auth Invites Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/signup/email":{"post":{"summary":"Tenant Email Signup","operationId":"tenant_email_signup_api_auth_signup_email_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantEmailSignupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tenant Email Signup Api Auth Signup Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/token":{"post":{"summary":"Oauth2 Token","operationId":"oauth2_token_api_oauth2_token_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth2_token_api_oauth2_token_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Oauth2 Token Api Oauth2 Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/mfa/verify":{"post":{"summary":"Verify Mfa Challenge","operationId":"verify_mfa_challenge_api_auth_mfa_verify_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaChallengeVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/revoke":{"post":{"summary":"Oauth2 Revoke","operationId":"oauth2_revoke_api_oauth2_revoke_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth2_revoke_api_oauth2_revoke_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Oauth2 Revoke Api Oauth2 Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/signout":{"post":{"summary":"Auth Signout","description":"Browser sign-out: revoke the session token (if present) and clear the cookie.\n\nUnauthenticated by design — it can only invalidate the caller's own cookie\nsession, so a subsequent page load redirects to /signin (OWASP: invalidate\nserver-side session on logout). Safe to call even with no active session.","operationId":"auth_signout_api_auth_signout_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Auth Signout Api Auth Signout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/introspect":{"post":{"summary":"Oauth2 Introspect","operationId":"oauth2_introspect_api_oauth2_introspect_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth2_introspect_api_oauth2_introspect_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2IntrospectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"summary":"Auth Me","operationId":"auth_me_api_auth_me_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Auth Me Api Auth Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users":{"get":{"summary":"List Auth Users","description":"List a tenant's users (admin-only).\n\nRevoked members are omitted unless ?include_revoked=true — they cannot\nsign in, so the default roster is who actually has access. The admin pane\nasks for them so it can offer reinstatement; each row carries `active`.\n\nScoping matches the tenants routes, in the shape this route can express:\nonly a platform operator may name a tenant, and the operator API key —\nwhich has no \"own tenant\" to fall back on — must name one, while an\noperator SESSION defaults to the workspace it is signed into.\n\nSECURITY: for a plain signed-in admin ?tenant_id is IGNORED, not validated\n— the `global_administrator` role is per-tenant, so naming someone else's\nid returns the caller's OWN roster and never the named tenant's. Silence\nrather than a 404 is deliberate here: this route answers with a list, so\nthe caller learns nothing about whether the id they guessed exists.","operationId":"list_auth_users_api_auth_users_get","parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"include_revoked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Revoked"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Auth Users Api Auth Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users/{user_id}":{"delete":{"summary":"Revoke User Access","description":"Revoke a member's access (admin-only): they are signed out everywhere\nimmediately and can no longer sign in by password or through an identity\nprovider.\n\nScoped exactly like the role route — a session/bearer admin reaches only\ntheir own tenant (cross-tenant ids 404 without leaking existence), while\nthe operator API key may manage any tenant. The record is deactivated,\nnot deleted, because the tenant's jobs, documents, and audit trail all\nreference it; POST .../restore is the way back.\n\n409 covers the two refusals that protect a tenant from losing its last\nway in: revoking yourself, and revoking the last admin.","operationId":"revoke_user_access_api_auth_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke User Access Api Auth Users  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users/{user_id}/restore":{"post":{"summary":"Restore User Access","description":"Reinstate a revoked member with the role they had (admin-only, scoped\nlike the revoke route). Nothing is issued here — they sign in again from\nscratch, and any enrolled authenticator still applies.","operationId":"restore_user_access_api_auth_users__user_id__restore_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore User Access Api Auth Users  User Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users/{user_id}/role":{"patch":{"summary":"Update User Role","description":"Change a user's role (admin-only). Session/bearer admins are scoped to\ntheir own tenant (cross-tenant ids 404 without leaking existence); the\nAPI key may manage any tenant.","operationId":"update_user_role_api_auth_users__user_id__role_patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update User Role Api Auth Users  User Id  Role Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users/{user_id}/mfa/reset":{"post":{"summary":"Reset User Mfa","description":"Clear a member's authenticator and recovery codes (admin-only) so they\nre-enrol at their next sign-in — the answer to a lost phone once the\nrecovery codes are gone too.\n\nAuthorization is update_user_role's, verbatim: session/bearer admins are\nscoped to their own tenant (a cross-tenant id 404s without disclosing\nwhether the user exists), and only the operator API key may act on any\ntenant. The service writes the audit record itself.","operationId":"reset_user_mfa_api_auth_users__user_id__mfa_reset_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset User Mfa Api Auth Users  User Id  Mfa Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/users/{user_id}/password-reset-link":{"post":{"summary":"Create User Password Reset Link","description":"Mint a password-reset link for a member (admin-only) — the answer to a\nforgotten password in a deployment with no mailer, where the admin is the\ndelivery channel.\n\nAuthorization is reset_user_mfa's, verbatim: session/bearer admins are\nscoped to their own tenant (a cross-tenant id 404s without disclosing\nwhether the user exists), and only the operator API key may act on any\ntenant. The service writes the audit record itself.\n\nSECURITY: the link is a bearer credential for one account — hand it to the\nmember over a channel you trust and never log it. Minting replaces any\noutstanding link for that user, so a mis-delivered one can be killed by\nminting another.","operationId":"create_user_password_reset_link_api_auth_users__user_id__password_reset_link_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create User Password Reset Link Api Auth Users  User Id  Password Reset Link Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password-reset":{"post":{"summary":"Complete Password Reset","description":"Set a new password from a reset link, and sign the holder in.\n\nPublic and rate-limited: the token is the only credential the caller has,\nand it is self-locating, so no email or tenant is accepted here. Completing\nit revokes every other live session and refresh token for that user (the\nreset exists because the old credential can no longer be trusted).\n\nThe caller ends up signed in rather than bounced to the sign-in form —\nUNLESS their sign-in policy requires MFA, in which case the reset returns\nthe same challenge shape as any sign-in: the link plus a fresh password is\nstill only one factor, and an admin-minted link must not be a one-session\nbypass of the tenant's own MFA requirement.","operationId":"complete_password_reset_api_auth_password_reset_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Complete Password Reset Api Auth Password Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/{provider}/authorize":{"post":{"summary":"Oauth2 Authorize","operationId":"oauth2_authorize_api_oauth2__provider__authorize_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth2 Authorize Api Oauth2  Provider  Authorize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/google/client-config":{"get":{"summary":"Oauth2 Google Client Config","operationId":"oauth2_google_client_config_api_oauth2_google_client_config_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth2 Google Client Config Api Oauth2 Google Client Config Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth2/{provider}/callback":{"post":{"summary":"Oauth2 Callback","operationId":"oauth2_callback_api_oauth2__provider__callback_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth2 Callback Api Oauth2  Provider  Callback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/usage/daily":{"get":{"summary":"Tenant Usage Daily","description":"Per-day usage totals (admin-only), inclusive bounds.\n\nA platform operator sees the aggregate across all tenants, optionally\nnarrowed with ``tenant_id``, and gets the token series beside the character\nseries; a signed-in tenant admin always gets the series scoped to their own\ntenant (the `global_administrator` role is per-tenant, never cross-tenant —\ntheir scope overrides the param), carrying `billable_chars` only.\n\nDefaults to the last 30 days. Days without usage are omitted; the UI\nfills the gaps with zero bars.","operationId":"tenant_usage_daily_api_tenants_usage_daily_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Tenant Usage Daily Api Tenants Usage Daily Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants":{"post":{"summary":"Create Tenant","operationId":"create_tenant_api_tenants_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAccountCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tenant Api Tenants Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tenants","operationId":"list_tenants_api_tenants_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantAccount"},"title":"Response List Tenants Api Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/security":{"patch":{"summary":"Update Tenant Security Policy","description":"Set a tenant's sign-in policy (admin-only) — the two MFA flags and SSO\ndomain auto-join. Returns the resulting policy.\n\nAny flag left None is left alone, so they can be changed independently.\n\nSECURITY: this route is the ONLY writer of the `mfa_` and `sso_` metadata\nnamespaces. Caller-supplied metadata on both self-serve creation paths is\nstripped of those prefixes — so a tenant can never arrive with a policy it\nwrote for itself (nor with its domain pre-opened to strangers), and policy\ncan only be set by someone who has already passed the admin gate. Scoping\nmatches the invite routes: a signed-in admin is pinned to their OWN\ntenant (the global_administrator role is per-tenant, never cross-tenant),\nonly a platform operator may name a tenant via ?tenant_id, and an operator\nSESSION defaults to the workspace it is signed into.","operationId":"update_tenant_security_policy_api_tenants_security_patch","parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSecurityPolicyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Update Tenant Security Policy Api Tenants Security Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/invites":{"post":{"summary":"Create Tenant Invite","description":"Mint an invite link for this tenant (admin-only).\n\nThere is no mailer, so the admin IS the delivery channel: the response\ncarries the link exactly once and only its hash is kept. Re-reading the\ninvite later (GET below) returns everything about it EXCEPT the token, so a\nleaked admin session cannot recover a link it did not just mint.","operationId":"create_tenant_invite_api_tenants_invites_post","parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tenant Invite Api Tenants Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tenant Invites","description":"This tenant's live pending invites (admin-only), without their tokens.","operationId":"list_tenant_invites_api_tenants_invites_get","parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tenant Invites Api Tenants Invites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/invites/{invite_id}":{"delete":{"summary":"Delete Tenant Invite","description":"Withdraw a pending invite (admin-only); its link stops working at once.","operationId":"delete_tenant_invite_api_tenants_invites__invite_id__delete","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/billing":{"get":{"summary":"Tenant Billing Summary","operationId":"tenant_billing_summary_api_tenants__tenant_id__billing_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"billing_period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Period"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Tenant Billing Summary Api Tenants  Tenant Id  Billing Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/billing/export":{"get":{"summary":"Export Tenant Billing","operationId":"export_tenant_billing_api_tenants__tenant_id__billing_export_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"billing_period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Period"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|jsonl|csv)$","default":"json","title":"Format"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/translations":{"post":{"summary":"Submit Translation","description":"Accepts either:\n\n    * a multipart/raw text source document upload with language fields →\n        returns per-page jobs + output file details, or\n* the simple shape ``{\"source_text\": \"...\", \"target_lang\": \"es\", ...}`` →\n  returns a single ``TranslationJob``, or\n* the legacy batch shape ``{\"inputs\": [{\"Text\": \"...\",\n  \"Targets\": [{\"Language\": \"es\", ...}]}]}`` → returns a list of jobs.","operationId":"submit_translation_api_translations_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"The completed job for the simple `{source_text, target_lang}` shape; a list of jobs, one per input/target pair, for the legacy batch shape. A multipart layout-document upload returns a document job instead (see POST /api/documents/translate), and a flattened text document returns the per-page job ids plus the output file.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TenantTranslationJob"},{"type":"array","items":{"$ref":"#/components/schemas/TenantTranslationJob"}}],"title":"Response 200 Submit Translation Api Translations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Translations","operationId":"list_translations_api_translations_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"title":"Status"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"The caller's own tenant's jobs, newest first, optionally filtered by status.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantTranslationJob"},"title":"Response 200 List Translations Api Translations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/translations/{job_id}":{"get":{"summary":"Get Translation","operationId":"get_translation_api_translations__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"One translation job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTranslationJob"}}}},"404":{"description":"Unknown job id — or one owned by another tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Translation","description":"Admin-only hard delete of one text job, cascading to everything the job\nproduced: its golden system-of-record record(s) and the TM pair it fed into\nthe tenant's `golden-approved-*` set (matched by source hash — sibling\npairs are untouched). Usage/billing records and the auth audit log\ndeliberately survive (legal/tax retention, per the privacy policy).\n\n404 for unknown ids AND cross-tenant ids — never confirm another tenant's\njob id exists. After deletion the public golden download link 404s too.\nCounts in the response are what was ACTUALLY removed, not aspirational.","operationId":"delete_translation_api_translations__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Translation Api Translations  Job Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/translations/{job_id}/review":{"post":{"summary":"Review Translation","operationId":"review_translation_api_translations__job_id__review_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSubmission"}}}},"responses":{"200":{"description":"The job as it stands after the review decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTranslationJob"}}}},"404":{"description":"Unknown job id — or one owned by another tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/translations/{job_id}/golden":{"get":{"summary":"Download Golden Translation","operationId":"download_golden_translation_api_translations__job_id__golden_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(txt|docx|pdf)$","default":"txt","title":"Format"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/terminology":{"post":{"summary":"Create Terminology Set","operationId":"create_terminology_set_api_terminology_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Terminology Set Api Terminology Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Terminology Sets","operationId":"list_terminology_sets_api_terminology_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Terminology Sets Api Terminology Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/terminology/{set_id}":{"delete":{"summary":"Delete Terminology Set","operationId":"delete_terminology_set_api_terminology__set_id__delete","parameters":[{"name":"set_id","in":"path","required":true,"schema":{"type":"string","title":"Set Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm":{"post":{"summary":"Create Tm Set","description":"Import a TMX file into the set named `name`, replacing it wholesale.\n\n200 with the set + import counts when the file is small enough to import\ninline, measured after duplicate sources collapse. 202 with\n`{\"job\": ..., \"poll_url\": ...}` above that size: the remaining import work\nruns in the background and the client polls `poll_url` until the job reports\n`completed` (carrying the same payload the 200 would have) or `failed`.","operationId":"create_tm_set_api_tm_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tm Set Api Tm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Tm Sets","operationId":"list_tm_sets_api_tm_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tm Sets Api Tm Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm/imports":{"get":{"summary":"List Tm Imports","description":"This tenant's recent asynchronous TMX imports, newest first (capped).","operationId":"list_tm_imports_api_tm_imports_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tm Imports Api Tm Imports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm/imports/{job_id}":{"get":{"summary":"Get Tm Import","description":"Poll one asynchronous TMX import. `job.status` walks\nqueued -> running -> completed | failed; `job.result` carries the set and\nthe import counts on completion, `job.error` an actionable message on\nfailure. Another tenant's job id is a 404.","operationId":"get_tm_import_api_tm_imports__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tm Import Api Tm Imports  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm/{set_id}":{"delete":{"summary":"Delete Tm Set","operationId":"delete_tm_set_api_tm__set_id__delete","parameters":[{"name":"set_id","in":"path","required":true,"schema":{"type":"string","title":"Set Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm/export/golden":{"get":{"summary":"Export Golden Tmx","description":"TMX download of the approved golden pairs for one language pair.\n\nA user-facing export of the tenant's own corpus (CAT-tool interchange,\nportability). It no longer feeds any internal retraining — those same pairs\nare used in-product to improve the tenant's future translations.","operationId":"export_golden_tmx_api_tm_export_golden_get","parameters":[{"name":"source_lang","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source Lang"}},{"name":"target_lang","in":"query","required":false,"schema":{"type":"string","default":"","title":"Target Lang"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tm/{set_id}/export":{"get":{"summary":"Export Tm Set","operationId":"export_tm_set_api_tm__set_id__export_get","parameters":[{"name":"set_id","in":"path","required":true,"schema":{"type":"string","title":"Set Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/translate":{"post":{"summary":"Translate Document","operationId":"translate_document_api_documents_translate_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Synchronous (`wait=true`): document ingested, translated, validated, and reconstructed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDocumentJob"},"example":{"id":"doc_12345","tenant_id":"tenant_abc","request":{"source_lang":"en","target_lang":"fr","domain":"legal","metadata":{"content_type":"application/pdf","size_bytes":83421}},"status":"translated","source_file_name":"contract.pdf","quality_report":{"schema_version":"1.0","document_id":"layout_12345","source_lang":"en","target_lang":"fr","overall_score":0.97,"translated_units":24,"total_units":24,"findings":[],"metadata":{"page_count":3}},"billable_chars":4820,"review_history":[],"artifacts":[{"id":"artifact_1","kind":"source_pdf","stage":"ingest","content_type":"application/pdf","checksum":"abc123","size_bytes":83421,"created_at":"2026-07-02T00:00:00Z","metadata":{"source_file_name":"contract.pdf"}}],"created_at":"2026-07-02T00:00:00Z","updated_at":"2026-07-02T00:01:00Z"}}}},"202":{"description":"Job accepted and queued; poll GET /api/documents/{id} until status is `translated` or `failed`."},"400":{"description":"Missing required fields or invalid file payload."},"401":{"description":"Missing or invalid tenant credentials."},"402":{"description":"Billing is enabled and the tenant has no active subscription."},"415":{"description":"Unsupported media type for source document."},"503":{"description":"Translation is temporarily disabled on this deployment."},"507":{"description":"Platform storage cap reached for this tenant — delete document jobs or bring your own storage (PUT /api/storage/binding)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents":{"get":{"summary":"List Documents","operationId":"list_documents_api_documents_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DocumentJobStatus"},{"type":"null"}],"title":"Status"}},{"name":"failure_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(stage_timeout|transient_error|unexpected_error|interrupted)$"},{"type":"null"}],"title":"Failure Code"}},{"name":"failure_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Failure Stage"}},{"name":"created_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Since"}},{"name":"created_until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Until"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"List document jobs with optional status and failure filters. `layout` is always null here — as it is on every document response; segments are served, redacted, by `GET /api/documents/{document_id}/segments`. Not loading it for a list is also what keeps the response small: it is ~99% of a translated job's bytes.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantDocumentJob"},"title":"Response 200 List Documents Api Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/summary":{"get":{"summary":"Summarize Documents","operationId":"summarize_documents_api_documents_summary_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DocumentJobStatus"},{"type":"null"}],"title":"Status"}},{"name":"failure_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(stage_timeout|transient_error|unexpected_error|interrupted)$"},{"type":"null"}],"title":"Failure Code"}},{"name":"failure_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Failure Stage"}},{"name":"created_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Since"}},{"name":"created_until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Until"}},{"name":"include_tenant_breakdown","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Tenant Breakdown"}},{"name":"include_stage_timing_breakdown","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Stage Timing Breakdown"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Aggregate document job counts grouped by status and failure taxonomy.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Summarize Documents Api Documents Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}":{"get":{"summary":"Get Document","operationId":"get_document_api_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Document translation job details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDocumentJob"},"example":{"id":"doc_12345","tenant_id":"tenant_abc","request":{"source_lang":"en","target_lang":"fr","domain":"legal","metadata":{"content_type":"application/pdf","size_bytes":83421}},"status":"translated","source_file_name":"contract.pdf","quality_report":{"schema_version":"1.0","document_id":"layout_12345","source_lang":"en","target_lang":"fr","overall_score":0.97,"translated_units":24,"total_units":24,"findings":[],"metadata":{"page_count":3}},"billable_chars":4820,"review_history":[],"artifacts":[{"id":"artifact_1","kind":"source_pdf","stage":"ingest","content_type":"application/pdf","checksum":"abc123","size_bytes":83421,"created_at":"2026-07-02T00:00:00Z","metadata":{"source_file_name":"contract.pdf"}}],"created_at":"2026-07-02T00:00:00Z","updated_at":"2026-07-02T00:01:00Z"}}}},"404":{"description":"Document job not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Document","description":"Admin-only hard delete of one document job. An in-flight job's\nbackground task is cancelled before anything is removed. A BYOS artifact\ndeletion failure is logged and never blocks the platform-side delete.","operationId":"delete_document_api_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Document job hard-deleted with its full cascade: artifacts (local files and, for BYOS tenants, blobs in their own account), layout segments, golden audit record(s), the TM pairs the document fed into the tenant's golden-approved set, and provably-linked learning rows. Counts report what was actually removed. Usage/billing records and the auth audit log survive by design.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Document Api Documents  Document Id  Delete"},"example":{"deleted":true,"document_id":"doc_12345","artifacts_removed":5,"segments_removed":24,"golden_records_deleted":1,"tm_pairs_removed":22,"learning_rows_removed":2}}}},"401":{"description":"No usable admin credentials."},"403":{"description":"Authenticated but not an admin."},"404":{"description":"Document job not found (includes cross-tenant ids)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/artifacts":{"get":{"summary":"List Document Artifacts","operationId":"list_document_artifacts_api_documents__document_id__artifacts_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Persisted artifacts for the document job: the source document you uploaded and the translated output. The pipeline's own intermediate files are not listed.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Document Artifacts Api Documents  Document Id  Artifacts Get"},"example":{"document_id":"doc_12345","artifacts":[{"id":"artifact_1","kind":"source_pdf","stage":"ingest","content_type":"application/pdf","checksum":"abc123","size_bytes":83421,"created_at":"2026-07-02T00:00:00Z","metadata":{}},{"id":"artifact_2","kind":"translated_pdf","stage":"reconstruct","content_type":"application/pdf","checksum":"def456","size_bytes":91234,"created_at":"2026-07-02T00:01:00Z","metadata":{"rendered_pages":3}}]}}}},"404":{"description":"Document job not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/segments":{"get":{"summary":"List Document Segments","operationId":"list_document_segments_api_documents__document_id__segments_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"flagged","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Flagged"}},{"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"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Paginated reviewable segments walked off the persisted layout (the server is the single source of truth for the walk). `index` is the segment's position in the FULL unfiltered walk, so it stays stable across filters and pages. `flagged_total` counts flagged segments in the whole document regardless of the `flagged` filter. A job with no layout yet returns empty totals rather than an error. Each segment's `quality` carries the review signals only (score, needs_review, terminology compliance, fast-path provenance, corrected).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSegmentsResponse"},"example":{"total":2,"flagged_total":1,"limit":100,"offset":0,"segments":[{"index":0,"page":1,"target":"region","region_id":"region_1","source":"Termination for cause","translated":"Résiliation pour motif valable","quality":{"fast_path":"tm_exact"}},{"index":7,"page":2,"target":"table_cell","region_id":"region_42","cell_id":"table_7:0:3","source":"Net 30","translated":"Net 30","quality":{"needs_review":true,"terminology_compliant":false}}]}}}},"404":{"description":"Document job not found."},"422":{"description":"limit/offset out of bounds."}}}},"/api/documents/{document_id}/download":{"get":{"summary":"Download Document","operationId":"download_document_api_documents__document_id__download_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Binary PDF stream for translated output, falling back to source if needed.","content":{"application/json":{"schema":{}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Document or downloadable artifact not found."},"409":{"description":"Job is still queued; no translated output exists yet."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/review":{"post":{"summary":"Review Document","operationId":"review_document_api_documents__document_id__review_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentReviewRequest"}}}},"responses":{"200":{"description":"Review corrections applied and compact review summary returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDocumentReviewResponse"},"example":{"job":{"id":"doc_12345","tenant_id":"tenant_abc","request":{"source_lang":"en","target_lang":"fr","domain":"legal","metadata":{}},"status":"translated","source_file_name":"contract.pdf","quality_report":{"schema_version":"1.0","document_id":"layout_12345","source_lang":"en","target_lang":"fr","overall_score":0.97,"translated_units":24,"total_units":24,"findings":[],"metadata":{"validator":"document_validator.v1"}},"review_history":[{"reviewer":"alice","notes":"Use formal terminology.","applied_corrections":2,"rejected_corrections":1,"impacted_pages":[1,2],"conflicts":[{"target":"table_cell","region_id":"region_42","cell_id":"table_7:0:3","reason":"cell_id_not_found"}],"created_at":"2026-07-02T00:00:00Z"}],"artifacts":[],"created_at":"2026-07-02T00:00:00Z","updated_at":"2026-07-02T00:01:00Z"},"review_result":{"reviewer":"alice","applied_corrections":2,"rejected_corrections":1,"impacted_pages":[1,2],"conflict_codes":["cell_id_not_found"],"conflicts":[{"target":"table_cell","region_id":"region_42","cell_id":"table_7:0:3","reason":"cell_id_not_found"}],"fed_pairs":2}}}}},"400":{"description":"Invalid review request, unavailable document layout, or no reviewer identity (not signed in and no `reviewer` supplied)."},"404":{"description":"Document job not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/{document_id}/approve":{"post":{"summary":"Approve Document","operationId":"approve_document_api_documents__document_id__approve_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalRequest"}}}},"responses":{"200":{"description":"Document approved: eligible reviewed segments fed into the golden translation memory and the golden audit recorded. Idempotent — a second approve returns already_approved with fed_pairs=0.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDocumentApprovalResponse"},"example":{"job":{"id":"doc_12345","tenant_id":"tenant_abc","status":"translated","source_file_name":"contract.pdf","approved_at":"2026-07-02T00:05:00Z","approved_by":"alice","review_history":[],"artifacts":[],"created_at":"2026-07-02T00:00:00Z","updated_at":"2026-07-02T00:05:00Z"},"approval_result":{"approved":true,"already_approved":false,"reviewer":"alice@example.com","fed_pairs":22,"skipped":{"fast_path":1,"needs_review":1,"duplicates":0,"empty":0}}}}}},"400":{"description":"Document is not in a completed state, has no layout, or no reviewer identity (not signed in and no `reviewer` supplied)."},"404":{"description":"Document job not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/usage":{"get":{"summary":"Storage Usage","description":"The caller's platform-storage position: document artifact bytes resting\non the platform plane, the cap that governs them, and whether it is being\nenforced.\n\nDeliberately NOT behind _require_byos: the cap matters most on deployments\nwhere BYOS is disabled entirely — there every tenant is on platform\nstorage and there is no binding store at all.","operationId":"storage_usage_api_storage_usage_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Storage Usage Api Storage Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/binding":{"get":{"summary":"Get Binding","operationId":"get_binding_api_storage_binding_get","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Binding Api Storage Binding Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Binding","operationId":"put_binding_api_storage_binding_put","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageBindingUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Binding Api Storage Binding Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Binding","operationId":"delete_binding_api_storage_binding_delete","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Binding Api Storage Binding Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/binding/verify":{"post":{"summary":"Verify Binding","operationId":"verify_binding_api_storage_binding_verify_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Binding Api Storage Binding Verify Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/checkout":{"post":{"summary":"Create Checkout","description":"Create a subscription Checkout Session for the requested tier and return\nits redirect URL.\n\nThe tier is the whole request: it names the flat monthly price Stripe\ncharges in advance and, once the subscription lands, the tenant's included\ncharacters. A tier this deployment has no Price\nconfigured for is a 503 — the same shape as top-ups with no Price — rather\nthan a Checkout Session pointing at nothing.\n\nSubscribers get 409: plan changes go through the Customer Portal, never a\nsecond Checkout.","operationId":"create_checkout_api_billing_checkout_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Checkout Api Billing Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/topup":{"post":{"summary":"Create Topup","description":"Create a one-time Checkout Session for prepaid character packs and\nreturn its redirect URL.\n\nThe purchase-shape controls (3DS requested, and no ``setup_future_usage``\nso the card is never stored for automatic charges) live in the billing\nservice; Stripe Radar rules are Dashboard configuration, not code. What\nthis route adds is the part that must happen before Stripe is ever\ntouched: velocity, subscriber-only access, and the outstanding-balance\nceiling.","operationId":"create_topup_api_billing_topup_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Topup Api Billing Topup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/portal":{"post":{"summary":"Create Portal","description":"Create a Customer Portal session for self-service management.","operationId":"create_portal_api_billing_portal_post","parameters":[{"name":"api-version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01).","title":"Api-Version"},"description":"API contract to serve, as a released date (YYYY-MM-DD). Supported: 2026-09-01. Omit to get the oldest supported version (2026-09-01)."},{"name":"X-Api-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for the api-version query parameter. The query parameter wins when both are sent.","title":"X-Api-Version"},"description":"Alias for the api-version query parameter. The query parameter wins when both are sent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Portal Api Billing Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/webhook":{"post":{"summary":"Stripe Webhook","operationId":"stripe_webhook_api_stripe_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Stripe Webhook Api Stripe Webhook Post"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}}},"components":{"schemas":{"AgentStepStatus":{"type":"string","enum":["pending","running","completed","skipped","failed"],"title":"AgentStepStatus"},"AgentWorkflowStatus":{"type":"string","enum":["pending","running","waiting_for_human","completed","failed"],"title":"AgentWorkflowStatus"},"AuthenticatedUser":{"properties":{"user_id":{"type":"string","title":"User Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"provider":{"type":"string","enum":["email","oauth2"],"title":"Provider"},"role":{"type":"string","title":"Role","default":"agent_id_developer"}},"type":"object","required":["user_id","tenant_id","email","provider"],"title":"AuthenticatedUser"},"Body_oauth2_introspect_api_oauth2_introspect_post":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"Body_oauth2_introspect_api_oauth2_introspect_post"},"Body_oauth2_revoke_api_oauth2_revoke_post":{"properties":{"token":{"type":"string","title":"Token"},"token_type_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Type Hint"}},"type":"object","required":["token"],"title":"Body_oauth2_revoke_api_oauth2_revoke_post"},"Body_oauth2_token_api_oauth2_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"challenge_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Challenge Id"},"mfa_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mfa Code"},"scope":{"type":"string","title":"Scope","default":"translate:jobs"}},"type":"object","required":["grant_type"],"title":"Body_oauth2_token_api_oauth2_token_post"},"DocumentApprovalRequest":{"properties":{"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"DocumentApprovalRequest"},"DocumentApprovalResult":{"properties":{"approved":{"type":"boolean","title":"Approved","default":true},"already_approved":{"type":"boolean","title":"Already Approved","default":false},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"fed_pairs":{"type":"integer","title":"Fed Pairs","default":0},"skipped":{"additionalProperties":{"type":"integer"},"type":"object","title":"Skipped"},"feed_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feed Error"}},"type":"object","title":"DocumentApprovalResult"},"DocumentArtifactType":{"type":"string","enum":["source_pdf","source_document","layout_source_json","layout_translated_json","quality_report_json","agent_log_json","translated_pdf","translated_document"],"title":"DocumentArtifactType"},"DocumentFailureDetail":{"properties":{"code":{"type":"string","enum":["stage_timeout","transient_error","unexpected_error","interrupted"],"title":"Code"},"stage":{"type":"string","title":"Stage"},"message":{"type":"string","title":"Message"},"error_type":{"type":"string","title":"Error Type"},"retry_attempts":{"type":"integer","title":"Retry Attempts","default":0},"transient":{"type":"boolean","title":"Transient","default":false},"timeout":{"type":"boolean","title":"Timeout","default":false},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["code","stage","message","error_type"],"title":"DocumentFailureDetail"},"DocumentFedPair":{"properties":{"source_text":{"type":"string","title":"Source Text"},"target_text":{"type":"string","title":"Target Text"},"source_hash":{"type":"string","title":"Source Hash"},"corrected":{"type":"boolean","title":"Corrected","default":false},"stage":{"type":"string","enum":["review","approve"],"title":"Stage","default":"review"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["source_text","target_text","source_hash"],"title":"DocumentFedPair","description":"One (source, target) pair fed into the golden TM for a document, recorded\non the job's feed manifest so re-reviews and re-approvals never double-feed\nthe same pair. ``stage`` records whether it was fed at review (an incremental\nhuman correction) or at approve (the bulk clean-segment sweep)."},"DocumentFeedManifest":{"properties":{"fed_pairs":{"items":{"$ref":"#/components/schemas/DocumentFedPair"},"type":"array","title":"Fed Pairs"},"skipped":{"additionalProperties":{"type":"integer"},"type":"object","title":"Skipped"},"golden_skipped_at_cap":{"type":"integer","title":"Golden Skipped At Cap","default":0},"last_feed_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Feed Error"}},"type":"object","title":"DocumentFeedManifest","description":"Durable record of what a document has fed into learning. Optional with a\ndefault so jobs persisted before the learning feed existed load unchanged."},"DocumentJobStatus":{"type":"string","enum":["pending","queued","extracted","translated","failed"],"title":"DocumentJobStatus"},"DocumentQualityFinding":{"properties":{"severity":{"type":"string","enum":["info","warning","error"],"title":"Severity"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"unit_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["severity","code","message"],"title":"DocumentQualityFinding"},"DocumentQualityReport":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.0"},"document_id":{"type":"string","title":"Document Id"},"source_lang":{"type":"string","title":"Source Lang"},"target_lang":{"type":"string","title":"Target Lang"},"overall_score":{"type":"number","title":"Overall Score","default":1.0},"translated_units":{"type":"integer","title":"Translated Units","default":0},"total_units":{"type":"integer","title":"Total Units","default":0},"findings":{"items":{"$ref":"#/components/schemas/DocumentQualityFinding"},"type":"array","title":"Findings"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["document_id","source_lang","target_lang"],"title":"DocumentQualityReport"},"DocumentReviewCorrection":{"properties":{"target":{"type":"string","enum":["region","table_cell"],"title":"Target","default":"region"},"region_id":{"type":"string","title":"Region Id"},"cell_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cell Id"},"translated_text":{"type":"string","title":"Translated Text"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["region_id","translated_text"],"title":"DocumentReviewCorrection"},"DocumentReviewRecord":{"properties":{"reviewer":{"type":"string","title":"Reviewer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"applied_corrections":{"type":"integer","title":"Applied Corrections","default":0},"rejected_corrections":{"type":"integer","title":"Rejected Corrections","default":0},"impacted_pages":{"items":{"type":"integer"},"type":"array","title":"Impacted Pages"},"conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conflicts"},"fed_pairs":{"type":"integer","title":"Fed Pairs","default":0},"feed_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feed Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["reviewer"],"title":"DocumentReviewRecord"},"DocumentReviewRequest":{"properties":{"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"corrections":{"items":{"$ref":"#/components/schemas/DocumentReviewCorrection"},"type":"array","title":"Corrections"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"DocumentReviewRequest"},"DocumentReviewSummary":{"properties":{"reviewer":{"type":"string","title":"Reviewer"},"applied_corrections":{"type":"integer","title":"Applied Corrections","default":0},"rejected_corrections":{"type":"integer","title":"Rejected Corrections","default":0},"impacted_pages":{"items":{"type":"integer"},"type":"array","title":"Impacted Pages"},"conflict_codes":{"items":{"type":"string"},"type":"array","title":"Conflict Codes"},"conflicts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conflicts"},"fed_pairs":{"type":"integer","title":"Fed Pairs","default":0},"feed_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feed Error"}},"type":"object","required":["reviewer"],"title":"DocumentReviewSummary"},"DocumentSegment":{"properties":{"index":{"type":"integer","title":"Index"},"page":{"type":"integer","title":"Page"},"target":{"type":"string","enum":["region","table_cell"],"title":"Target","default":"region"},"region_id":{"type":"string","title":"Region Id"},"cell_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cell Id"},"source":{"type":"string","title":"Source"},"translated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated"},"quality":{"additionalProperties":true,"type":"object","title":"Quality"}},"type":"object","required":["index","page","region_id","source"],"title":"DocumentSegment","description":"One reviewable segment of a translated layout, as served by\nGET /api/documents/{id}/segments."},"DocumentSegmentsResponse":{"properties":{"total":{"type":"integer","title":"Total","default":0},"flagged_total":{"type":"integer","title":"Flagged Total","default":0},"limit":{"type":"integer","title":"Limit","default":100},"offset":{"type":"integer","title":"Offset","default":0},"segments":{"items":{"$ref":"#/components/schemas/DocumentSegment"},"type":"array","title":"Segments"}},"type":"object","title":"DocumentSegmentsResponse"},"DocumentTranslationRequest":{"properties":{"source_lang":{"type":"string","title":"Source Lang","default":"en"},"target_lang":{"type":"string","title":"Target Lang"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"text_type":{"anyOf":[{"type":"string","enum":["Plain","Html"]},{"type":"null"}],"title":"Text Type"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"}},"type":"object","required":["target_lang"],"title":"DocumentTranslationRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HumanReviewStatus":{"type":"string","enum":["open","completed","cancelled"],"title":"HumanReviewStatus"},"HumanReviewTask":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/HumanReviewStatus","default":"open"},"requested_by":{"type":"string","title":"Requested By","default":"review_gate_agent"},"reason":{"type":"string","title":"Reason"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"requested_actions":{"items":{"type":"string","enum":["save","approve","modify","reject"]},"type":"array","title":"Requested Actions"},"triggers":{"items":{"$ref":"#/components/schemas/HumanReviewTrigger"},"type":"array","title":"Triggers"},"completed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["reason"],"title":"HumanReviewTask"},"HumanReviewTrigger":{"properties":{"code":{"type":"string","enum":["policy_required","low_quality_score","critical_issue","terminology_uncertainty","terminology_noncompliant","sensitive_content","high_repair_delta","verification_failed","risk_flag"],"title":"Code"},"severity":{"type":"string","enum":["info","warning","blocking"],"title":"Severity"},"message":{"type":"string","title":"Message"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"}},"type":"object","required":["code","severity","message"],"title":"HumanReviewTrigger"},"InviteCreateRequest":{"properties":{"role":{"type":"string","title":"Role"},"expires_days":{"type":"integer","title":"Expires Days","default":7},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"label":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Label"}},"type":"object","title":"InviteCreateRequest","description":"POST /api/tenants/invites body — mint one invite link for this tenant.\n\nThe invite decides the joiner's starting role, so `role` is validated\nagainst the real role table rather than normalized down silently. `email`,\nwhen given, binds the link to one address; `label` is an admin-facing note\n(\"Q3 contractors\") that never reaches the joiner."},"InvitePreviewRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"InvitePreviewRequest","description":"POST /api/auth/invites/preview body — public, so the response says only\nwhether the token is live and which workspace it opens."},"JobStatus":{"type":"string","enum":["pending","translated","refined","awaiting_review","approved","human_edited","rejected","published","failed","persistence_failed"],"title":"JobStatus"},"LearningSignal":{"properties":{"signal_type":{"type":"string","enum":["translation_memory","reviewer_edit","terminology_preference","style_preference","quality_override","retraining_readiness","document_approved"],"title":"Signal Type"},"source_lang":{"type":"string","title":"Source Lang"},"target_lang":{"type":"string","title":"Target Lang"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"source_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Text"},"before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","default":1.0},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["signal_type","source_lang","target_lang"],"title":"LearningSignal"},"MfaChallengeVerifyRequest":{"properties":{"challenge_id":{"type":"string","title":"Challenge Id"},"code":{"type":"string","title":"Code"},"scope":{"type":"string","title":"Scope","default":"translate:jobs"}},"type":"object","required":["challenge_id","code"],"title":"MfaChallengeVerifyRequest"},"MfaEnrollConfirmRequest":{"properties":{"secret":{"type":"string","title":"Secret"},"code":{"type":"string","title":"Code"},"challenge_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Challenge Id"}},"type":"object","required":["secret","code"],"title":"MfaEnrollConfirmRequest"},"MfaEnrollRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"challenge_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Challenge Id"}},"type":"object","title":"MfaEnrollRequest"},"OAuth2IntrospectionResponse":{"properties":{"active":{"type":"boolean","title":"Active"},"token_type":{"anyOf":[{"type":"string","enum":["access_token","refresh_token"]},{"type":"null"}],"title":"Token Type"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"exp":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp"},"sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["active"],"title":"OAuth2IntrospectionResponse"},"OAuth2TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","const":"bearer","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"scope":{"type":"string","title":"Scope"},"user":{"$ref":"#/components/schemas/AuthenticatedUser"},"refresh_token":{"type":"string","title":"Refresh Token"},"refresh_expires_in":{"type":"integer","title":"Refresh Expires In"}},"type":"object","required":["access_token","expires_in","scope","user","refresh_token","refresh_expires_in"],"title":"OAuth2TokenResponse"},"OAuthAuthorizeRequest":{"properties":{"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"monthly_char_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Monthly Char Limit"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"email_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Hint"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"invite_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite Token"}},"type":"object","title":"OAuthAuthorizeRequest"},"OAuthCallbackRequest":{"properties":{"state":{"type":"string","title":"State"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"id_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id Token"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"code_verifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Verifier"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"monthly_char_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Monthly Char Limit"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["state"],"title":"OAuthCallbackRequest"},"PasswordResetRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"PasswordResetRequest","description":"POST /api/auth/password-reset body — completes an admin-minted reset\nlink. The token is \"<user_id>.<secret>\"; it locates the account itself, so\nno email or tenant is (or may be) supplied by the caller."},"QualityIssue":{"properties":{"severity":{"type":"string","enum":["minor","major","critical"],"title":"Severity"},"category":{"type":"string","enum":["accuracy","fluency","terminology","style","locale"],"title":"Category"},"span":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Span"},"explanation":{"type":"string","title":"Explanation"},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion"}},"type":"object","required":["severity","category","explanation"],"title":"QualityIssue"},"ReviewSubmission":{"properties":{"action":{"type":"string","enum":["save","approve","modify","reject"],"title":"Action"},"final_translation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Translation"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"reviewer":{"type":"string","title":"Reviewer"}},"type":"object","required":["action","reviewer"],"title":"ReviewSubmission"},"StorageBindingUpsert":{"properties":{"provider":{"type":"string","enum":["platform","adls"],"title":"Provider","default":"adls"},"account_url":{"type":"string","title":"Account Url","default":""},"filesystem":{"type":"string","title":"Filesystem","default":""},"prefixes":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Prefixes"},"auth_mode":{"type":"string","enum":["managed_identity","sas","connection_string"],"title":"Auth Mode","default":"managed_identity"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},"type":"object","title":"StorageBindingUpsert"},"TenantAccount":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"api_key_prefix":{"type":"string","title":"Api Key Prefix"},"monthly_char_limit":{"type":"integer","minimum":1.0,"title":"Monthly Char Limit","default":500000},"active":{"type":"boolean","title":"Active","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["name","api_key_prefix"],"title":"TenantAccount"},"TenantAccountCreate":{"properties":{"name":{"type":"string","title":"Name"},"monthly_char_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Monthly Char Limit"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["name"],"title":"TenantAccountCreate"},"TenantAgentDecision":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"outcome":{"type":"string","title":"Outcome"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","label","outcome","created_at"],"title":"TenantAgentDecision","description":"One decision the workflow made, with the rationale written for a human.\n\n`metadata` is absent: it is operator-only diagnostic data. The rationale\nalready says, in prose, what the tenant is owed."},"TenantAgentRun":{"properties":{"id":{"type":"string","title":"Id"},"workflow_name":{"type":"string","title":"Workflow Name"},"status":{"$ref":"#/components/schemas/AgentWorkflowStatus"},"current_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Step"},"steps":{"items":{"$ref":"#/components/schemas/TenantAgentStep"},"type":"array","title":"Steps"},"quality_gate":{"anyOf":[{"$ref":"#/components/schemas/TenantQualityGate"},{"type":"null"}]},"human_review_task":{"anyOf":[{"$ref":"#/components/schemas/HumanReviewTask"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","workflow_name","status","started_at"],"title":"TenantAgentRun","description":"The workflow trace a tenant may read.\n\n`metadata` is absent at every level of this tree — run, step, tool call,\ndecision. The human review task is served WHOLE: it is the question we put\nto the reviewer, written for them."},"TenantAgentStep":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"actor":{"type":"string","title":"Actor"},"kind":{"type":"string","enum":["agent","tool","human","system"],"title":"Kind","default":"agent"},"status":{"$ref":"#/components/schemas/AgentStepStatus"},"input_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Summary"},"output_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Summary"},"tool_calls":{"items":{"$ref":"#/components/schemas/TenantToolTrace"},"type":"array","title":"Tool Calls"},"decisions":{"items":{"$ref":"#/components/schemas/TenantAgentDecision"},"type":"array","title":"Decisions"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","name","actor","status","started_at"],"title":"TenantAgentStep","description":"One workflow step. Names, actor, status and summaries — which is exactly\nwhat the review timeline renders — plus its tool calls and decisions.\n`metadata` is absent for the same reason as the tool call's."},"TenantDocumentApprovalResponse":{"properties":{"job":{"$ref":"#/components/schemas/TenantDocumentJob"},"approval_result":{"$ref":"#/components/schemas/DocumentApprovalResult"}},"type":"object","required":["job","approval_result"],"title":"TenantDocumentApprovalResponse"},"TenantDocumentArtifact":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"$ref":"#/components/schemas/DocumentArtifactType"},"stage":{"type":"string","title":"Stage"},"content_type":{"type":"string","title":"Content Type"},"checksum":{"type":"string","title":"Checksum"},"size_bytes":{"type":"integer","title":"Size Bytes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["id","kind","stage","content_type","checksum","size_bytes","created_at"],"title":"TenantDocumentArtifact","description":"One stored file, as the customer sees it.\n\n``path`` is absent by construction, not blanked: it is a server filesystem\nlocation and there is no tenant-facing use for it — the bytes come from\nGET /api/documents/{id}/download."},"TenantDocumentJob":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"request":{"$ref":"#/components/schemas/DocumentTranslationRequest"},"status":{"$ref":"#/components/schemas/DocumentJobStatus"},"source_file_name":{"type":"string","title":"Source File Name"},"source_format":{"type":"string","title":"Source Format","default":"pdf"},"layout":{"type":"null","title":"Layout"},"quality_report":{"anyOf":[{"$ref":"#/components/schemas/DocumentQualityReport"},{"type":"null"}]},"billable_chars":{"type":"integer","title":"Billable Chars","default":0},"review_history":{"items":{"$ref":"#/components/schemas/DocumentReviewRecord"},"type":"array","title":"Review History"},"artifacts":{"items":{"$ref":"#/components/schemas/TenantDocumentArtifact"},"type":"array","title":"Artifacts"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"feed_manifest":{"$ref":"#/components/schemas/DocumentFeedManifest"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"failure":{"anyOf":[{"$ref":"#/components/schemas/DocumentFailureDetail"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","request","status","source_file_name","created_at","updated_at"],"title":"TenantDocumentJob","description":"A document translation job as served to its owning tenant.\n\nAbsent relative to the stored job, deliberately:\n  layout            - internal representation; segments are served\n                      (redacted) by GET /api/documents/{id}/segments\n                      instead.\n  usage             - internal service diagnostics. `billable_chars`\n                      below is the customer-facing metering quantity and\n                      stays.\n  stage_timings_ms  - internal timings.\n\nKept, deliberately: `error` and `failure` (including failure.stage — a\ncustomer whose job failed is owed which phase failed), `review_history`,\n`feed_manifest`, and the approval stamp."},"TenantDocumentReviewResponse":{"properties":{"job":{"$ref":"#/components/schemas/TenantDocumentJob"},"review_result":{"$ref":"#/components/schemas/DocumentReviewSummary"}},"type":"object","required":["job","review_result"],"title":"TenantDocumentReviewResponse"},"TenantEmailSignupRequest":{"properties":{"tenant_name":{"type":"string","title":"Tenant Name"},"email":{"type":"string","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"},"monthly_char_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Monthly Char Limit"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"invite_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite Token"}},"type":"object","required":["tenant_name","email","password"],"title":"TenantEmailSignupRequest"},"TenantQualityAssessment":{"properties":{"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score"},"issues":{"items":{"$ref":"#/components/schemas/QualityIssue"},"type":"array","title":"Issues"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["score","created_at"],"title":"TenantQualityAssessment","description":"The quality judgement, as the customer sees it.\n\n`model` and `usage` are absent by construction: they are internal service\ndiagnostics, not part of the tenant contract."},"TenantQualityGate":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name","default":"human_review_gate"},"decision":{"type":"string","enum":["pass","needs_human","fail"],"title":"Decision"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"triggers":{"items":{"$ref":"#/components/schemas/HumanReviewTrigger"},"type":"array","title":"Triggers"},"score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Score"},"threshold":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","decision","created_at"],"title":"TenantQualityGate","description":"The publish/review decision and the numbers it was made on.\n\n`metadata` is rebuilt from a whitelist rather than dropped whole: the scores\nand trigger codes in it are the tenant's own outcome; internal diagnostic\nentries beside them are not served."},"TenantRefinement":{"properties":{"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score"},"refined_translation":{"type":"string","title":"Refined Translation"},"issues":{"items":{"$ref":"#/components/schemas/QualityIssue"},"type":"array","title":"Issues"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["score","refined_translation","created_at"],"title":"TenantRefinement","description":"The repaired candidate and why it was repaired. Same two omissions as\nthe assessment; `refined_translation` is the customer's text."},"TenantSecurityPolicyRequest":{"properties":{"mfa_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mfa Required"},"mfa_required_for_sso":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mfa Required For Sso"},"sso_auto_join":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sso Auto Join"}},"type":"object","title":"TenantSecurityPolicyRequest","description":"PATCH /api/tenants/security body — a tenant's own sign-in policy.\n\nEvery field is tri-state: None (the default) leaves that flag as it is, so\na caller can flip one without restating the others and clobbering a change\nit never saw.\n\n`sso_auto_join` is the odd one out: absent means ON (the behavior every\ntenant predating the toggle runs under), so only an explicit false closes\nthe domain. With it off, matching the tenant's Google Workspace hd no\nlonger creates a member — joining takes an invite. Existing members always\nkeep signing in."},"TenantToolTrace":{"properties":{"id":{"type":"string","title":"Id"},"tool_name":{"type":"string","title":"Tool Name"},"status":{"$ref":"#/components/schemas/AgentStepStatus"},"input_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Summary"},"output_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","tool_name","status","started_at"],"title":"TenantToolTrace","description":"One tool call on the timeline: what ran, how it ended, its summaries.\n\n`metadata` is absent — it is operator-only diagnostic data."},"TenantTranslationJob":{"properties":{"id":{"type":"string","title":"Id"},"request":{"$ref":"#/components/schemas/TranslationRequest"},"agent_run":{"$ref":"#/components/schemas/TenantAgentRun"},"baseline_translation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Baseline Translation"},"quality_assessment":{"anyOf":[{"$ref":"#/components/schemas/TenantQualityAssessment"},{"type":"null"}]},"refinement":{"anyOf":[{"$ref":"#/components/schemas/TenantRefinement"},{"type":"null"}]},"verification":{"anyOf":[{"$ref":"#/components/schemas/TenantVerification"},{"type":"null"}]},"final_translation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Translation"},"reviewer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer"},"review_action":{"anyOf":[{"type":"string","enum":["save","approve","modify","reject"]},{"type":"null"}],"title":"Review Action"},"review_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Notes"},"learning_signals":{"items":{"$ref":"#/components/schemas/LearningSignal"},"type":"array","title":"Learning Signals"},"status":{"$ref":"#/components/schemas/JobStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","request","agent_run","status","created_at","updated_at"],"title":"TenantTranslationJob","description":"A text translation job as served to its owning tenant.\n\nEvery field of the stored job is here; four of them are narrowed:\n\n  request           - metadata minus `candidate_models`.\n  quality_assessment / refinement / verification\n                    - minus internal diagnostic fields.\n  agent_run         - minus every `metadata` dict in the tree.\n\nKept, deliberately: `reasoning` on all three quality stages (the reviewer's\nQA explanation card is parsed out of it), the agent-log names/statuses/\nsummaries the timeline renders, the gate's reasons and triggers, and the\nlearning signals — all of it is review product about the customer's text,\nnot a description of how the service is built."},"TenantVerification":{"properties":{"passed":{"type":"boolean","title":"Passed"},"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score"},"issues":{"items":{"$ref":"#/components/schemas/QualityIssue"},"type":"array","title":"Issues"},"checks":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Checks"},"risk_flags":{"items":{"type":"string"},"type":"array","title":"Risk Flags"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["passed","score","created_at"],"title":"TenantVerification","description":"The verification pass: what was checked and what it concluded.\n\n`checks` and `risk_flags` are findings ABOUT the customer's translation, so\nthey stay; internal service diagnostics do not."},"TranslationRequest":{"properties":{"source_text":{"type":"string","title":"Source Text"},"source_lang":{"type":"string","title":"Source Lang","default":"en"},"target_lang":{"type":"string","title":"Target Lang"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"text_type":{"anyOf":[{"type":"string","enum":["Plain","Html"]},{"type":"null"}],"title":"Text Type"},"deployment_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployment Name"},"adaptive_dataset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adaptive Dataset Id"},"allow_fallback":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allow Fallback"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"}},"type":"object","required":["source_text","target_lang"],"title":"TranslationRequest"},"UserRoleUpdateRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UserRoleUpdateRequest"},"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"}}}}