{"openapi":"3.0.0","paths":{"/users/current/permissions":{"get":{"operationId":"RolesController_currentUserPermissions","parameters":[{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveAccessDto"}}}}},"security":[{"bearer":[]}],"summary":"The caller's own effective RBAC access — assigned roles + permission\nkeys. Unprivileged: every authenticated user may read their own access\n(it's the foundation for client-side `can()` gating). No `authorize`\ncall because there is no cross-user data exposure — supplying an\n`organizationId` only ever narrows the caller's *own* access to that org,\nso it can never surface another tenant's roles.","tags":["Roles"]}},"/permissions":{"get":{"operationId":"RolesController_permissionCatalog","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Read-only catalog of every permission. Gated like the rest of this\ncontroller — `Read` on the `role` subject, which the seeded\n`role.manage.admin` (manage ⊇ read) satisfies for global admins.","tags":["Roles"]}},"/roles-catalog":{"get":{"operationId":"RolesController_systemRoleCatalog","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"summary":"Read-only catalog of SYSTEM roles. CUSTOM roles are tenant data and are\nlisted per-org via `GET /organizations/:orgId/roles`.","tags":["Roles"]}},"/audit-log":{"get":{"deprecated":true,"description":"The permission audit log: role and grant changes only (who granted or revoked which role to whom), offset-paginated, admin-scoped. NOT your organization's full audit trail — for that use `GET /organizations/{organizationId}/audit-trail`, which covers mutations, deletions, workflow, grants and exports. DEPRECATED: every permission change is already written to the audit spine as a GRANT fact, so read `GET /organizations/{organizationId}/audit-trail?category=GRANT` instead. The `PermissionAuditLog` table this endpoint reads was frozen at the writer cutover — no rows after the writer-cutover release (August 2026); retained rows are kept only for the statutory retention period. Behaviour is unchanged until this endpoint is removed.","operationId":"RolesController_auditLog","parameters":[{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"subjectId","required":false,"in":"query","schema":{"type":"string"}},{"name":"subjectType","required":false,"in":"query","schema":{"type":"string"}},{"name":"roleId","required":false,"in":"query","schema":{"type":"string"}},{"name":"actorId","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"type":"number"}},{"name":"pageSize","required":false,"in":"query","schema":{"minimum":1,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"DEPRECATED — use GET /organizations/{organizationId}/audit-trail?category=GRANT","tags":["Roles"]}},"/roles":{"post":{"operationId":"RolesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/organizations/{orgId}/roles":{"get":{"operationId":"RolesController_list","parameters":[{"name":"orgId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/roles/{id}":{"get":{"operationId":"RolesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Roles"]},"patch":{"operationId":"RolesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]},"delete":{"operationId":"RolesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/roles/{roleId}/users":{"get":{"operationId":"RolesController_listAssignees","parameters":[{"name":"roleId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/roles/{roleId}/users/connect":{"post":{"operationId":"RolesController_connectUsers","parameters":[{"name":"roleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectUsersToRoleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/roles/{roleId}/users/disconnect":{"post":{"operationId":"RolesController_disconnectUsers","parameters":[{"name":"roleId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectUsersToRoleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Roles"]}},"/organizations/{organizationId}/audit-trail":{"get":{"description":"The tenant-facing audit trail (revisjonslogg): who did what to what, when — the customer view over the platform's evidentiary audit log. Newest first, keyset-paginated (loop on `nextCursor` until null). Covers MUTATION, DELETION, WORKFLOW, GRANT and EXPORT facts; platform and operator events are never included. Changeset CONTENT is not exposed here (`hasChangeset` only). NOT the same as `GET /audit-log`, which is the RBAC permission-change log (roles and grants only, admin-scoped) — that endpoint reads the frozen legacy table; live permission changes are GRANT facts here.","operationId":"AuditTrailController_list","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"category","required":false,"in":"query","description":"Narrows within the tenant-visible category set.","schema":{"$ref":"#/components/schemas/AuditTrailCategory"}},{"name":"actorId","required":false,"in":"query","description":"Everything this actor (user or service account) did.","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"eventSubjectId","required":false,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"eventType","required":false,"in":"query","description":"A single WORKFLOW verb (implies category=WORKFLOW; combining it with another category is a 400). Validated against the verb registry — see `eventType` on the response for the documented values.","schema":{"example":"REPORT_APPROVED","type":"string","enum":["ADVANCE_GRANTED","ADVANCE_CANCELED","ADVANCE_DISBURSED","ADVANCE_SETTLED","ADVANCE_REVERSED","ADVANCE_REPAID","ADVANCE_ADJUSTED","ADVANCE_WRITTEN_OFF","REPORT_SUBMITTED","REPORT_APPROVED","REPORT_UNAPPROVED","REPORT_REJECTED","REPORT_UNREJECTED","REPORT_OVERRIDDEN","REPORT_PUBLISHED","REPORT_RESTORED","REPORT_FLOW_RERUN","REPORT_UNSUBMITTED","REPORT_AMENDED","REPORT_TRANSFERRED_OUT","REPORT_TRANSFERRED_IN","REPORT_TRANSFER_FAILED","REVIEW_REQUESTED","REVIEW_COMPLETED","REVIEW_REASSIGNED","REVIEW_OVERRIDDEN","REVIEW_WITHDRAWN","REVIEW_INVALIDATED","ACCOUNT_BLOCKED","ACCOUNT_UNBLOCKED","USER_BLOCKED","USER_UNBLOCKED","INVITATION_SENT","INVITATION_ACCEPTED","INVITATION_REVOKED","MEMBER_PROVISIONED","MEMBER_DEPROVISIONED","SUBSCRIPTION_ACTIVATED","SUBSCRIPTION_SUSPENDED","SUBSCRIPTION_REACTIVATED","SUBSCRIPTION_CANCELED","SUBSCRIPTION_PLAN_CHANGED","INVOICE_SENT","INVOICE_DELIVERED","INVOICE_FAILED","ORGANIZATION_DELETED","ORGANIZATION_RESTORED","ORGANIZATION_APPROVAL_SETTINGS_CHANGED","ORGANIZATION_AMEND_POLICY_CHANGED","ENTERPRISE_ORGANIZATION_LINKED","ENTERPRISE_ORGANIZATION_UNLINKED","FINDING_DISMISSED","FINDING_CONFIRMED","FINDING_UNRESOLVED","FINDING_AUTO_RESOLVED","DUPLICATE_DISMISSED","DUPLICATE_CONFIRMED","DUPLICATE_UNRESOLVED"]}},{"name":"from","required":false,"in":"query","description":"ISO 8601 lower bound on createdAt, with an explicit zone (e.g. 2026-08-01T00:00:00Z).","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}},{"name":"to","required":false,"in":"query","description":"ISO 8601 upper bound on createdAt, with an explicit zone (e.g. 2026-08-31T23:59:59Z).","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Opaque continuation token from a previous page; bound to the filter set it was issued under.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size, 1–100. Defaults to 50.","schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditTrailPageDto"}}}}},"security":[{"bearer":[]}],"summary":"Your organization's audit trail","tags":["Audit trail"]}},"/organizations/{organizationId}/audit-trail/export":{"get":{"description":"NDJSON download of the audit trail — the same rows, shape and filters as the list endpoint. Line protocol: every line is `{\"type\":\"row\",...}` (same shape as the list items) except the LAST line, always `{\"type\":\"end\",\"nextCursor\":<token|null>,\"rows\":<n>}`. A response without an `end` line was severed mid-stream — discard and resume with the last complete `end` cursor. Capped per request (rows and wall-clock); loop on `nextCursor` until null. Generated clients should treat this as a raw download, not a typed body. Every export request is itself recorded as an EXPORT audit fact before streaming.","operationId":"AuditTrailController_export","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"category","required":false,"in":"query","description":"Narrows within the tenant-visible category set.","schema":{"$ref":"#/components/schemas/AuditTrailCategory"}},{"name":"actorId","required":false,"in":"query","description":"Everything this actor (user or service account) did.","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"eventSubjectId","required":false,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"eventType","required":false,"in":"query","description":"A single WORKFLOW verb (implies category=WORKFLOW; combining it with another category is a 400). Validated against the verb registry — see `eventType` on the response for the documented values.","schema":{"example":"REPORT_APPROVED","type":"string","enum":["ADVANCE_GRANTED","ADVANCE_CANCELED","ADVANCE_DISBURSED","ADVANCE_SETTLED","ADVANCE_REVERSED","ADVANCE_REPAID","ADVANCE_ADJUSTED","ADVANCE_WRITTEN_OFF","REPORT_SUBMITTED","REPORT_APPROVED","REPORT_UNAPPROVED","REPORT_REJECTED","REPORT_UNREJECTED","REPORT_OVERRIDDEN","REPORT_PUBLISHED","REPORT_RESTORED","REPORT_FLOW_RERUN","REPORT_UNSUBMITTED","REPORT_AMENDED","REPORT_TRANSFERRED_OUT","REPORT_TRANSFERRED_IN","REPORT_TRANSFER_FAILED","REVIEW_REQUESTED","REVIEW_COMPLETED","REVIEW_REASSIGNED","REVIEW_OVERRIDDEN","REVIEW_WITHDRAWN","REVIEW_INVALIDATED","ACCOUNT_BLOCKED","ACCOUNT_UNBLOCKED","USER_BLOCKED","USER_UNBLOCKED","INVITATION_SENT","INVITATION_ACCEPTED","INVITATION_REVOKED","MEMBER_PROVISIONED","MEMBER_DEPROVISIONED","SUBSCRIPTION_ACTIVATED","SUBSCRIPTION_SUSPENDED","SUBSCRIPTION_REACTIVATED","SUBSCRIPTION_CANCELED","SUBSCRIPTION_PLAN_CHANGED","INVOICE_SENT","INVOICE_DELIVERED","INVOICE_FAILED","ORGANIZATION_DELETED","ORGANIZATION_RESTORED","ORGANIZATION_APPROVAL_SETTINGS_CHANGED","ORGANIZATION_AMEND_POLICY_CHANGED","ENTERPRISE_ORGANIZATION_LINKED","ENTERPRISE_ORGANIZATION_UNLINKED","FINDING_DISMISSED","FINDING_CONFIRMED","FINDING_UNRESOLVED","FINDING_AUTO_RESOLVED","DUPLICATE_DISMISSED","DUPLICATE_CONFIRMED","DUPLICATE_UNRESOLVED"]}},{"name":"from","required":false,"in":"query","description":"ISO 8601 lower bound on createdAt, with an explicit zone (e.g. 2026-08-01T00:00:00Z).","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}},{"name":"to","required":false,"in":"query","description":"ISO 8601 upper bound on createdAt, with an explicit zone (e.g. 2026-08-31T23:59:59Z).","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Opaque continuation token from a previous page; bound to the filter set it was issued under.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size, 1–100. Defaults to 50.","schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Export your organization's audit trail (NDJSON)","tags":["Audit trail"]}},"/auth/logout":{"post":{"operationId":"AuthController_logout","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Log out a user.","tags":["Auth"]}},"/auth/refresh":{"post":{"operationId":"AuthController_refresh","parameters":[{"name":"singlePageApplication","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokensDto"}}}}},"summary":"Refresh an access token.","tags":["Auth"]}},"/auth/test-login":{"post":{"operationId":"AuthController_test","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestUserLoginDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokensDto"}}}}},"summary":"Login with test user","tags":["Auth"]}},"/auth/exchange-code":{"post":{"operationId":"AuthController_exchangeCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeCodeDto"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExchangeCodeSuccessResponseDto"},{"$ref":"#/components/schemas/ExchangeCodeUnverifiedResponseDto"}]}}},"description":""}},"tags":["Auth"]}},"/auth/verify/phone/request":{"post":{"operationId":"AuthController_requestPhoneVerification","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPhoneVerificationDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/verify/phone/confirm":{"post":{"operationId":"AuthController_confirmPhoneVerification","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPhoneVerificationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokensDto"}}}}},"tags":["Auth"]}},"/auth/provider":{"get":{"operationId":"AuthController_getOrganizationAuthProvider","parameters":[{"name":"domain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnProviderDto"}}}}},"tags":["Auth"]}},"/.well-known/jwks.json":{"get":{"operationId":"JwksController_getJwks","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["JWKS"]}},"/auth/sso/start":{"get":{"operationId":"SsoController_start","parameters":[],"responses":{"200":{"description":""}},"tags":["Sso"]}},"/auth/oidc/callback":{"get":{"operationId":"SsoController_callback","parameters":[],"responses":{"200":{"description":""}},"tags":["Sso"]}},"/users":{"post":{"operationId":"UsersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"security":[{"bearer":[]}],"tags":["Users"]},"get":{"operationId":"UsersController_findAll","parameters":[{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/current":{"get":{"operationId":"UsersController_findCurrent","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}":{"get":{"operationId":"UsersController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"security":[{"bearer":[]}],"tags":["Users"]},"patch":{"operationId":"UsersController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]},"delete":{"operationId":"UsersController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/profile-picture":{"post":{"operationId":"UsersController_uploadProfilePicture","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]},"delete":{"operationId":"UsersController_deleteProfilePicture","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/block":{"patch":{"operationId":"UsersController_block","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/unblock":{"patch":{"operationId":"UsersController_unblock","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/role":{"patch":{"operationId":"UsersController_updateRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/personal":{"post":{"operationId":"UsersController_activatePersonal","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"security":[{"bearer":[]}],"tags":["Users"]},"delete":{"operationId":"UsersController_deactivatePersonal","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEntity"}}}}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/restore":{"post":{"operationId":"UsersController_restore","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/paymentcard":{"post":{"operationId":"UsersController_addPaymentCard","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPaymentCardDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/paymentcard/{paymentCardId}":{"patch":{"operationId":"UsersController_updatePaymentCard","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"paymentCardId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentCardDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]},"delete":{"operationId":"UsersController_removePaymentCard","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"paymentCardId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/push-token":{"post":{"operationId":"UsersController_addPushToken","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPushTokenDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/{id}/push-token/{pushToken}":{"delete":{"operationId":"UsersController_removePushToken","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"pushToken","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Users"]}},"/inbox":{"post":{"operationId":"InboxController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInboxDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxEntity"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]},"get":{"operationId":"InboxController_findByQuery","parameters":[{"name":"accountId","required":false,"in":"query","schema":{"type":"string"}},{"name":"userId","required":false,"in":"query","schema":{"type":"string"}},{"name":"inboxId","required":false,"in":"query","schema":{"type":"string"}},{"name":"email","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxEntity"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/{id}":{"patch":{"operationId":"InboxController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInboxDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxEntity"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]},"get":{"operationId":"InboxController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxEntity"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/availability":{"get":{"operationId":"InboxController_getInboxAvailability","parameters":[{"name":"email","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxAvailableResponse"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/mine":{"get":{"operationId":"InboxController_mine","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyInboxesResponse"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/{inboxId}/items":{"get":{"operationId":"InboxController_findItems","parameters":[{"name":"inboxId","required":true,"in":"path","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"$ref":"#/components/schemas/InboxItemStatus"}},{"name":"organizationId","required":false,"in":"query","description":"Organization to tag the item with; null clears the tag. Ignored on organization-locked inboxes (the item is always stamped with the inbox organization); on personal inboxes it must be an organization the inbox owner is a member of.","schema":{"nullable":true,"type":"string"}},{"name":"expenseId","required":false,"in":"query","description":"Expense to link the item to; must belong to the inbox owner. The literal string 'NULL' (or null) unlinks.","schema":{"nullable":true,"type":"string"}},{"name":"from","required":false,"in":"query","schema":{"type":"string"}},{"name":"amount","required":false,"in":"query","schema":{"type":"number"}},{"name":"currency","required":false,"in":"query","schema":{"type":"string"}},{"name":"date","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"merchant","required":false,"in":"query","schema":{"type":"string"}},{"name":"description","required":false,"in":"query","schema":{"type":"string"}},{"name":"reservationId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]},"post":{"operationId":"InboxController_addItem","parameters":[{"name":"inboxId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddInboxItemDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxItemEntity"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/{inboxId}/items/{inboxItemId}":{"post":{"operationId":"InboxController_addInboxItemAttachment","parameters":[{"name":"inboxId","required":true,"in":"path","schema":{"type":"string"}},{"name":"inboxItemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]},"patch":{"operationId":"InboxController_updateItem","parameters":[{"name":"inboxId","required":true,"in":"path","schema":{"type":"string"}},{"name":"inboxItemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInboxItemDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Inbox"]},"delete":{"operationId":"InboxController_deleteItem","parameters":[{"name":"inboxId","required":true,"in":"path","schema":{"type":"string"}},{"name":"inboxItemId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/inbox/parse":{"post":{"operationId":"InboxController_parse","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success","no_attachments","error"]},"recipient":{"type":"string"},"senderEmail":{"type":"string"},"senderName":{"type":"string"},"errorMessage":{"type":"string"},"files":{"type":"array","items":{"type":"string","format":"binary"}}},"required":["status"]}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Inbox"]}},"/users/{userId}/devices":{"get":{"operationId":"DevicesController_list","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}},{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":100}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeviceResponseDto"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Users"]}},"/users/current/devices/{installationId}":{"delete":{"operationId":"DevicesController_revoke","parameters":[{"name":"installationId","required":true,"in":"path","description":"Random UUID persisted by this app installation or browser profile.","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}}],"responses":{"204":{"description":"Revokes the caller`s refresh tokens and push registration for this installation and soft-revokes the device row."}},"security":[{"bearer":[]}],"tags":["Users"]}},"/accounts/provision":{"post":{"operationId":"AccountsController_provision","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionAccountDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEntity"}}}}},"security":[{"bearer":[]}],"summary":"Provision a new user and account in one call. Requires the organization\nto have apiProvisioningEnabled = true. Differs from POST /accounts in\nthat this creates the underlying User if one doesn't exist by email or\nphone number.","tags":["Accounts"]}},"/accounts":{"post":{"operationId":"AccountsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"summary":"Create an account connecting a user to an organization","tags":["Accounts"]},"get":{"operationId":"AccountsController_findAll","parameters":[{"name":"organizationId","required":false,"in":"query","schema":{"minLength":1,"type":"string"}},{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}":{"get":{"operationId":"AccountsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]},"patch":{"operationId":"AccountsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatedAccountEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]},"delete":{"operationId":"AccountsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}/restore":{"post":{"operationId":"AccountsController_restore","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}/block":{"post":{"operationId":"AccountsController_block","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}/unblock":{"post":{"operationId":"AccountsController_unblock","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}/assign-subordinates":{"post":{"operationId":"AccountsController_assignSubordinates","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignAccountSubordinatesDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/{id}/unassign-subordinates":{"post":{"operationId":"AccountsController_unassignSubordinates","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignAccountSubordinatesDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/accounts/test-notification":{"post":{"operationId":"AccountsController_testNotification","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyAccountDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Accounts"]}},"/capture/attachments/expense":{"post":{"operationId":"AttachmentCaptureController_captureExpense","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCaptureResponseDto"}}}}},"security":[{},{"bearer":[]}],"summary":"Optional auth, stated as such. The class-level `@ApiBearerAuth()` made the\nspec claim a bearer token is REQUIRED here, which is the opposite of the\ntruth: this route runs behind `OptionalTokenGuard`, answers anonymous\ncallers, and only mints a handoff ref when a token identifies the scanner.\nGenerated clients were reading that as \"must authenticate\" and had no way\nto express the anonymous call the route exists to serve.","tags":["Attachment Capture"]}},"/capture/attachments/extract/expense-data":{"post":{"deprecated":true,"operationId":"AttachmentCaptureController_extractExpenseDataDeprecated","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCaptureResponseDto"}}}}},"security":[{},{"bearer":[]}],"summary":"","tags":["Attachment Capture"]}},"/capture/attachments/accommodation":{"post":{"operationId":"AttachmentCaptureController_captureAccommodation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccommodationCaptureResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Attachment Capture"]}},"/capture/attachments/extract/accommodation-data":{"post":{"deprecated":true,"operationId":"AttachmentCaptureController_extractAccommodationDataDeprecated","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccommodationCaptureResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["Attachment Capture"]}},"/capture/attachments/expense-description":{"post":{"operationId":"AttachmentCaptureController_captureExpenseDescription","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Attachment Capture"]}},"/capture/attachments/generate/expense-description":{"post":{"deprecated":true,"operationId":"AttachmentCaptureController_generateExpenseDescriptionDeprecated","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["Attachment Capture"]}},"/capture/attachments/ocr":{"post":{"operationId":"AttachmentCaptureController_ocr","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureOcrRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{},{"bearer":[]}],"summary":"","tags":["Attachment Capture"]}},"/capture/expense":{"post":{"operationId":"ExpenseCaptureController_captureExpense","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCaptureResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Scan a receipt for a known expense (authenticated).","tags":["Capture"]}},"/ai/extract/expense-data":{"post":{"deprecated":true,"operationId":"LegacyAIController_extractExpenseData","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCaptureResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["AI (Deprecated)"]}},"/ai/extract/accommodation-data":{"post":{"deprecated":true,"operationId":"LegacyAIController_extractAccommodationData","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccommodationCaptureResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["AI (Deprecated)"]}},"/ai/generate/expense-description":{"post":{"deprecated":true,"operationId":"LegacyAIController_generateExpenseDescription","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["AI (Deprecated)"]}},"/ai/ocr":{"post":{"deprecated":true,"operationId":"LegacyAIController_ocr","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureOcrRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"summary":"","tags":["AI (Deprecated)"]}},"/organizations":{"post":{"operationId":"OrganizationsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]},"get":{"operationId":"OrganizationsController_findAll","parameters":[{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/exists":{"get":{"operationId":"OrganizationsController_exists","parameters":[{"name":"orgnumber","required":false,"in":"query","schema":{"type":"string"}},{"name":"handle","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}":{"get":{"operationId":"OrganizationsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]},"patch":{"operationId":"OrganizationsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatedOrganizationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]},"delete":{"operationId":"OrganizationsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/entitlements":{"get":{"operationId":"OrganizationsController_getEntitlements","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/components/schemas/ResolvedAccessEntitlement"},{"$ref":"#/components/schemas/ResolvedLimitEntitlement"}]}}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/ehfstatus":{"get":{"operationId":"OrganizationsController_getEhfStatus","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/auth-provider":{"get":{"operationId":"OrganizationsController_getAuthProvider","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/OrganizationAuthProviderDto"}]}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]},"patch":{"operationId":"OrganizationsController_upsertAuthProvider","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertOrganizationAuthProviderDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationAuthProviderDto"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]},"delete":{"operationId":"OrganizationsController_removeAuthProvider","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/auth-provider/health":{"get":{"operationId":"OrganizationsController_getAuthProviderHealth","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthProviderHealthDto"}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/sync-usage":{"post":{"operationId":"OrganizationsController_syncUsage","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/reset-categories":{"post":{"operationId":"OrganizationsController_resetCategories","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/clear-categories":{"post":{"operationId":"OrganizationsController_clearCategories","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/report-template":{"get":{"operationId":"OrganizationsController_getReportTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]},"put":{"operationId":"OrganizationsController_assignReportTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignReportTemplateDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]},"delete":{"operationId":"OrganizationsController_unassignReportTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/travel-request-template":{"get":{"operationId":"OrganizationsController_getTravelRequestTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]},"put":{"operationId":"OrganizationsController_assignTravelRequestTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignTravelRequestTemplateDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]},"delete":{"operationId":"OrganizationsController_unassignTravelRequestTemplate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Organizations"]}},"/organizations/{id}/comments":{"get":{"operationId":"OrganizationCommentsController_getComments","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationCommentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Organization Comments"]},"post":{"operationId":"OrganizationCommentsController_addComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationCommentDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Organization Comments"]}},"/organizations/{id}/comments/{commentId}":{"patch":{"operationId":"OrganizationCommentsController_updateComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"commentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationCommentDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organization Comments"]},"delete":{"operationId":"OrganizationCommentsController_deleteComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"commentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Organization Comments"]}},"/categories":{"post":{"operationId":"CategoriesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Categories"]},"get":{"operationId":"CategoriesController_findAll","parameters":[{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CategoryEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Categories"]}},"/categories/{id}":{"get":{"operationId":"CategoriesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryEntity"}}}}},"security":[{"bearer":[]}],"tags":["Categories"]},"patch":{"operationId":"CategoriesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Categories"]},"delete":{"operationId":"CategoriesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Categories"]}},"/report-templates":{"get":{"operationId":"ReportTemplatesController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Report templates"]},"post":{"operationId":"ReportTemplatesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportTemplateDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Report templates"]}},"/report-templates/{id}":{"get":{"operationId":"ReportTemplatesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Report templates"]},"patch":{"operationId":"ReportTemplatesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportTemplateDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Report templates"]},"delete":{"operationId":"ReportTemplatesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Report templates"]}},"/report-templates/{id}/preview":{"post":{"operationId":"ReportTemplatesController_previewExisting","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewExistingTemplateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Report templates"]}},"/report-templates/test-pdf":{"post":{"operationId":"ReportTemplatesController_testPdf","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPdfTemplateDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Mock-data smoke test: take a reportType (and optionally a templateId or\nraw draft content), render the assigned/given template against the\nsynthetic fixture, run it through pdf-api `/fromhtml`, and stream the\nresulting PDF back. Lets staff sanity-check the full HTML → PDF pipeline\nwithout submitting a real report.\n\nBody:\n { reportType, templateId? }  → renders the given template id\n { reportType, content? }     → renders the given inline draft\n { reportType }               → renders the seeded default for that type","tags":["Report templates"]}},"/report-templates/preview":{"post":{"operationId":"ReportTemplatesController_previewDraft","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDraftTemplateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Report templates"]}},"/travel-request-templates":{"get":{"operationId":"TravelRequestTemplatesController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Travel request templates"]},"post":{"operationId":"TravelRequestTemplatesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTravelRequestTemplateDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Travel request templates"]}},"/travel-request-templates/{id}":{"get":{"operationId":"TravelRequestTemplatesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Travel request templates"]},"patch":{"operationId":"TravelRequestTemplatesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTravelRequestTemplateDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Travel request templates"]},"delete":{"operationId":"TravelRequestTemplatesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Travel request templates"]}},"/travel-request-templates/{id}/preview":{"post":{"operationId":"TravelRequestTemplatesController_previewExisting","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewExistingTravelRequestTemplateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Travel request templates"]}},"/travel-request-templates/test-pdf":{"post":{"operationId":"TravelRequestTemplatesController_testPdf","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPdfTravelRequestTemplateDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Mock-data smoke test: render a template (draft, given id, or the seeded\ndefault) through the pdf-api `/fromhtml` endpoint and stream the resulting\nPDF back. Mirrors the report-template test-pdf so staff can sanity-check\nthe HTML → PDF pipeline for reisesøknader too.","tags":["Travel request templates"]}},"/travel-request-templates/preview":{"post":{"operationId":"TravelRequestTemplatesController_previewDraft","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDraftTravelRequestTemplateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Travel request templates"]}},"/affiliate-links/by-slug/{slug}":{"get":{"operationId":"AffiliateLinksController_bySlug","parameters":[{"name":"slug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateLinkPublicResponse"}}}}},"tags":["Affiliates"]}},"/affiliate-links/validate-code":{"post":{"operationId":"AffiliateLinksController_validateCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateAffiliateCodeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateCodePreviewResponse"}}}}},"tags":["Affiliates"]}},"/enterprise":{"post":{"operationId":"EnterpriseController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnterpriseDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]},"get":{"operationId":"EnterpriseController_findAll","parameters":[{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]}},"/enterprise/{id}":{"get":{"operationId":"EnterpriseController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]},"patch":{"operationId":"EnterpriseController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnterpriseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]},"delete":{"operationId":"EnterpriseController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise"]}},"/enterprise/{id}/organizations":{"get":{"operationId":"EnterpriseController_findOrganizations","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]},"post":{"operationId":"EnterpriseController_createOrganization","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationInEnterpriseDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise"]}},"/enterprise/{id}/organizations/{organizationId}":{"post":{"operationId":"EnterpriseController_addOrganization","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOrganizationToEnterpriseDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise"]},"delete":{"operationId":"EnterpriseController_removeOrganization","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise"]}},"/enterprise/{enterpriseId}/products":{"get":{"operationId":"EnterpriseProductsController_findAll","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseProductEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Products"]},"post":{"operationId":"EnterpriseProductsController_create","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnterpriseProductDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseProductEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Products"]}},"/enterprise/{enterpriseId}/products/{productId}":{"patch":{"operationId":"EnterpriseProductsController_update","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnterpriseProductDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseProductEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Products"]},"delete":{"operationId":"EnterpriseProductsController_remove","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise Products"]}},"/enterprise/{enterpriseId}/accounts":{"get":{"operationId":"EnterpriseAccountsController_findAll","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Accounts"]},"post":{"operationId":"EnterpriseAccountsController_create","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnterpriseAccountDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Accounts"]}},"/enterprise/{enterpriseId}/accounts/{accountId}":{"get":{"operationId":"EnterpriseAccountsController_findOne","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Accounts"]},"patch":{"operationId":"EnterpriseAccountsController_update","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnterpriseAccountDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Accounts"]},"delete":{"operationId":"EnterpriseAccountsController_remove","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise Accounts"]}},"/enterprise/{enterpriseId}/categories":{"get":{"operationId":"EnterpriseCategoriesController_findAll","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseCategoryEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Categories"]},"post":{"operationId":"EnterpriseCategoriesController_create","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnterpriseCategoryDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseCategoryEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Categories"]}},"/enterprise/{enterpriseId}/categories/{categoryId}":{"get":{"operationId":"EnterpriseCategoriesController_findOne","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseCategoryEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Categories"]},"patch":{"operationId":"EnterpriseCategoriesController_update","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnterpriseCategoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseCategoryEntity"}}}}},"security":[{"bearer":[]}],"tags":["Enterprise Categories"]},"delete":{"operationId":"EnterpriseCategoriesController_remove","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Enterprise Categories"]}},"/enterprise/{enterpriseId}/users/search":{"get":{"operationId":"EnterpriseUsersController_searchUsers","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","description":"Search query (name, email, or phone)","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum results to return","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseUserSearchResultDto"}}}}}},"security":[{"bearer":[]}],"summary":"Search users across all organizations in the enterprise","tags":["Enterprise Users"]}},"/enterprise/{enterpriseId}/invitations":{"post":{"operationId":"EnterpriseInvitationsController_create","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnterpriseInvitationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseInvitationEntity"}}}}},"security":[{"bearer":[]}],"summary":"Create an invitation to join the enterprise","tags":["Enterprise Invitations"]},"get":{"operationId":"EnterpriseInvitationsController_findAll","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseInvitationEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"summary":"List all invitations for the enterprise","tags":["Enterprise Invitations"]}},"/enterprise/{enterpriseId}/invitations/{invitationId}":{"delete":{"operationId":"EnterpriseInvitationsController_revoke","parameters":[{"name":"enterpriseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"invitationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Revoke an invitation","tags":["Enterprise Invitations"]}},"/enterprise/invitations/{token}":{"get":{"operationId":"EnterpriseInvitationsController_findByToken","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseInvitationEntity"}}}}},"security":[{"bearer":[]}],"summary":"Get invitation details by token (for accept page)","tags":["Enterprise Invitations"]}},"/enterprise/invitations/{token}/accept":{"post":{"operationId":"EnterpriseInvitationsController_accept","parameters":[{"name":"token","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseInvitationEntity"}}}}},"security":[{"bearer":[]}],"summary":"Accept an invitation and join the enterprise","tags":["Enterprise Invitations"]}},"/search":{"post":{"operationId":"SearchController_search","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiSearchParamsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiSearchResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Search"]}},"/search/sync":{"post":{"operationId":"SearchController_syncIndexes","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Search"]}},"/organizations/{organizationId}/search":{"post":{"operationId":"TenantSearchController_search","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSearchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSearchResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Organization search"]}},"/departments":{"post":{"operationId":"DepartmentsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDepartmentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentEntity"}}}}},"security":[{"bearer":[]}],"tags":["Departments"]},"get":{"operationId":"DepartmentsController_findAll","parameters":[{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":10000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}":{"get":{"operationId":"DepartmentsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentEntity"}}}}},"security":[{"bearer":[]}],"tags":["Departments"]},"patch":{"operationId":"DepartmentsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepartmentDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Departments"]},"delete":{"operationId":"DepartmentsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}/accounts/{accountId}":{"patch":{"operationId":"DepartmentsController_updateDepartmentAssignmentRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepartmentAssignmentRoleDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}/accounts/connect":{"post":{"operationId":"DepartmentsController_connectAccounts","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectOrDisconnectAccountsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}/accounts/disconnect":{"post":{"operationId":"DepartmentsController_disconnectAccounts","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectOrDisconnectAccountsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}/projects/connect":{"post":{"operationId":"DepartmentsController_connectProjects","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectProjectsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/departments/{id}/projects/disconnect":{"post":{"operationId":"DepartmentsController_disconnectProjects","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectProjectsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Departments"]}},"/reports":{"post":{"operationId":"ReportsController_create","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]},"get":{"operationId":"ReportsController_findAll","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"review-filter","required":false,"in":"query","description":"Filter reports by review assignment: all (default) or assigned (only reports where user matches pending review criteria)","schema":{"enum":["all","assigned"],"type":"string"}},{"name":"include-deleted","required":false,"in":"query","description":"Also list soft-deleted reports (with deletedAt set). Default false. Visibility is scoped by the normal read authorization either way.","schema":{"type":"boolean"}},{"name":"kind","required":false,"in":"query","schema":{"$ref":"#/components/schemas/ReportKind"}},{"name":"search","required":false,"in":"query","description":"Free-text search, ANDed with `query`. Every whitespace-separated token must match (case-insensitively, last token prefix-matched, typo-tolerant) at least one of: report title/description, submitter name, expense title/merchant/description, drive description, invoice number. Backed by the search index, so it is eventually consistent (a report created moments ago may not match yet) and never matches soft-deleted reports, including under `include-deleted`. Above 500 matches the list is capped to the most relevant and `_count.truncated` is set.","schema":{"type":"string"}},{"required":false,"name":"query","in":"query","schema":{"additionalProperties":true,"type":"object"}},{"required":false,"name":"limit","in":"query","schema":{"minimum":1,"type":"number"}},{"required":false,"name":"offset","in":"query","schema":{"minimum":0,"type":"number"}},{"required":false,"name":"sort","in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}":{"patch":{"operationId":"ReportsController_update","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]},"delete":{"operationId":"ReportsController_remove","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]},"get":{"operationId":"ReportsController_findOne","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/restore":{"patch":{"operationId":"ReportsController_restore","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/submit":{"post":{"operationId":"ReportsController_submit","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}},"400":{"description":"The report cannot be submitted. A client sending `X-Validation-Issues: v1` receives `report_incomplete` with the whole completeness verdict in `validation`; any other client receives the legacy body — `report_no_expenses`, `drive_stops_required` or `user_missing_account_number` with a string message, otherwise `report_missing_fields` with `message.requiredFields`. `validation` is OPTIONAL even when the header was sent: an operator kill switch serves the legacy body regardless, so a client must keep its legacy parser for as long as both shapes are documented here.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationErrorMessageResponseDto"},{"$ref":"#/components/schemas/ReportIncompleteResponseDto"}]}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/unsubmit":{"post":{"operationId":"ReportsController_unsubmit","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/transfer":{"post":{"operationId":"ReportsController_transfer","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferReportDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferReportResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferReportResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Transfer a draft report to another organization","tags":["Reports"]}},"/reports/{id}/transfers":{"get":{"operationId":"ReportsController_transfers","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportTransferReadDto"}}}}}},"security":[{"bearer":[]}],"summary":"Transfers touching this report (as source or target), oldest first","tags":["Reports"]}},"/reports/{id}/approve":{"post":{"operationId":"ReportsController_approve","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveReportDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/unapprove":{"post":{"operationId":"ReportsController_unapprove","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/reject":{"post":{"operationId":"ReportsController_reject","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewReportDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/unreject":{"post":{"operationId":"ReportsController_unreject","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/recompute-amount":{"post":{"operationId":"ReportsController_recomputeAmount","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"summary":"Recompute report.amount from its underlying child rows.","tags":["Reports"]}},"/reports/{id}/override":{"post":{"operationId":"ReportsController_override","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideReportDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"summary":"Force-resolve a stuck report to APPROVED (admin escape hatch).","tags":["Reports"]}},"/reports/{id}/rerun":{"post":{"operationId":"ReportsController_rerun","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerunReportResponseDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerunReportResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Re-evaluate the approval flow for a stuck report now.","tags":["Reports"]}},"/reports/{id}/reviews":{"get":{"operationId":"ReportsController_reviews","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/attachments":{"get":{"operationId":"ReportsController_attachments","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/preview":{"get":{"operationId":"ReportsController_preview","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/reviews/{reviewId}/reassign":{"patch":{"description":"Marks the original review as REASSIGNED and creates a new pending review with updated criteria. Requires ADMIN+ permissions.","operationId":"ReportsController_reassignReview","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"reviewId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignReviewDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewEntity"}}}}},"security":[{"bearer":[]}],"summary":"Reassign a pending review to a new reviewer","tags":["Reports"]}},"/reports/reviews/{reviewId}/override":{"post":{"description":"Marks the review as OVERRIDDEN, allowing the flow to continue past this step. Requires ADMIN+ permissions and a reason.","operationId":"ReportsController_overrideReview","parameters":[{"name":"x-validation-issues","in":"header","description":"'v1' opts the client into the completeness vocabulary this document describes: report reads carry `validation.issues`, and a blocked submit answers `report_incomplete` with the whole verdict. A client that omits it receives the same list under the legacy key `findings` on reads, and the legacy rejection bodies on submit. This is a client-wide capability: send it on every request, not only the submit call, and only once every screen that reads or submits a report parses the new shapes. Regenerating a client from this document and sending the header must ship together.","required":false,"schema":{"type":"string"}},{"name":"reviewId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideReviewDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Override a pending review step","tags":["Reports"]}},"/reports/{reportId}/marks/{subjectKind}/{subjectId}":{"put":{"operationId":"ReviewerMarksController_set","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"subjectKind","required":true,"in":"path","schema":{"type":"string"}},{"name":"subjectId","required":true,"in":"path","schema":{"type":"string"}},{"name":"qualifier","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetReviewerMarkDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewerMarkEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]},"delete":{"operationId":"ReviewerMarksController_clear","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"subjectKind","required":true,"in":"path","schema":{"type":"string"}},{"name":"subjectId","required":true,"in":"path","schema":{"type":"string"}},{"name":"qualifier","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{reportId}/marks":{"delete":{"operationId":"ReviewerMarksController_clearAll","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{reportId}/annotations":{"post":{"operationId":"ReportAnnotationsController_create","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportAnnotationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAnnotationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/annotations/{id}":{"patch":{"operationId":"ReportAnnotationsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportAnnotationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAnnotationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Reports"]},"delete":{"operationId":"ReportAnnotationsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Reports"]}},"/reports/{id}/travels/draft":{"post":{"operationId":"TravelsController_createDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Travels"]}},"/reports/{id}/travels":{"post":{"operationId":"TravelsController_create","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTravelDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Travels"]},"get":{"operationId":"TravelsController_findByReportId","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Travels"]}},"/reports/{id}/travels/{travelId}":{"patch":{"operationId":"TravelsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTravelDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Travels"]},"get":{"operationId":"TravelsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Travels"]}},"/reports/{id}/travels/{travelId}/simulate-scheme":{"post":{"operationId":"TravelsController_simulateScheme","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateSchemeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateSchemeResultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Price a candidate `SchemeConfig` against this travel WITHOUT persisting.\nThe UI (and, downstream, the agent) uses this to preview what publishing a\nscheme would actually pay — the response carries priced days + totals\nexactly as they would land at the reconcile boundary. Nothing is written:\nno scheme insert, no per-diem update, no history event.\n\nAuth: `Action.Update` on the report's ORGANIZATION — the same admin gate\nthe future scheme-authoring endpoints will use, since sending a candidate\nconfig is authoring intent (not just a read on the travel). Reading the\ntravel alone would let a plain user preview arbitrary org-wide payout\nchanges, which is exactly what admins negotiate over.","tags":["Travels"]}},"/reports/{id}/travel-request/convert":{"post":{"operationId":"TravelRequestController_convert","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertTravelRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportEntity"}}}}},"security":[{"bearer":[]}],"tags":["Travel requests"]}},"/reports/{id}/travel-request":{"get":{"operationId":"TravelRequestController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestEntity"}}}}},"security":[{"bearer":[]}],"tags":["Travel requests"]},"patch":{"operationId":"TravelRequestController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTravelRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelRequestEntity"}}}}},"security":[{"bearer":[]}],"tags":["Travel requests"]}},"/reports/{id}/travel-request/pdf":{"get":{"operationId":"TravelRequestController_getPdf","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Return a signed URL to the rendered reisesøknad PDF. Authorized on the\nparent report (Action.Read) — anyone who can see the reisesøknad can\ndownload its PDF. Returns 404 while the pipeline has not attached one yet\n(either because generation failed at submit or the report is still a\ndraft); the caller can fall through to `POST /reports/:id/travel-request/pdf`\nto force a regenerate.","tags":["Travel requests"]}},"/reports/{id}/travel-request/pdf/regenerate":{"post":{"operationId":"TravelRequestController_regeneratePdf","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"summary":"Force a fresh render of the reisesøknad PDF. Staff-side retry hatch: a\nfailed submit-time render, an org that just got assigned a new template,\nor a template edit that should reflow every request all use this path.\nAuthorized as an Update on the report subject to keep the write off\nread-only roles.","tags":["Travel requests"]}},"/reports/{reportId}/travels/{travelId}/accommodations":{"post":{"operationId":"AccommodationsController_create","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccommodationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]}},"/reports/{reportId}/travels/{travelId}/accommodations/from-expense":{"post":{"operationId":"AccommodationsController_fromExpense","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceAccommodationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]}},"/reports/{reportId}/travels/{travelId}/accommodations/{accommodationId}/detach-expense":{"post":{"operationId":"AccommodationsController_detachExpense","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accommodationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetachAccommodationExpenseDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]}},"/reports/{reportId}/travels/{travelId}/accommodations/{accommodationId}":{"patch":{"operationId":"AccommodationsController_update","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accommodationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccommodationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]},"delete":{"operationId":"AccommodationsController_delete","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accommodationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]}},"/reports/{reportId}/travels/{travelId}/accommodations/{accommodationId}/attachments":{"get":{"operationId":"AccommodationsController_getAttachments","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accommodationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Accommodations"]},"post":{"operationId":"AccommodationsController_uploadAttachment","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"travelId","required":true,"in":"path","schema":{"type":"string"}},{"name":"accommodationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadAccommodationAttachmentDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Accommodations"]}},"/travels/place-vocabulary":{"get":{"description":"Returns global country and separately-priced sub-jurisdiction identity for travel and accommodation writes. Entry codes are the wire identity clients store and send; aliases exist only to map already-stored legacy free-text values back to an entry. Display strings and locale presentation belong to each app. Intl.DisplayNames does not cover the four supported ISO 3166-2 identities, so clients must carry these display strings themselves: GB-NIR = Nord-Irland, PT-20 = Azorene, PT-30 = Madeira, ES-CN = Kanariøyene. Cache the response with its ETag and revalidate on app foreground using If-None-Match; unchanged content returns 304. Vocabulary membership does not guarantee that a rate exists for a given year or organization, and per-diem pricing may gate a day with RATE_UNAVAILABLE.","operationId":"PlaceVocabularyController_getPlaceVocabulary","parameters":[{"name":"If-None-Match","in":"header","description":"Revalidate a cached vocabulary using a strong or weak ETag, a comma-separated ETag list, or `*`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"headers":{"ETag":{"description":"Strong entity tag derived from the vocabulary version.","schema":{"type":"string","example":"\"<sha256>\""}},"Cache-Control":{"description":"Private client-cache revalidation policy.","schema":{"type":"string","example":"private, max-age=3600, stale-while-revalidate=86400"}}},"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceVocabularyDto"}}}},"304":{"description":"The cached vocabulary is still current; response has no body.","headers":{"ETag":{"description":"Strong entity tag derived from the vocabulary version.","schema":{"type":"string","example":"\"<sha256>\""}},"Cache-Control":{"description":"Private client-cache revalidation policy.","schema":{"type":"string","example":"private, max-age=3600, stale-while-revalidate=86400"}}}}},"security":[{"bearer":[]}],"summary":"Get the accepted travel place vocabulary","tags":["Travels"]}},"/reports/{reportId}/report-attachments":{"get":{"operationId":"ReportAttachmentsController_findAll","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportAttachmentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Report attachments"]}},"/reports/{reportId}/attachments":{"post":{"operationId":"ReportAttachmentsController_upload","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Report attachments"]}},"/reports/{reportId}/attachments/{attachmentId}":{"delete":{"operationId":"ReportAttachmentsController_remove","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Report attachments"]}},"/reports/{reportId}/attachments/{attachmentId}/promote":{"post":{"operationId":"ReportAttachmentsController_promote","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteReportAttachmentDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Report attachments"]}},"/expenses/{expenseId}/attachments/{attachmentId}/travelers":{"get":{"operationId":"TravelerController_read","parameters":[{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelerReadDto"}}}}},"tags":["Attachment enrichment"]},"post":{"operationId":"TravelerController_request","parameters":[{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelerCaptureRequestDto"}}}},"responses":{"202":{"description":"Opaque work IDs; the empty list means capture is disabled or unavailable.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}},"tags":["Attachment enrichment"]}},"/findings/{findingId}/travelers":{"get":{"operationId":"TravelerController_readFinding","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelerReadDto"}}}}},"tags":["Attachment enrichment"]}},"/findings/{findingId}/acknowledge-traveler":{"post":{"operationId":"TravelerController_acknowledge","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelerAcknowledgeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelerAcknowledgmentDto"}}}}},"tags":["Attachment enrichment"]}},"/reports/{id}/findings":{"get":{"operationId":"FindingsController_getReportFindings","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFindingsSummaryDto"}}}}},"tags":["Findings"]}},"/findings/{id}/dismiss":{"post":{"operationId":"FindingsController_dismiss","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissFindingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingDto"}}}}},"tags":["Findings"]}},"/findings/{id}/confirm":{"post":{"operationId":"FindingsController_confirm","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmFindingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingDto"}}}}},"tags":["Findings"]}},"/findings/{id}/unresolve":{"post":{"operationId":"FindingsController_unresolve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingDto"}}}}},"tags":["Findings"]}},"/organizations/{organizationId}/check-policies":{"get":{"operationId":"CheckPolicyController_getPolicies","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Checks"]}},"/organizations/{organizationId}/check-policies/{checkId}":{"put":{"operationId":"CheckPolicyController_updatePolicy","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"checkId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCheckPolicyDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Checks"]}},"/invoices":{"get":{"operationId":"InvoicesController_findAll","parameters":[{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]},"post":{"operationId":"InvoicesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEntity"}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{id}":{"get":{"operationId":"InvoicesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEntity"}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]},"patch":{"operationId":"InvoicesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEntity"}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{id}/regenerate":{"post":{"operationId":"InvoicesController_regenerate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEntity"}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{id}/generate-ehf":{"post":{"operationId":"InvoicesController_generateEhf","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{id}/replace":{"post":{"operationId":"InvoicesController_replace","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{id}/send":{"post":{"operationId":"InvoicesController_send","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInvoiceDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Invoices"]}},"/invoices/{invoiceId}/pdf-job-callback":{"post":{"operationId":"PdfJobCallbackController_handleCallback","parameters":[{"name":"invoiceId","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-pdf-job-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["PdfJobCallback"]}},"/rates":{"post":{"operationId":"RatesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Rates"]},"get":{"operationId":"RatesController_findAll","parameters":[{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RateEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"tags":["Rates"]}},"/rates/{id}":{"get":{"operationId":"RatesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateEntity"}}}}},"tags":["Rates"]},"patch":{"operationId":"RatesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRateDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Rates"]},"delete":{"operationId":"RatesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Rates"]}},"/flows":{"post":{"operationId":"FlowsController_create","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]},"get":{"operationId":"FlowsController_findAll","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FlowListItemDto"}}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/import":{"post":{"operationId":"FlowsController_importFlow","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/triggers":{"get":{"operationId":"FlowsController_getTriggers","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TriggerInfoDto"}}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/schema/{trigger}":{"get":{"operationId":"FlowsController_getSchema","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}},{"name":"trigger","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerSchemaDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/context-schema":{"get":{"operationId":"FlowsController_getDomainSchema","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}},{"name":"domain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainSchemaDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}":{"get":{"operationId":"FlowsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]},"patch":{"operationId":"FlowsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlowDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]},"delete":{"operationId":"FlowsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/validate":{"post":{"operationId":"FlowsController_validate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowValidationResultDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/simulate":{"post":{"operationId":"FlowsController_simulate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowSimulationRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowSimulationResultDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/simulate/{subjectId}":{"post":{"operationId":"FlowsController_simulateWithSubject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"subjectId","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowSimulationRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowSimulationResultDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/duplicate":{"post":{"operationId":"FlowsController_duplicate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/publish":{"post":{"operationId":"FlowsController_publish","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"summary":"Publish a flow - validates and snapshots draft to published version","tags":["Flows"]}},"/flows/{id}/discard":{"post":{"operationId":"FlowsController_discardDraft","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"summary":"Discard draft changes - resets to published version","tags":["Flows"]}},"/flows/{id}/traces":{"get":{"operationId":"FlowsController_getTraces","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","type":"string"}},{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowTraceDto"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"summary":"Get execution traces for a flow (paginated)","tags":["Flows"]}},"/flows/{id}/traces/{traceId}":{"get":{"operationId":"FlowsController_getTrace","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"traceId","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTraceWithLogsDto"}}}}},"security":[{"bearer":[]}],"summary":"Get a single trace with full execution logs","tags":["Flows"]}},"/flows/{id}/versions":{"get":{"operationId":"FlowsController_listVersions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/flows/{id}/versions/{versionId}":{"get":{"operationId":"FlowsController_getVersion","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"versionId","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get a specific version's details","tags":["Flows"]}},"/flows/{id}/versions/{versionId}/restore":{"post":{"operationId":"FlowsController_restoreVersion","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"versionId","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowDto"}}}}},"security":[{"bearer":[]}],"summary":"Restore a previous version into the draft (does not auto-publish)","tags":["Flows"]}},"/flows/{id}/export":{"get":{"operationId":"FlowsController_exportFlow","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}},{"name":"format","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Flows"]}},"/reports/{id}/duplicate-groups":{"get":{"operationId":"FingerprintController_getReportDuplicateGroups","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateGroupDto"}}}}}},"tags":["Fingerprint"]}},"/duplicate-groups/{id}/dismiss":{"post":{"operationId":"FingerprintController_dismissGroup","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissMatchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGroupDto"}}}}},"tags":["Fingerprint"]}},"/duplicate-groups/{id}/confirm":{"post":{"operationId":"FingerprintController_confirmGroup","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmMatchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGroupDto"}}}}},"tags":["Fingerprint"]}},"/duplicate-groups/{id}/unresolve":{"post":{"operationId":"FingerprintController_unresolveGroup","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGroupDto"}}}}},"tags":["Fingerprint"]}},"/duplicate-groups/{id}/resolutions":{"get":{"operationId":"FingerprintController_getGroupResolutions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateGroupResolutionDto"}}}}}},"tags":["Fingerprint"]}},"/advances/{id}/disburse":{"post":{"operationId":"AdvancesController_disburse","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisburseAdvanceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/advances/{id}/repay":{"post":{"operationId":"AdvancesController_repay","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepayAdvanceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/advances/{id}/adjust":{"post":{"operationId":"AdvancesController_adjust","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustAdvanceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/advances/{id}/write-off":{"post":{"operationId":"AdvancesController_writeOff","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteOffAdvanceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/advances/{id}/cancel":{"post":{"operationId":"AdvancesController_cancel","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}},"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/reports/{id}/advance":{"get":{"operationId":"AdvancesController_findForReport","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceContextDto"}}}}},"security":[{"bearer":[]}],"tags":["Advances"]}},"/accounts/{accountId}/advances":{"get":{"description":"The signed net saldo per currency over the whole ledger, plus a keyset page of the account's advances newest grant first. Loop on `nextCursor` until null; `balances` is the same on every page.","operationId":"AdvancesController_findForAccount","parameters":[{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Opaque continuation token from a previous page (`nextCursor`). Loop until it comes back null.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":200,"default":50,"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountAdvancesDto"}}}}},"security":[{"bearer":[]}],"summary":"A person's advance saldo and their advances","tags":["Advances"]}},"/accounts/{accountId}/advances/opening":{"post":{"description":"Creates an `OPENING` open item on the person, already disbursed, dated `occurredAt` and referencing the old system through `externalRef`. It clears like any other item — the next reiseregning draws it down. Admin-tier: the caller needs BOTH `advance.grant` and `advance.disburse`, and may not record one for themselves. Idempotent on `idempotencyKey`.","operationId":"AdvancesController_recordOpening","parameters":[{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpeningAdvanceDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceEntity"}}}}},"security":[{"bearer":[]}],"summary":"Record an advance carried over from the previous system","tags":["Advances"]}},"/expenses/fx-quotes":{"post":{"operationId":"FxQuotesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxQuoteRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxQuoteDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense FX quotes"]}},"/reports/{reportId}/receipt-remainder/preview":{"post":{"operationId":"ReceiptRemainderController_preview","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRemainderPreviewDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/reports/{reportId}/receipt-remainder/suggestions":{"post":{"operationId":"ReceiptRemainderController_suggestions","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRemainderProposalDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRemainderSuggestionsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/reports/{reportId}/receipt-remainder/decline":{"post":{"operationId":"ReceiptRemainderController_decline","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRemainderDeclineDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"summary":"\"Resten er privat\": the unclaimed balance is declined, not filed.","tags":["Expense costs"]}},"/reports/{reportId}/receipt-remainder":{"post":{"operationId":"ReceiptRemainderController_add","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRemainderWriteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses":{"post":{"operationId":"ExpensesController_create","parameters":[{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]},"get":{"operationId":"ExpensesController_findAll","parameters":[{"name":"reportId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]}},"/expenses/currencies":{"get":{"operationId":"ExpensesController_getCurrencies","parameters":[{"name":"x-currency-set","required":false,"in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCurrencyDto"}}}}},"default":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCurrencyDto"}}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]}},"/expenses/exchangerate":{"post":{"operationId":"ExpensesController_getExchangeRate","parameters":[{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"number"}}}},"default":{"description":"","content":{"application/json":{"schema":{"type":"number"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]}},"/expenses/{id}/detach":{"post":{"operationId":"ExpensesController_detach","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]}},"/expenses/{id}":{"patch":{"operationId":"ExpensesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-currency-set","in":"header","description":"'filable' widens the response to every currency an expense may be denominated in, including those needing a user-supplied rate. This is a client-wide capability: send it on every request, not only the currencies call. A client that omits it receives the retryable `exchange_rate_failed_fetch` response instead of `exchange_rate_manual_required`.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]},"get":{"operationId":"ExpensesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseEntity"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]},"delete":{"operationId":"ExpensesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Expenses"]}},"/attachments":{"get":{"operationId":"AttachmentsController_findAll","parameters":[{"name":"expenseId","required":false,"in":"query","schema":{"minLength":1,"type":"string"}},{"name":"cashExpenseId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Attachments"]},"post":{"operationId":"AttachmentsController_uploadAttachment","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadAttachmentRequestDto"}},"application/json":{"schema":{"$ref":"#/components/schemas/UploadAttachmentIntentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadAttachmentResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Two modes on one route, chosen by Content-Type.\n\n`multipart/form-data` is the legacy mode and is untouched: the bytes come\nthrough this process, and the 201 is byte-for-byte what it always was.\n\n`application/json` is an upload INTENT (contract v2): the client mints the\nattachment id, the server adopts the scan and fills the expense NOW, and\nthe bytes go straight to storage through the returned presigned form.\n\nThe file validators moved to `fileIsRequired: false` so a JSON body is not\nrejected by the multipart pipe before it is read; the multipart branch\nraises the same `File is required` 400 it always did.","tags":["Attachments"]}},"/attachments/{id}":{"get":{"operationId":"AttachmentsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentEntity"}}}}},"security":[{"bearer":[]}],"tags":["Attachments"]},"delete":{"operationId":"AttachmentsController_deleteAttachment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Attachments"]}},"/expenses/{id}/costs":{"get":{"operationId":"CostsController_read","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]},"put":{"operationId":"CostsController_write","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostsWriteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses/{id}/costs/context":{"get":{"operationId":"CostsController_context","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostSplitContextDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses/{id}/costs/dimensions":{"get":{"operationId":"CostsController_dimensions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"definitionId","required":false,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"after","required":false,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"afterDefinition","required":false,"in":"query","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","type":"string"}},{"name":"search","required":false,"in":"query","schema":{"maxLength":100,"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":500,"default":200,"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostDimensionCatalogDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses/{id}/costs/preview":{"post":{"operationId":"CostsController_preview","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostsWriteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses/costs":{"post":{"operationId":"CostsCreateController_create","parameters":[{"name":"Idempotency-Key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostsCreateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCostsDto"}}}}},"security":[{"bearer":[]}],"tags":["Expense costs"]}},"/expenses/{expenseId}/attachments/{attachmentId}/items":{"get":{"operationId":"ItemizationController_read","parameters":[{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentItemizationDto"}}}}},"security":[{"bearer":[]}],"tags":["Attachment items"]}},"/expenses/{expenseId}/attachments/{attachmentId}/itemizations/{snapshotId}":{"get":{"operationId":"ItemizationController_snapshot","parameters":[{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}},{"name":"snapshotId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentItemizationDto"}}}}},"security":[{"bearer":[]}],"tags":["Attachment items"]}},"/expenses/{expenseId}/attachments/{attachmentId}/itemizations":{"post":{"operationId":"ItemizationController_request","parameters":[{"name":"expenseId","required":true,"in":"path","schema":{"type":"string"}},{"name":"attachmentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentItemizationRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentItemizationDto"}}}}},"security":[{"bearer":[]}],"tags":["Attachment items"]}},"/organizations/{organizationId}/diet-schemes":{"get":{"operationId":"DietSchemesController_list","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DietSchemeEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Diet schemes"]},"post":{"operationId":"DietSchemesController_create","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDietSchemeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet schemes"]}},"/organizations/{organizationId}/diet-schemes/{schemeId}":{"get":{"operationId":"DietSchemesController_get","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"schemeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet schemes"]},"patch":{"operationId":"DietSchemesController_update","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"schemeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDietSchemeDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet schemes"]},"delete":{"operationId":"DietSchemesController_remove","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"schemeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Diet schemes"]}},"/organizations/{organizationId}/diet-schemes/{schemeId}/publish":{"post":{"operationId":"DietSchemesController_publish","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"schemeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishDietSchemeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishDietSchemeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Diet schemes"]}},"/organizations/{organizationId}/diet-scheme-assignments":{"get":{"operationId":"DietSchemeAssignmentsController_list","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationDietSchemeEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Diet scheme assignments"]},"post":{"operationId":"DietSchemeAssignmentsController_assign","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDietSchemeAssignmentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet scheme assignments"]}},"/organizations/{organizationId}/diet-scheme-assignments/{dietSchemeId}":{"get":{"operationId":"DietSchemeAssignmentsController_get","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"dietSchemeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet scheme assignments"]},"patch":{"operationId":"DietSchemeAssignmentsController_patch","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"dietSchemeId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDietSchemeAssignmentDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDietSchemeEntity"}}}}},"security":[{"bearer":[]}],"tags":["Diet scheme assignments"]},"delete":{"operationId":"DietSchemeAssignmentsController_unassign","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"dietSchemeId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Diet scheme assignments"]}},"/drives/distance":{"post":{"operationId":"DrivesController_calculateDistance","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculateDriveDistanceDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveDistanceResponseDto"}}}},"429":{"description":"Per-user budget exhausted (60/min)."}},"security":[{"bearer":[]}],"tags":["Drives"]}},"/drives":{"post":{"operationId":"DrivesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDriveDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveEntity"}}}},"422":{"description":"Drive rates for the year of the drive date are not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Drives"]},"get":{"operationId":"DrivesController_findAll","parameters":[{"name":"reportId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"tags":["Drives"]}},"/drives/{id}/detach":{"post":{"operationId":"DrivesController_detach","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveEntity"}}}}},"security":[{"bearer":[]}],"tags":["Drives"]}},"/drives/{id}":{"patch":{"operationId":"DrivesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDriveDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveEntity"}}}},"422":{"description":"Drive rates for the year of the drive date are not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Drives"]},"get":{"operationId":"DrivesController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveEntity"}}}}},"security":[{"bearer":[]}],"tags":["Drives"]},"delete":{"operationId":"DrivesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Drives"]}},"/drives/toll":{"post":{"operationId":"DriveTollController_quote","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteDriveTollDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveTollQuoteDto"}}}},"429":{"description":"Per-user budget exhausted (60/min)."},"502":{"description":"Toll quote failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Quote the toll for a route between two searched places, in the report’s base currency. Proxied server-side; the toll service sees two place ids and their labels, nothing else.","tags":["Drives"]}},"/geo/places/suggest":{"post":{"operationId":"PlacesProxyController_suggest","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestPlacesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaceSuggestionDto"}}}}},"429":{"description":"Per-user budget exhausted (suggest 60/min, details 120/min, reverse 60/min)."},"502":{"description":"Place lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Autocomplete a place query. Proxied server-side; no session token or user identifier reaches the provider.","tags":["Geo"]}},"/geo/places/reverse":{"post":{"operationId":"PlacesProxyController_reverse","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReversePlaceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceCandidateDto"}}}},"404":{"description":"The map provider does not know that place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"429":{"description":"Per-user budget exhausted (suggest 60/min, details 120/min, reverse 60/min)."},"502":{"description":"Place lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Resolve a dropped pin to a place. Proxied server-side; no session token or user identifier reaches the provider, and the answer keeps the caller’s own coordinates — the provider only supplies the label.","tags":["Geo"]}},"/geo/places/details":{"post":{"operationId":"PlacesProxyController_details","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceDetailsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceCandidateDto"}}}},"404":{"description":"The map provider does not know that place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"429":{"description":"Per-user budget exhausted (suggest 60/min, details 120/min, reverse 60/min)."},"502":{"description":"Place lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Resolve a suggestion to a full place. Proxied server-side; no session token or user identifier reaches the provider.","tags":["Geo"]}},"/per-diems":{"get":{"operationId":"PerDiemsController_findAll","parameters":[{"name":"reportId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}}}}}},"security":[{"bearer":[]}],"tags":["PerDiems"]}},"/per-diems/{id}":{"get":{"operationId":"PerDiemsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemEntity"}}}}},"security":[{"bearer":[]}],"tags":["PerDiems"]},"patch":{"operationId":"PerDiemsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"x-meal-decisions","in":"header","description":"'dated' declares that the client sends every meal decision on its civil date — `mealDate` with the meal flags it decides, or `meals` — and never a meal flag on its own. A client that omits it may still send the legacy row-level shape (a meal flag without `mealDate`), which is translated to the dated decisions that make that row read the flag. With the header, a meal flag without a date is refused.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPerDiemDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["PerDiems"]}},"/organizations/{organizationId}/access-grants":{"post":{"description":"Issues a time-boxed, revocable access grant carrying one ORGANIZATION-scope role. Re-issuing an existing (user, role) grant RENEWS it — it extends the time-box and reinstates a revoked grant — rather than stacking a second one.","operationId":"TenantAccessGrantsController_issue","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueTenantAccessGrantDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Grant a practitioner scoped access to this organization","tags":["Access grants"]},"get":{"description":"The tenant’s consent register — live, expired and revoked grants, newest expiry first. The recertification surface: `lastUsedAt` shows which grants nobody is using.","operationId":"TenantAccessGrantsController_list","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"summary":"Every access grant this organization has issued","tags":["Access grants"]}},"/organizations/{organizationId}/access-grants/{id}":{"delete":{"description":"Idempotent: revoking an already-revoked grant succeeds and writes no second audit fact. The row is kept — a withdrawn consent is still a consent record.","operationId":"TenantAccessGrantsController_revoke","parameters":[{"name":"organizationId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Withdraw a practitioner’s access","tags":["Access grants"]}},"/users/current/access-grants":{"get":{"description":"Every organization that has granted you scoped access, with the role and time-box it carries.","operationId":"TenantAccessGrantsController_currentUserGrants","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"summary":"Your own cross-organization access grants","tags":["Access grants"]}},"/wallets":{"post":{"operationId":"WalletsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWalletDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletEntity"}}}}},"security":[{"bearer":[]}],"tags":["Wallets"]},"get":{"operationId":"WalletsController_findAll","parameters":[{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":1000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WalletEntity"}}}}}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/selectable":{"get":{"operationId":"WalletsController_findSpendable","parameters":[{"name":"accountId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WalletEntity"}}}}}},"security":[{"bearer":[]}],"summary":"Wallets the given holder can currently spend from (Betalingsmåte picker).\n`accountId` alone scopes it — an account belongs to exactly one org, and\n\"selectable\" is self-scoped (authorized via the holder grant).","tags":["Wallets"]}},"/wallets/{id}":{"get":{"operationId":"WalletsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletEntity"}}}}},"security":[{"bearer":[]}],"tags":["Wallets"]},"patch":{"operationId":"WalletsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWalletDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]},"delete":{"operationId":"WalletsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/{id}/activity":{"get":{"operationId":"WalletsController_activity","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WalletActivityEntry"}}}}}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/{id}/credit":{"post":{"operationId":"WalletsController_credit","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundWalletDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/{id}/adjust":{"post":{"operationId":"WalletsController_adjust","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustWalletDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/{id}/reassign":{"post":{"operationId":"WalletsController_reassign","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignWalletDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/wallets/{id}/close":{"post":{"operationId":"WalletsController_close","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Wallets"]}},"/invitations":{"get":{"operationId":"InvitationsController_getInvitationsByUser","parameters":[{"name":"cursor","required":false,"in":"query","schema":{"pattern":"^(organization|enterprise):[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","type":"string"}},{"name":"X-Invitation-Kinds","in":"header","description":"Opt into a paginated list of organization and enterprise invitations. Without this exact value, returns the legacy organization array.","required":false,"schema":{"type":"string","enum":["all"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},{"$ref":"#/components/schemas/IncomingInvitationsPageDto"}]}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]},"post":{"operationId":"InvitationsController_getInvitationByToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInviteTokenDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationEntity"}}}},"404":{"description":"Invitation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/invitations/email":{"post":{"operationId":"InvitationsController_inviteByEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteByEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResultDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResultDto"}}}},"400":{"description":"Email is malformed, Failed to create invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"429":{"description":"Invitation rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/invitations/phone":{"post":{"operationId":"InvitationsController_inviteByPhone","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteByPhoneDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResultDto"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResultDto"}}}},"400":{"description":"Phone number is malformed, Failed to create invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"429":{"description":"Invitation rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/invitations/link":{"post":{"operationId":"InvitationsController_inviteByLink","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteByLinkDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"201":{"description":""},"400":{"description":"Failed to create invitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/invitations/revoke":{"post":{"operationId":"InvitationsController_revokeInviteByToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInviteTokenDto"}}}},"responses":{"201":{"description":""},"400":{"description":"Failed to revoke invite token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/invitations/accept":{"post":{"operationId":"InvitationsController_acceptInviteByToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteTokenDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResponseDto"}}}},"400":{"description":"Missing invitation token, Invalid has expired, Invitation already accepted, Invitation revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"404":{"description":"Invitation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}},"409":{"description":"User is already a member of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorCodeResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["Invitations"]}},"/projects":{"post":{"operationId":"ProjectsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Projects"]},"get":{"operationId":"ProjectsController_findAll","parameters":[{"name":"query","required":false,"in":"query","schema":{"type":"object","additionalProperties":true}},{"name":"limit","required":false,"in":"query","schema":{"type":"number","minimum":1,"maximum":10000}},{"name":"offset","required":false,"in":"query","schema":{"type":"number","minimum":0}},{"name":"sort","required":false,"in":"query","schema":{"type":"array","items":{"type":"object"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["data","_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectEntity"}},"_count":{"type":"object","required":["result","total"],"properties":{"total":{"type":"number","nullable":true,"description":"The total count of the data"},"result":{"type":"number","description":"The count of the returned data"},"truncated":{"type":"boolean","description":"Set when the matched set was capped, so `total` describes the cap rather than the real number of matches."}}}}}}}}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/projects/bulk":{"post":{"operationId":"ProjectsController_createMany","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreateProjectDto"}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/projects/{id}":{"get":{"operationId":"ProjectsController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectEntity"}}}}},"security":[{"bearer":[]}],"tags":["Projects"]},"patch":{"operationId":"ProjectsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Projects"]},"delete":{"operationId":"ProjectsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/projects/{id}/accounts/connect":{"post":{"operationId":"ProjectsController_connectAccounts","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAccountsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/projects/{id}/accounts/disconnect":{"post":{"operationId":"ProjectsController_disconnectAccounts","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectAccountsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/projects/{id}/accounts/{accountId}":{"patch":{"operationId":"ProjectsController_updateProjectAssignmentRole","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"accountId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectAssignmentRoleDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Projects"]}},"/sse/events":{"get":{"operationId":"SseController_sse","parameters":[{"name":"scopes","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"sse_invalid_scopes — the scopes parameter is malformed (invalid JSON, non-array, or no valid entries)"}},"tags":["Sse"]}},"/agent/conversations":{"post":{"operationId":"AgentController_createConversation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentConversationDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Create a new agent conversation","tags":["Agent"]},"get":{"operationId":"AgentController_listConversations","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List the caller's own conversations","tags":["Agent"]}},"/agent/conversations/{id}/messages":{"post":{"operationId":"AgentController_sendMessage","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendAgentMessageDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Send one message; streams the assistant reply (SSE)","tags":["Agent"]}},"/agent/conversations/{id}":{"get":{"operationId":"AgentController_getConversation","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Read one conversation the caller owns","tags":["Agent"]},"delete":{"operationId":"AgentController_deleteConversation","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Erase a conversation the caller owns (messages cascade)","tags":["Agent"]}},"/agent/conversations/{id}/approvals":{"get":{"operationId":"AgentController_listApprovals","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Actions awaiting a human decision","tags":["Agent"]}},"/agent/conversations/{id}/approvals/{toolCallId}":{"post":{"operationId":"AgentController_decideApproval","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"toolCallId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideAgentApprovalDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Approve or reject one gated action; streams the continuation","tags":["Agent"]}},"/agent/attachments":{"post":{"operationId":"AgentAttachmentsController_uploadAttachment","parameters":[{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Upload a file dropped into the agent chat","tags":["Agent"]}},"/agent/attachments/{inboxItemId}":{"delete":{"operationId":"AgentAttachmentsController_deleteAttachment","parameters":[{"name":"inboxItemId","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"bearer":[]}],"summary":"Discard a chat-source inbox item (removal before or after send)","tags":["Agent"]}},"/recommendations/inbox-items/{id}/trip-suggestions":{"get":{"description":"Deterministic (T0) date-window match against the caller’s own editable travel reports. Suggest-only — no report is modified.","operationId":"RecommendationController_tripSuggestions","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"organizationId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"security":[{"bearer":[]}],"summary":"Suggest which travel report an inbox receipt belongs to","tags":["Recommendations"]}},"/.well-known/oauth-protected-resource":{"get":{"operationId":"McpOAuthController_protectedResourceRoot","parameters":[],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/.well-known/oauth-protected-resource/mcp":{"get":{"operationId":"McpOAuthController_protectedResourcePath","parameters":[],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"McpOAuthController_authorizationServer","parameters":[],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/oauth/authorize":{"get":{"operationId":"McpOAuthController_authorize","parameters":[],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/oauth/authorize/deny":{"get":{"operationId":"McpOAuthController_denyAuthorization","parameters":[{"name":"request","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/oauth/authorize/callback":{"get":{"operationId":"McpOAuthController_authorizationCallback","parameters":[{"name":"request","required":true,"in":"query","schema":{"type":"string"}},{"name":"code","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["McpOAuth"]}},"/oauth/token":{"post":{"operationId":"McpOAuthController_token","parameters":[],"responses":{"201":{"description":""}},"tags":["McpOAuth"]}},"/oauth/revoke":{"post":{"operationId":"McpOAuthController_revoke","parameters":[],"responses":{"201":{"description":""}},"tags":["McpOAuth"]}}},"info":{"title":"Utleggsappen API","description":"\n## Getting Started\n\n1. **Register an Account**  \n   Sign up at [utlegg.app](https://www.utlegg.app).\n\n2. **Generate a Personal Access Token**  \n   Under **Settings** > **Developer** > **Personal Access Tokens**, generate a new token.\n\n3. **Authenticate**\n    Use the generated token to authenticate the API requests. Add the token to the `Authorization` header as a Bearer Token:\n    ```http\n      Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN\n    ```\n    **Note**: A valid user account on [utlegg.app](https://www.utlegg.app) is required to use the API.\n\n\n## Client Generation\nThis swagger document (available as a JSON at `/api-docs-json`) is intended to be used with a client generator.\n\nDepending on the language you are using, you can use the following tools to generate a client:\n- **TypeScript**: [swagger-typescript-api](https://www.npmjs.com/package/swagger-typescript-api)\n- **Python**: [openapi-python-client](https://pypi.org/project/openapi-python-client/)\n- **Java**: [openapi-generator](https://github.com/OpenAPITools/openapi-generator)\n- **C#**: [NSwag](https://github.com/RicoSuter/NSwag)\n\n  ","version":"3.12.10","contact":{}},"tags":[{"name":"Users","description":""},{"name":"Accounts","description":""},{"name":"Organizations","description":""},{"name":"Departments","description":""},{"name":"Reports","description":""},{"name":"Expenses","description":""},{"name":"Categories","description":""},{"name":"Projects","description":""}],"servers":[{"url":"https://api.utlegg.app"}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"DigestRateEnum":{"type":"string","enum":["daily","weekly","monthly"]},"TriggerDigestDto":{"type":"object","properties":{"digestRate":{"$ref":"#/components/schemas/DigestRateEnum"},"apiKey":{"type":"string"}},"required":["digestRate","apiKey"]},"EffectiveRoleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string","enum":["GLOBAL","ORGANIZATION","ENTERPRISE","DEPARTMENT"]},"scopeId":{"type":"string"},"type":{"type":"string","enum":["SYSTEM","CUSTOM"]},"tier":{"type":"string","nullable":true,"description":"The SYSTEM role whose tier capabilities this assignment carries: the role's\nown name when `type` is SYSTEM, the delegated parent's name when it is\nCUSTOM, and `null` for a tier-less CUSTOM role (one that grants only its\nexplicit permissions).\n\n`permissions` on the parent DTO is flattened across every scope, so it\nanswers \"may I?\" but never \"where?\". Pairing `tier` with `scopeId` is what\nlets a client resolve a scoped question — \"which departments do I\nadminister?\" — using the same derivation the backend applies when it\npopulates `principal.departmentAdminIds`, rather than a parallel heuristic\nover the tenant-authored `name`."}},"required":["id","name","scope","scopeId","type","tier"]},"EffectiveAccessDto":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/EffectiveRoleDto"}},"permissions":{"type":"array","items":{"type":"string"}}},"required":["roles","permissions"]},"CreateRoleDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":500},"scope":{"type":"object"},"organizationId":{"type":"string"},"permissionIds":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"parentSystemRoleId":{"type":"string"}},"required":["name","scope","organizationId"]},"UpdateRoleDto":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":500},"permissionIds":{"uniqueItems":true,"type":"array","items":{"type":"string"}},"parentSystemRoleId":{"type":"string"}}},"ConnectUsersToRoleDto":{"type":"object","properties":{"userIds":{"minItems":1,"uniqueItems":true,"type":"array","items":{"type":"string"}}},"required":["userIds"]},"VerifyChainDto":{"type":"object","properties":{"fromPosition":{"description":"1-based chain position to start from (defaults to the genesis).","type":"integer","minimum":1,"maximum":9007199254740991},"maxRows":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"AuditTrailCategory":{"type":"string","enum":["MUTATION","DELETION","WORKFLOW","GRANT","EXPORT"]},"AuditTrailItemDto":{"type":"object","properties":{"id":{"type":"string","description":"Audit fact id (BigInt as string)."},"category":{"$ref":"#/components/schemas/AuditTrailCategory"},"eventSubjectType":{"type":"string","nullable":true},"eventSubjectId":{"type":"string","nullable":true},"eventType":{"type":"string","nullable":true,"description":"The verb. For WORKFLOW facts this is a business transition from the verb registry; for other categories it is the recording plane’s own event name. Documented values for WORKFLOW (an OPEN set — new verbs appear without a breaking change, so never switch exhaustively on it): ADVANCE_GRANTED, ADVANCE_CANCELED, ADVANCE_DISBURSED, ADVANCE_SETTLED, ADVANCE_REVERSED, ADVANCE_REPAID, ADVANCE_ADJUSTED, ADVANCE_WRITTEN_OFF, REPORT_SUBMITTED, REPORT_APPROVED, REPORT_UNAPPROVED, REPORT_REJECTED, REPORT_UNREJECTED, REPORT_OVERRIDDEN, REPORT_PUBLISHED, REPORT_RESTORED, REPORT_FLOW_RERUN, REPORT_UNSUBMITTED, REPORT_AMENDED, REPORT_TRANSFERRED_OUT, REPORT_TRANSFERRED_IN, REPORT_TRANSFER_FAILED, REVIEW_REQUESTED, REVIEW_COMPLETED, REVIEW_REASSIGNED, REVIEW_OVERRIDDEN, REVIEW_WITHDRAWN, REVIEW_INVALIDATED, ACCOUNT_BLOCKED, ACCOUNT_UNBLOCKED, USER_BLOCKED, USER_UNBLOCKED, INVITATION_SENT, INVITATION_ACCEPTED, INVITATION_REVOKED, MEMBER_PROVISIONED, MEMBER_DEPROVISIONED, INVOICE_SENT, INVOICE_DELIVERED, INVOICE_FAILED, ORGANIZATION_DELETED, ORGANIZATION_RESTORED, ORGANIZATION_APPROVAL_SETTINGS_CHANGED, ORGANIZATION_AMEND_POLICY_CHANGED, ENTERPRISE_ORGANIZATION_LINKED, ENTERPRISE_ORGANIZATION_UNLINKED, FINDING_DISMISSED, FINDING_CONFIRMED, FINDING_UNRESOLVED, FINDING_AUTO_RESOLVED, DUPLICATE_DISMISSED, DUPLICATE_CONFIRMED, DUPLICATE_UNRESOLVED."},"actorId":{"type":"string","nullable":true},"actorType":{"type":"string","nullable":true},"roleId":{"type":"string","nullable":true},"entryPoint":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"},"hasChangeset":{"type":"boolean","description":"Whether an (erasable) changeset still exists for this fact. Content is not exposed on this surface."},"changes":{"type":"object","nullable":true,"additionalProperties":true,"description":"Typed per-verb evidence for WORKFLOW facts — ids and codes for the transition, plus `comment` when the actor left one; null for every other category (row snapshots are not exposed on this surface). The shape is per verb; see docs/audit-workflow-verbs.md."}},"required":["id","category","eventSubjectType","eventSubjectId","eventType","actorId","actorType","roleId","entryPoint","reason","createdAt","hasChangeset","changes"]},"AuditTrailPageDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditTrailItemDto"}},"nextCursor":{"type":"string","nullable":true,"description":"Opaque continuation token; null on the final page."}},"required":["items","nextCursor"]},"ApiErrorCodeResponseDto":{"type":"object","properties":{"errorCode":{"type":"string"},"statusCode":{"oneOf":[{"type":"integer"},{"type":"string"}]},"message":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"path":{"type":"string"},"eventId":{"type":"string"}},"required":["errorCode","statusCode","message","path"]},"LogoutDto":{"type":"object","properties":{"refreshToken":{"type":"string"},"pushToken":{"type":"string"}}},"RefreshDto":{"type":"object","properties":{"refreshToken":{"type":"string"},"device":{}},"required":["refreshToken"]},"TokensDto":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"]},"TestUserLoginDto":{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]},"ExchangeCodeSuccessResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"organizationId":{"type":"string"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["status","accessToken","refreshToken"]},"ExchangeCodeUnverifiedResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["unverified"]},"sessionToken":{"type":"string"}},"required":["status","sessionToken"]},"ExchangeCodeDto":{"type":"object","properties":{"code":{"type":"string"},"device":{}},"required":["code"]},"RequestPhoneVerificationDto":{"type":"object","properties":{"phoneNumber":{"type":"string"},"sessionToken":{"type":"string"}},"required":["phoneNumber","sessionToken"]},"ConfirmPhoneVerificationDto":{"type":"object","properties":{"code":{"type":"number"},"sessionToken":{"type":"string"},"device":{}},"required":["code","sessionToken"]},"LoginProvider":{"type":"string","enum":["EMAIL","APPLE","GOOGLE","VIPPS","ENTRA","OIDC"],"description":"The primary (first enabled) provider for the domain. Retained as a scalar\nfor backward compatibility with shipped clients that decode a single\nprovider — do NOT remove until client telemetry shows old builds drained."},"ReturnProviderDto":{"type":"object","properties":{"provider":{"description":"The primary (first enabled) provider for the domain. Retained as a scalar\nfor backward compatibility with shipped clients that decode a single\nprovider — do NOT remove until client telemetry shows old builds drained.","$ref":"#/components/schemas/LoginProvider"},"providers":{"type":"array","description":"All distinct enabled providers configured for the domain. A domain shared by\nseveral orgs on the same IdP yields one entry; only genuinely mixed IdP\ntypes yield more. Additive — new clients render a chooser when length > 1.","items":{"$ref":"#/components/schemas/LoginProvider"}}},"required":["provider","providers"]},"CreatePersonalAccessTokenDto":{"type":"object","properties":{"expiresAt":{"format":"date-time","type":"string"},"name":{"type":"string"}},"required":["expiresAt"]},"ExternalIdSource":{"type":"string","enum":["SCIM","API","SSO_CLAIM"]},"AccountBillingType":{"type":"string","enum":["PERIODIC","PER_REPORT"]},"OrganizationTravelRateLevel":{"type":"string","enum":["ALL","TAXABLE","TAX_FREE","NONE"]},"OrganizationDriveRateLevel":{"type":"string","enum":["TAXFREE","TAXABLE","CUSTOM"]},"CategoryVisibility":{"type":"string","enum":["VISIBLE","HIDDEN"]},"RateCriteria":{"type":"string","enum":["PER_DIEM_TAX_ABROAD_COMPENSATION","PER_DIEM_TAX_FROM_6_TO_12_HOURS","PER_DIEM_TAX_OVER_12_HOURS_WITHOUT_ACCOMMODATION","PER_DIEM_TAX_OVER_12_HOURS_WITH_ACCOMMODATION","DRIVE_TAX_MILEAGE","DRIVE_TAX_MILEAGE_WITH_PASSENGER","DRIVE_TAX_MILEAGE_WITH_TRAILER","DRIVE_TAX_MILEAGE_OFFROAD","PER_DIEM_TAXFREE_FROM_6_TO_12_HOURS","PER_DIEM_TAXFREE_OVER_12_HOURS_WITHOUT_ACCOMMODATION","PER_DIEM_TAXFREE_OVERNIGHT_WITH_HOTEL","PER_DIEM_TAXFREE_OVERNIGHT_WITH_COOKING","PER_DIEM_TAXFREE_OVERNIGHT_WITHOUT_COOKING","PER_DIEM_TAXFREE_OVERNIGHT_TRUCKER","PER_DIEM_TAXFREE_NIGHT_DOMESTIC","DRIVE_TAXFREE_MILEAGE","DRIVE_TAXFREE_MILEAGE_WITH_PASSENGER","DRIVE_TAXFREE_MILEAGE_WITH_TRAILER","DRIVE_TAXFREE_MILEAGE_OFFROAD"]},"MealSelectionEntity":{"type":"object","properties":{"date":{"type":"string","example":"2026-04-27","description":"Meal calendar date in Europe/Oslo (YYYY-MM-DD)."},"meal":{"type":"string","enum":["breakfast","lunch","dinner"]},"isOn":{"type":"boolean","description":"False means this dated meal was provided; several facts may share one deduction."},"source":{"type":"string","enum":["STAY","USER"]}},"required":["date","meal","isOn","source"]},"PerDiemStatus":{"type":"string","enum":["COMPENSATED","EXCLUDED","MISSING_ACCOMMODATION","PRICING_UNAVAILABLE"]},"PerDiemCountrySource":{"type":"string","enum":["STAY","DESTINATION_PROXY","DAY_TRIP"],"description":"Origin of the country used for the abroad country rung; city may still come from the stay. null = per-diem row created before provenance tracking; recomputed on the next recalc."},"PerDiemBreakdownLineEntity":{"type":"object","properties":{"mealKey":{"type":"string","enum":["breakfast","lunch","dinner"]},"date":{"type":"string","example":"2026-07-15","description":"Civil meal date in Europe/Oslo (YYYY-MM-DD)."},"sharePct":{"type":"number","enum":[20,30,50]},"deductionMinor":{"type":"string","example":"20240","description":"Exact allocated meal deduction in minor units (øre)."},"source":{"type":"string","enum":["STAY","USER"]}},"required":["mealKey","date","sharePct","deductionMinor","source"]},"PerDiemBreakdownEntity":{"type":"object","properties":{"rateLabelKey":{"type":"string","enum":["dagsats.over12","dagsats.6to12","dognsats.statens","dognsats.hotell","dognsats.utenKokemulighet","dognsats.privat","dognsats"]},"rateMinor":{"type":"string","example":"101200","description":"Rate before meal deductions, in minor units (øre)."},"lines":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemBreakdownLineEntity"}},"netMinor":{"type":"string","example":"80960","description":"Settled net kost amount in minor units (øre), after meal deductions and before any folded supplement."},"compensationMinor":{"type":"string","example":"67400","description":"Kompensasjonstillegg utland folded into the stored amount, in minor units (øre). Absent when the døgn earned none; netMinor + compensationMinor is the row amount."}},"required":["rateLabelKey","rateMinor","lines","netMinor"]},"ReportStatus":{"type":"string","enum":["DRAFT","PENDING","APPROVED","REJECTED","BLOCKED"]},"ReportType":{"type":"string","enum":["TRAVEL","EXPENSE","DRIVE","EXPENSEGROUP"]},"ReportKind":{"type":"string","enum":["CLAIM","REQUEST"]},"ReportPresentation":{"type":"string","enum":["SINGLE","GROUP"]},"PerDiemSupplementKind":{"type":"string","enum":["ABROAD_COMPENSATION"]},"PerDiemSupplementLineDto":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PerDiemSupplementKind"},"label":{"type":"string","example":"Kompensasjonstillegg"},"count":{"type":"number","description":"Number of døgn that earned the supplement."},"amount":{"format":"int64","type":"integer"},"exemptAmount":{"format":"int64","type":"integer"},"taxableAmount":{"format":"int64","type":"integer"}},"required":["kind","label","count","amount","exemptAmount","taxableAmount"]},"ReportAttachmentSummaryDto":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","filename","createdAt","updatedAt"]},"AdvanceStatus":{"type":"string","enum":["APPROVED","DISBURSED","PARTIALLY_SETTLED","SETTLED","WRITTEN_OFF","CANCELED"]},"AdvanceContextDto":{"type":"object","properties":{"travelRequestReportId":{"type":"string","nullable":true},"grantedAmount":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"status":{"nullable":true,"$ref":"#/components/schemas/AdvanceStatus"},"disbursed":{"type":"boolean"},"settlementAmount":{"type":"number"},"outstandingAmount":{"type":"number","description":"What is still OWED on the grant: its principal less every settlement, repayment, write-off and correction. Not a ledger balance — an innvilget grant nobody has paid out yet owes its full amount while its balance is zero. 0 means nothing is owed, NOT that nothing was granted; read grantedAmount for that, and status/disbursed for where the grant has got to."}},"required":["travelRequestReportId","grantedAmount","currency","disbursed","settlementAmount","outstandingAmount"]},"TravelRequestContextDto":{"type":"object","properties":{"travelRequestReportId":{"type":"string","description":"Report id of the approved søknad this claim was converted from"},"ownCarApprovalRequested":{"type":"boolean","description":"What the approved søknad asked for; present only while its approval stands"},"premiumClassApprovalRequested":{"type":"boolean","description":"What the approved søknad asked for; present only while its approval stands"}},"required":["travelRequestReportId","ownCarApprovalRequested","premiumClassApprovalRequested"]},"ReportFindingsCheckCountDto":{"type":"object","properties":{"count":{"type":"number","description":"Open, non-baseline findings for this check"}},"required":["count"]},"ReportFindingsCountsDto":{"type":"object","properties":{"openCount":{"type":"number","description":"Open, non-baseline findings on the report"},"requireCount":{"type":"number","description":"Of those, findings whose consequence blocks approval"},"submitterOpenCount":{"type":"number","description":"Open findings on submitter-visible checks only"},"checkCounts":{"type":"object","description":"openCount broken down per catalog checkId, e.g. {\"missingReceipt\": {\"count\": 2}}. A key is present when the check has RUN for this report under the policy in force now — write-point checks once enabled, submit-point checks (currently missingReceipt) once the submit sweep completed over the report, and on a non-final report only while that sweep is newer than the latest policy or kill-switch change for the check (a policy change retires the earlier verdict until a resweep re-earns it). Present at {\"count\": 0} means it ran and found nothing; absent means not enabled, or not yet evaluated. What it carries depends on the read level. On a DETAIL read by a caller with org-wide findings access: the full breakdown, submitter-visible checks or not. On a LIST read (every caller — lists are caller-independent) and on a detail read by a caller with only read-own access: the submitter-safe breakdown, identical to submitterCheckCounts — hidden (fraud-class) checks are never named, and the \"did it run\" reading holds for submitter-visible checks only.","additionalProperties":{"$ref":"#/components/schemas/ReportFindingsCheckCountDto"}},"submitterCheckCounts":{"type":"object","description":"Same breakdown as checkCounts, restricted to submitter-visible checks. A hidden (fraud-class) check never appears as a key here, not even at zero, so this map cannot disclose a hidden check to the submitter.","additionalProperties":{"$ref":"#/components/schemas/ReportFindingsCheckCountDto"}}},"required":["openCount","requireCount","submitterOpenCount","checkCounts","submitterCheckCounts"]},"ReportValidationIssueDto":{"type":"object","properties":{"costIds":{"description":"Costs within the referenced expense that need this field.","type":"array","items":{"type":"string"}},"dimensionDefinitionId":{"type":"string","description":"Required dimension definition when the missing field is a Cost dimension."},"entityType":{"enum":["report","travel","travelRequest","expense","drive","perDiem","accommodation"],"type":"string"},"entityId":{"type":"string","nullable":true,"description":"Id of the expense/drive/perDiem/accommodation the issue refers to; null for report- and travel-level issues."},"subEntity":{"enum":["mainExpense","breakfastExpense"],"type":"string"},"field":{"type":"string","nullable":true,"description":"Canonical field identifier (matches the submit 400 requiredFields identifiers, e.g. categoryId, departmentId); null for structural rules like no_expenses.","example":"categoryId"},"rule":{"enum":["field_required","no_expenses","drive_stops_required","account_number_required"],"type":"string"},"severity":{"type":"string","enum":["blocker"]}},"required":["entityType","entityId","field","rule","severity"]},"ReportValidationDto":{"type":"object","properties":{"complete":{"type":"boolean","description":"True when the report would pass submit validation right now (status-independent)."},"issues":{"description":"Every completeness issue on the report, blocking and advisory. Negotiated by `X-Validation-Issues: v1`: a client that does not send the header receives the same array, in the same order, under the legacy key `findings` instead. Regenerating a client from this document and sending the header must therefore ship TOGETHER — a decoder that requires `issues` will fail on every report read until the header is sent, and one that requires `findings` will fail the moment it is. The key is not affected by the submit kill switch, which only ever downgrades the submit rejection body.","type":"array","items":{"$ref":"#/components/schemas/ReportValidationIssueDto"}}},"required":["complete","issues"]},"AmendedByDto":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"The amender's ACCOUNT id in the report's organization (like\n`reviewerAccountId`) — `null` for a principal who has no account there.\n\nThat is the platform operator amending a tenant's report: real, named, and\naccountless. The block itself must not collapse to `null` for them, or the\ntenant's own audit surface would say a report was amended by nobody. The\nid is what clients link to a member; the name is what they render, and it\nis present either way."},"name":{"type":"string","nullable":true}},"required":["id"]},"AmendedSinceSubmitDto":{"type":"object","properties":{"at":{"format":"date-time","type":"string"},"by":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/AmendedByDto"}]},"fields":{"type":"array","description":"Set union across every amend since the last reset, not just the last one.","items":{"type":"string","enum":["department","project","title","description","category","receipts","receiptRemove","dates","amounts","lines","advance"]}}},"required":["at","by","fields"]},"ReportAmendCapabilityDto":{"type":"object","properties":{"allowed":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string","enum":["department","project","title","description","category","receipts","receiptRemove","dates","amounts","lines","advance"]}}},"required":["allowed","fields"]},"ReportCapabilitiesDto":{"type":"object","properties":{"canUpdate":{"type":"boolean"},"canDelete":{"type":"boolean"},"canAmend":{"$ref":"#/components/schemas/ReportAmendCapabilityDto"},"amendedByCurrentApprover":{"type":"boolean"},"canSubmit":{"type":"boolean"},"canUnsubmit":{"type":"boolean"},"canApprove":{"type":"boolean"},"canUnapprove":{"type":"boolean"},"canReject":{"type":"boolean"},"canUnreject":{"type":"boolean"},"canOverride":{"type":"boolean"},"canRestore":{"type":"boolean"}},"required":["canUpdate","canDelete","canAmend","amendedByCurrentApprover","canSubmit","canUnsubmit","canApprove","canUnapprove","canReject","canUnreject","canOverride","canRestore"]},"MarkSubject":{"type":"string","enum":["ITEM","ITEM_FLAG","FINDING"]},"MarkValue":{"type":"string","enum":["OK","FOLLOW_UP","ANSWERED","DISMISSED","CONFIRMED","PENDING"]},"ReviewerMarkEntity":{"type":"object","properties":{"id":{"type":"string"},"reportId":{"type":"string"},"organizationId":{"type":"string"},"reviewerAccountId":{"type":"string"},"subjectKind":{"$ref":"#/components/schemas/MarkSubject"},"subjectId":{"type":"string"},"qualifier":{"type":"string"},"value":{"$ref":"#/components/schemas/MarkValue"},"rowUpdatedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","reportId","organizationId","reviewerAccountId","subjectKind","subjectId","qualifier","value","createdAt","updatedAt"]},"AnnotationItemKind":{"type":"string","enum":["EXPENSE","DRIVE","PER_DIEM","ACCOMMODATION"]},"AnnotationVisibility":{"type":"string","enum":["INTERNAL","SUBMITTER"]},"ReportAnnotationEntity":{"type":"object","properties":{"id":{"type":"string"},"reportId":{"type":"string"},"organizationId":{"type":"string"},"raisedByAccountId":{"type":"string"},"raisedInReviewId":{"type":"string"},"itemKind":{"$ref":"#/components/schemas/AnnotationItemKind"},"itemId":{"type":"string"},"body":{"type":"string"},"visibility":{"$ref":"#/components/schemas/AnnotationVisibility"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","reportId","organizationId","body","visibility","createdAt","updatedAt"]},"PrivateInterruptionEntity":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","example":"Europe/Madrid","description":"IANA zone the times were stated in; for display."}},"required":["startAt","endAt","timeZone"]},"PlaceSource":{"type":"string","enum":["MAP_SEARCH","MAP_PIN","MANUAL"]},"TravelAccommodationType":{"type":"string","enum":["HOTEL","COOKING_AVAILABLE","COOKING_UNAVAILABLE","NONE"]},"TravelRateLevel":{"type":"string","enum":["NONE","TAX_FREE","TAXABLE","CUSTOM"]},"PlaceProvider":{"type":"string","enum":["GOOGLE"]},"PlaceEntity":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"source":{"description":"Where the place came from. null means unknown and is not MAP_SEARCH.","$ref":"#/components/schemas/PlaceSource"},"provider":{"description":"The external provider that minted providerPlaceId.","$ref":"#/components/schemas/PlaceProvider"},"providerPlaceId":{"type":"string"},"name":{"type":"string"},"formattedAddress":{"type":"string"},"street":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"countryName":{"type":"string"},"countryCode":{"type":"string"},"cityKey":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"coordinatesAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","createdAt","updatedAt"]},"AccommodationFinancialModel":{"type":"string","enum":["LEGACY_PAIR","COSTS"]},"AccommodationCountrySource":{"type":"string","enum":["USER","PREFILL_ACCEPTED","PLACE_RESOLVED"],"description":"Provenance of the accommodation pricing country. PLACE_RESOLVED is server-only and requires matching coordinates; null means unknown or no country."},"ExchangeRateSource":{"type":"string","enum":["SERVICE","MANUAL"],"description":"Where `exchangeRate` came from: SERVICE when quoted by the rate service or priced at parity for an identity pair, MANUAL when a person typed it. Mirrored onto the synced child expenses. Null when unknown: the row predates the column, or a client supplied a rate and stated no provenance."},"RequestDate":{"type":"object","properties":{"year":{"type":"integer","minimum":1970,"maximum":2100},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year","month","day"]},"FxSnapshotDto":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"mode":{"type":"string","enum":["AUTO","MANUAL"]},"currency":{"type":"string"},"baseCurrency":{"type":"string"},"appliedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"quote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["NORGES_BANK","IDENTITY"]},"from":{"type":"string"},"to":{"type":"string"},"rate":{"type":"number"},"requestedDate":{"allOf":[{"$ref":"#/components/schemas/RequestDate"}],"nullable":true},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"observations":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"number"},"date":{"type":"string"},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["currency","rate","date","retrievedAt"]}}},"required":["id","provider","from","to","rate","requestedDate","retrievedAt","expiresAt","observations"]},"referenceQuote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["NORGES_BANK","IDENTITY"]},"from":{"type":"string"},"to":{"type":"string"},"rate":{"type":"number"},"requestedDate":{"allOf":[{"$ref":"#/components/schemas/RequestDate"}],"nullable":true},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"observations":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"number"},"date":{"type":"string"},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["currency","rate","date","retrievedAt"]}}},"required":["id","provider","from","to","rate","requestedDate","retrievedAt","expiresAt","observations"]},"basis":{"type":"string","enum":["RATE","BASE_AMOUNT"]},"inheritedCharge":{"type":"object","properties":{"originalAmount":{"type":"number"},"baseAmount":{"type":"number"}},"required":["originalAmount","baseAmount"]},"originalAmount":{"type":"number"},"baseAmount":{"type":"number"},"reason":{"type":"string"},"actorId":{"type":"string","nullable":true},"actorType":{"type":"string"}},"required":["version","mode","currency","baseCurrency","appliedAt"]},"PaymentMethod":{"type":"string","enum":["CARD","COMPANY_CARD","INVOICE","WALLET"]},"PaymentCardType":{"type":"string","enum":["DEBIT","CREDIT"]},"PaymentCard":{"type":"object","properties":{"id":{"type":"string"},"last4":{"type":"string"},"brand":{"type":"string"},"cardType":{"nullable":true,"$ref":"#/components/schemas/PaymentCardType"},"isDefault":{"type":"boolean"},"description":{"type":"string"},"organizationId":{"type":"string","nullable":true},"userId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string","nullable":true}},"required":["id","last4","brand","isDefault","description","userId","createdAt","updatedAt"]},"ExpenseCostRole":{"type":"string","enum":["GENERAL","LODGING","BREAKFAST"]},"CostTaxState":{"type":"string","enum":["UNKNOWN","KNOWN"]},"DistanceSource":{"type":"string","enum":["ROUTE","MANUAL"]},"DriveTaxLineEntity":{"type":"object","properties":{"kind":{"type":"string","enum":["mileage","passenger","trailer","offroad","toll"]},"amount":{"format":"int64","type":"integer"},"exemptAmount":{"format":"int64","type":"integer"},"taxableAmount":{"format":"int64","type":"integer"}},"required":["kind","amount","exemptAmount","taxableAmount"]},"DriveStopEntity":{"type":"object","properties":{"id":{"type":"string"},"driveId":{"type":"string"},"position":{"type":"number"},"address":{"type":"string","deprecated":true,"description":"Deprecated: use place.name"},"placeId":{"type":"string","deprecated":true,"description":"Deprecated: use place.providerPlaceId"},"source":{"description":"Deprecated: use place.source. Where this stop came from. null = unknown: the row predates the column, or the client that wrote it does not send provenance. null is NOT MAP_SEARCH.","deprecated":true,"$ref":"#/components/schemas/PlaceSource"},"lat":{"type":"number","deprecated":true,"description":"Deprecated: use place.lat. WGS84 latitude. Present on a stop dropped as a pin."},"lng":{"type":"number","deprecated":true,"description":"Deprecated: use place.lng. WGS84 longitude. Present on a stop dropped as a pin."},"placeRefId":{"type":"string"},"distanceMeters":{"type":"number"},"mileageAmount":{"format":"int64","type":"integer"},"tollAmount":{"format":"int64","type":"integer"},"passengerAmount":{"format":"int64","type":"integer"},"trailerAmount":{"format":"int64","type":"integer"},"offroadAmount":{"format":"int64","type":"integer"},"place":{"nullable":true,"description":"The stop's place. The flat columns below are its mirror, kept populated for\nthe deprecation window and dropped once every client reads `place`.","allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]}},"required":["id","driveId","position","address"]},"DriveEntity":{"type":"object","properties":{"id":{"type":"string"},"date":{"format":"date-time","type":"string"},"amount":{"format":"int64","type":"integer"},"mileageAmount":{"format":"int64","type":"integer"},"tollAmount":{"format":"int64","type":"integer"},"description":{"type":"string"},"mileageExemptAmount":{"format":"int64","type":"integer"},"passengerExemptAmount":{"format":"int64","type":"integer"},"trailerExemptAmount":{"format":"int64","type":"integer"},"offroadExemptAmount":{"format":"int64","type":"integer"},"distance":{"type":"number"},"distanceSource":{"description":"Where `distance` came from. ROUTE = computed by a map routing service, either by this API from the stops or by the client from its own routing call. MANUAL = stated by a person. null = unknown (a legacy row, or a client that does not send it) — never assume MANUAL.","$ref":"#/components/schemas/DistanceSource"},"returnTrip":{"type":"boolean"},"mileageRate":{"type":"number"},"vehicle":{"type":"string"},"shouldCalculateToll":{"type":"boolean"},"passengerNumber":{"type":"number"},"passengerNames":{"type":"string"},"isOffroad":{"type":"boolean"},"hasTrailer":{"type":"boolean"},"passengerRate":{"type":"number"},"passengerAmount":{"format":"int64","type":"integer"},"trailerRate":{"type":"number"},"trailerAmount":{"format":"int64","type":"integer"},"offroadRate":{"type":"number"},"offroadAmount":{"format":"int64","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"departmentId":{"type":"string"},"projectId":{"type":"string"},"taxCategoryId":{"type":"string"},"taxFreeCategoryId":{"type":"string"},"reportId":{"type":"string"},"organizationId":{"type":"string"},"taxLines":{"type":"array","items":{"$ref":"#/components/schemas/DriveTaxLineEntity"}},"exemptAmount":{"format":"int64","type":"integer"},"taxableAmount":{"format":"int64","type":"integer"},"stops":{"type":"array","items":{"$ref":"#/components/schemas/DriveStopEntity"}},"department":{"$ref":"#/components/schemas/DepartmentEntity"},"project":{"$ref":"#/components/schemas/ProjectEntity"},"taxCategory":{"$ref":"#/components/schemas/CategoryEntity"},"taxFreeCategory":{"$ref":"#/components/schemas/CategoryEntity"},"report":{"$ref":"#/components/schemas/ReportEntity"}},"required":["id","amount","mileageAmount","tollAmount","mileageExemptAmount","passengerExemptAmount","trailerExemptAmount","offroadExemptAmount","distance","returnTrip","mileageRate","shouldCalculateToll","passengerNumber","isOffroad","hasTrailer","passengerRate","passengerAmount","trailerRate","trailerAmount","offroadRate","offroadAmount","createdAt","updatedAt","reportId","organizationId"]},"InvitationEntity":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string"},"role":{"type":"number"},"expiresAt":{"format":"date-time","type":"string"},"invitedCount":{"type":"number"},"redeemedCount":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"createdByUserId":{"type":"string"},"revokedAt":{"format":"date-time","type":"string"},"revokedByUserId":{"type":"string"},"invalidRedemtionCount":{"type":"number"},"organizationId":{"type":"string"},"createdByUser":{"$ref":"#/components/schemas/UserEntity"},"revokedByUser":{"$ref":"#/components/schemas/UserEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}}},"required":["id","token","role","redeemedCount","createdAt","invalidRedemtionCount","organizationId"]},"DepartmentConfigurationEntity":{"type":"object","properties":{"id":{"type":"string"},"shouldOverrideInvoiceBuyer":{"type":"boolean"},"invoiceLegalName":{"type":"string"},"invoiceOrgNumber":{"type":"string"},"invoiceAddress":{"type":"string"},"invoicePostalCode":{"type":"string"},"invoiceRegion":{"type":"string"},"invoicePaymentTerms":{"type":"number"},"deliverByEhf":{"type":"boolean"},"deliverByEmail":{"type":"boolean"},"deliveryEmail":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"departmentId":{"type":"string"},"department":{"$ref":"#/components/schemas/DepartmentEntity"}},"required":["id","shouldOverrideInvoiceBuyer","deliverByEhf","deliverByEmail","createdAt","updatedAt","departmentId"]},"DepartmentAssignmentEntity":{"type":"object","properties":{"accountId":{"type":"string"},"departmentId":{"type":"string"},"role":{"type":"number"},"account":{"$ref":"#/components/schemas/AccountEntity"},"department":{"$ref":"#/components/schemas/DepartmentEntity"}},"required":["accountId","departmentId","role"]},"DepartmentEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"accountingCode":{"type":"string"},"accountingDescription":{"type":"string"},"description":{"type":"string"},"organizationId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"isPublic":{"type":"boolean"},"managedByIntegrationId":{"type":"string"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseEntity"}},"drives":{"type":"array","items":{"$ref":"#/components/schemas/DriveEntity"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectEntity"}},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"invitations":{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},"configuration":{"$ref":"#/components/schemas/DepartmentConfigurationEntity"},"departmentAssignments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentAssignmentEntity"}}},"required":["id","title","organizationId","createdAt","updatedAt","isPublic"]},"CostDimensionValueEntity":{"type":"object","properties":{"id":{"type":"string"},"definitionId":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"projectId":{"type":"string"},"departmentId":{"type":"string"},"deletedAt":{"format":"date-time","type":"string"},"project":{"$ref":"#/components/schemas/ProjectEntity"},"department":{"$ref":"#/components/schemas/DepartmentEntity"}},"required":["id","definitionId","organizationId","title"]},"CostDimensionEntity":{"type":"object","properties":{"costId":{"type":"string"},"definitionId":{"type":"string"},"valueId":{"type":"string"},"organizationId":{"type":"string"},"value":{"$ref":"#/components/schemas/CostDimensionValueEntity"}},"required":["costId","definitionId","valueId","organizationId"]},"CostTaxRecoveryStatus":{"type":"string","enum":["UNRESOLVED","RESOLVED"]},"CostTaxComponent":{"type":"object","properties":{"id":{"type":"string"},"costId":{"type":"string"},"organizationId":{"type":"string"},"kind":{"type":"string"},"jurisdiction":{"type":"string"},"ratePercent":{"type":"number"},"amount":{"format":"int64","type":"integer"},"recoveryStatus":{"$ref":"#/components/schemas/CostTaxRecoveryStatus"},"recoverableAmount":{"format":"int64","type":"integer"},"recoverySource":{"type":"string"}},"required":["id","costId","organizationId","kind","amount","recoveryStatus"]},"ExpenseCostEntity":{"type":"object","properties":{"id":{"type":"string"},"expenseId":{"type":"string"},"organizationId":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"categoryId":{"type":"string"},"role":{"$ref":"#/components/schemas/ExpenseCostRole"},"grossAmount":{"format":"int64","type":"integer"},"amountInBaseCurrency":{"format":"int64","type":"integer"},"taxState":{"$ref":"#/components/schemas/CostTaxState"},"origin":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"accommodationId":{"type":"string"},"category":{"$ref":"#/components/schemas/CategoryEntity"},"dimensions":{"type":"array","items":{"$ref":"#/components/schemas/CostDimensionEntity"}},"taxComponents":{"type":"array","items":{"$ref":"#/components/schemas/CostTaxComponent"}}},"required":["id","expenseId","organizationId","position","role","grossAmount","amountInBaseCurrency","taxState","origin","createdAt","updatedAt"]},"AttachmentStatus":{"type":"string","enum":["AWAITING_UPLOAD","STORED","EXPIRED"]},"DateTimeZoneSource":{"type":"string","enum":["MERCHANT_GEOCODE","DEVICE","USER","ORG_DEFAULT"]},"CaptureDomain":{"type":"string","enum":["EXPENSE","ACCOMMODATION"]},"CaptureSourceType":{"type":"string","enum":["ATTACHMENT","EMAIL_BODY"]},"Capture":{"type":"object","properties":{"id":{"type":"number"},"domain":{"$ref":"#/components/schemas/CaptureDomain"},"sourceType":{"$ref":"#/components/schemas/CaptureSourceType"},"inputText":{"type":"string"},"amount":{"format":"int64","type":"integer"},"amountIncludingVat":{"format":"int64","type":"integer"},"amountExcludingVat":{"format":"int64","type":"integer"},"vatRate":{"type":"number"},"vatAmount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"dateTimeZone":{"type":"string"},"dateHasTime":{"type":"boolean"},"merchant":{"type":"string"},"description":{"type":"string"},"categoryId":{"type":"string"},"executionTime":{"type":"number"},"interventionClass":{"type":"string"},"modelId":{"type":"string"},"promptProfileId":{"type":"string"},"fallbackMode":{"type":"string"},"fallbackUsed":{"type":"boolean"},"result":{"type":"object","additionalProperties":true,"nullable":true},"assessment":{"type":"object","additionalProperties":true,"nullable":true},"createdAt":{"format":"date-time","type":"string"},"publicRef":{"type":"string"},"createdByUserId":{"type":"string"},"boundExpenseId":{"type":"string"},"attachmentId":{"type":"string"}},"required":["id","domain","sourceType","inputText","fallbackUsed","createdAt"]},"AttachmentEntity":{"type":"object","properties":{"id":{"type":"string"},"storageKey":{"type":"string"},"expenseId":{"type":"string"},"status":{"$ref":"#/components/schemas/AttachmentStatus"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"ocrText":{"type":"string"},"amountIncludingVat":{"format":"int64","type":"integer"},"amountExcludingVat":{"format":"int64","type":"integer"},"vatRate":{"type":"number"},"vatAmount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"dateTimeZone":{"type":"string"},"dateTimeZoneSource":{"$ref":"#/components/schemas/DateTimeZoneSource"},"dateHasTime":{"type":"boolean"},"merchant":{"type":"string"},"description":{"type":"string"},"categoryId":{"type":"string"},"splitFromAttachmentId":{"type":"string"},"sha256":{"type":"string"},"pHash":{"type":"string"},"dHash":{"type":"string"},"embeddingId":{"type":"string"},"captures":{"description":"The most recent Attachment Capture record for this attachment","type":"array","items":{"$ref":"#/components/schemas/Capture"}},"autofill":{"type":"object","description":"Autofill outcome for the attachment upload request, including skip reason when expense fields were not applied."},"url":{"type":"string"},"expense":{"$ref":"#/components/schemas/ExpenseEntity"}},"required":["id","storageKey","expenseId","status","createdAt","updatedAt","dateHasTime"]},"InboxItemStatus":{"type":"string","enum":["RESERVED","CLEARED"]},"InboxItemSource":{"type":"string","enum":["EMAIL","CHAT","MANUAL"]},"InboxEntity":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deactivatedAt":{"format":"date-time","type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"user":{"$ref":"#/components/schemas/UserEntity"},"inboxItems":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemEntity"}}},"required":["id","createdAt","updatedAt"]},"InboxItemAttachmentEntity":{"type":"object","properties":{"id":{"type":"string"},"storageKey":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"inboxItemId":{"type":"string"},"url":{"type":"string"},"inboxItem":{"$ref":"#/components/schemas/InboxItemEntity"}},"required":["id","storageKey","createdAt","updatedAt","inboxItemId"]},"InboxItemEntity":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"from":{"type":"string"},"amount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"merchant":{"type":"string"},"description":{"type":"string"},"reservationId":{"type":"string"},"status":{"$ref":"#/components/schemas/InboxItemStatus"},"source":{"$ref":"#/components/schemas/InboxItemSource"},"organizationId":{"type":"string"},"expenseId":{"type":"string"},"inboxId":{"type":"string"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"inbox":{"$ref":"#/components/schemas/InboxEntity"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemAttachmentEntity"}},"expense":{"$ref":"#/components/schemas/ExpenseEntity"}},"required":["id","createdAt","updatedAt","source"]},"ExpenseEntity":{"type":"object","properties":{"costsRevision":{"type":"number","description":"Revision for Cost financial writes; absent on servers predating Costs."},"id":{"type":"string"},"date":{"format":"date-time","type":"string"},"dateTimeZone":{"type":"string"},"dateHasTime":{"type":"boolean"},"amount":{"format":"int64","type":"integer"},"title":{"type":"string"},"merchant":{"type":"string"},"description":{"type":"string"},"departmentId":{"type":"string"},"projectId":{"type":"string"},"reportId":{"type":"string"},"categoryId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentCardId":{"type":"string"},"walletId":{"type":"string"},"deletedAt":{"format":"date-time","type":"string"},"currency":{"type":"string"},"exchangeRate":{"type":"number"},"exchangeRateSource":{"nullable":true,"description":"Where `exchangeRate` came from: SERVICE when quoted by the rate service or priced at parity for an identity pair, MANUAL when a person typed it. Null when unknown: the row predates the column, or a client supplied a rate and stated no provenance.","$ref":"#/components/schemas/ExchangeRateSource"},"fxSnapshot":{"nullable":true,"additionalProperties":true,"allOf":[{"$ref":"#/components/schemas/FxSnapshotDto"}]},"amountInBaseCurrency":{"format":"int64","type":"integer"},"vatRate":{"type":"number"},"vatAmount":{"format":"int64","type":"integer"},"isVatDeductible":{"type":"boolean"},"organizationId":{"type":"string"},"ownerExpenseId":{"type":"string","format":"uuid","description":"Financial owner of a read-only compatibility Cost view; absent on canonical expenses."},"invoiceDetected":{"type":"boolean"},"costs":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCostEntity"}},"report":{"$ref":"#/components/schemas/ReportEntity"},"paymentCard":{"$ref":"#/components/schemas/PaymentCard"},"department":{"$ref":"#/components/schemas/DepartmentEntity"},"project":{"$ref":"#/components/schemas/ProjectEntity"},"category":{"$ref":"#/components/schemas/CategoryEntity"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentEntity"}},"inboxItems":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemEntity"}}},"required":["id","amount","reportId","createdAt","updatedAt","organizationId"]},"TravelAccommodationEntity":{"type":"object","properties":{"financialModel":{"$ref":"#/components/schemas/AccommodationFinancialModel"},"id":{"type":"string"},"travelId":{"type":"string"},"name":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use place.name"},"placeId":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use place.providerPlaceId"},"city":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use place.city"},"country":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use place.countryName"},"countrySource":{"nullable":true,"description":"Provenance of the accommodation pricing country. PLACE_RESOLVED is server-only and requires matching coordinates; null means unknown or no country.","$ref":"#/components/schemas/AccommodationCountrySource"},"region":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use place.region"},"lat":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use place.lat"},"lng":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use place.lng"},"countryCode":{"type":"string"},"cityKey":{"type":"string"},"placeRefId":{"type":"string"},"checkInAt":{"format":"date-time","type":"string"},"checkOutAt":{"format":"date-time","type":"string"},"type":{"$ref":"#/components/schemas/TravelAccommodationType"},"rateLevel":{"$ref":"#/components/schemas/TravelRateLevel"},"description":{"type":"string"},"amount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"exchangeRate":{"type":"number"},"exchangeRateSource":{"nullable":true,"description":"Where `exchangeRate` came from: SERVICE when quoted by the rate service or priced at parity for an identity pair, MANUAL when a person typed it. Mirrored onto the synced child expenses. Null when unknown: the row predates the column, or a client supplied a rate and stated no provenance.","$ref":"#/components/schemas/ExchangeRateSource"},"fxSnapshot":{"nullable":true,"additionalProperties":true,"allOf":[{"$ref":"#/components/schemas/FxSnapshotDto"}]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentCardId":{"type":"string"},"transactionDate":{"format":"date-time","type":"string"},"breakfastAmount":{"format":"int64","type":"integer"},"breakfastIncluded":{"type":"boolean"},"projectId":{"type":"string"},"expenseId":{"type":"string"},"breakfastExpenseId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"place":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]},"amountInBaseCurrency":{"format":"int64","type":"integer"},"breakfastAmountInBaseCurrency":{"format":"int64","type":"integer"},"ownerExpenseId":{"type":"string","format":"uuid","description":"Financial owner when this stay selects a subset of a shared receipt; the stay-level signal that survives even when the room view is gone. Absent on stays that own their expense outright."},"travel":{"$ref":"#/components/schemas/TravelEntity"},"project":{"$ref":"#/components/schemas/ProjectEntity"},"paymentCard":{"$ref":"#/components/schemas/PaymentCard"},"expense":{"$ref":"#/components/schemas/ExpenseEntity"},"breakfastExpense":{"$ref":"#/components/schemas/ExpenseEntity"},"perDiems":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}}},"required":["id","travelId","type","rateLevel","breakfastIncluded","createdAt","updatedAt"]},"TravelEntity":{"type":"object","properties":{"id":{"type":"string"},"fromDateTime":{"format":"date-time","type":"string"},"toDateTime":{"format":"date-time","type":"string"},"businessStartAt":{"type":"string","nullable":true,"format":"date-time"},"businessStartTimeZone":{"type":"string","nullable":true},"businessEndAt":{"type":"string","nullable":true,"format":"date-time"},"businessEndTimeZone":{"type":"string","nullable":true},"privateInterruptions":{"description":"Private interruptions inside the business window, sorted by startAt; null when none.","additionalProperties":true,"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/PrivateInterruptionEntity"}},"fromLocationName":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.name"},"toLocationName":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.name"},"fromLocationPlaceId":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.providerPlaceId"},"toLocationPlaceId":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.providerPlaceId"},"fromLocationSource":{"description":"Where the departure endpoint came from. null = unknown: the row predates the column, or the client that wrote it does not send provenance. null is NOT MAP_SEARCH.","deprecated":true,"$ref":"#/components/schemas/PlaceSource"},"toLocationSource":{"description":"Where the destination endpoint came from. null = unknown: the row predates the column, or the client that wrote it does not send provenance. null is NOT MAP_SEARCH.","deprecated":true,"$ref":"#/components/schemas/PlaceSource"},"fromLocationCity":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.city"},"toLocationCity":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.city"},"fromLocationCountry":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.countryName"},"toLocationCountry":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.countryName"},"fromLocationRegion":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.region"},"toLocationRegion":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.region"},"fromLat":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.lat"},"fromLng":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.lng"},"toLat":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.lat"},"toLng":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.lng"},"fromCountryCode":{"type":"string"},"toCountryCode":{"type":"string"},"fromCityKey":{"type":"string"},"toCityKey":{"type":"string"},"fromPlaceId":{"type":"string"},"toPlaceId":{"type":"string"},"purpose":{"type":"string"},"typeOfAccommodation":{"$ref":"#/components/schemas/TravelAccommodationType"},"advanceAmount":{"format":"int64","type":"integer"},"rateLevel":{"$ref":"#/components/schemas/TravelRateLevel"},"perDiemDisabled":{"type":"boolean"},"reportId":{"type":"string"},"travelRequestId":{"type":"string"},"dietSchemeVersionId":{"type":"string"},"organizationId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"fromPlace":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]},"toPlace":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]},"report":{"$ref":"#/components/schemas/ReportEntity"},"accommodations":{"type":"array","items":{"$ref":"#/components/schemas/TravelAccommodationEntity"}}},"required":["id","typeOfAccommodation","rateLevel","perDiemDisabled","reportId","organizationId","createdAt","updatedAt"]},"TravelRequestEntity":{"type":"object","properties":{"id":{"type":"string"},"reportId":{"type":"string"},"organizationId":{"type":"string"},"purpose":{"type":"string"},"fromDateTime":{"format":"date-time","type":"string"},"toDateTime":{"format":"date-time","type":"string"},"fromLocationName":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.name"},"toLocationName":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.name"},"fromLocationPlaceId":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.providerPlaceId"},"toLocationPlaceId":{"type":"string","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.providerPlaceId"},"fromLat":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.lat"},"fromLng":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.lng"},"toLat":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.lat"},"toLng":{"type":"number","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.lng"},"fromPlaceId":{"type":"string"},"toPlaceId":{"type":"string"},"estimatedCost":{"format":"int64","type":"integer"},"requestedAdvanceAmount":{"format":"int64","type":"integer"},"ownCarApprovalRequested":{"type":"boolean"},"premiumClassApprovalRequested":{"type":"boolean"},"currency":{"type":"string"},"travelRequestNumber":{"type":"number"},"pdfStorageKey":{"type":"string"},"pdfGeneratedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"fromPlace":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]},"toPlace":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PlaceEntity"}]}},"required":["id","reportId","organizationId","ownCarApprovalRequested","premiumClassApprovalRequested","currency","createdAt","updatedAt"]},"InvoiceStatus":{"type":"string","enum":["CREATING","COMPRESSING","CREATED","SENDING","SENT","DELIVERED","FAILED"]},"InvoiceEntity":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"deliveredAs":{"type":"string"},"errorDescription":{"type":"string"},"ehfMessageNumber":{"type":"number"},"pdfStorageKey":{"type":"string"},"ehfStorageKey":{"type":"string"},"emailDeliveredAt":{"format":"date-time","type":"string"},"ehfSentAt":{"format":"date-time","type":"string"},"deliveryRequestedAt":{"format":"date-time","type":"string"},"pdfAttempt":{"type":"number"},"invoiceNumber":{"type":"number"},"dueDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"organizationId":{"type":"string"},"reportId":{"type":"string"},"orgNumber":{"type":"string"},"url":{"type":"string"},"ehfUrl":{"type":"string"},"report":{"$ref":"#/components/schemas/ReportEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","status","pdfAttempt","invoiceNumber","dueDate","createdAt","updatedAt","organizationId","reportId"]},"ReviewResult":{"type":"string","enum":["COMMENT","PENDING","APPROVED","REJECTED","UNAPPROVED","UNREJECTED","OVERRIDDEN","REASSIGNED","WITHDRAWN","INVALIDATED"]},"ReviewCapabilitiesDto":{"type":"object","properties":{"canReassign":{"type":"boolean"},"canOverride":{"type":"boolean"}},"required":["canReassign","canOverride"]},"ReviewEntity":{"type":"object","properties":{"id":{"type":"string"},"reportId":{"type":"string"},"reviewerAccountId":{"type":"string"},"requestedReviewer":{"type":"object","additionalProperties":true,"nullable":true},"dedupeKey":{"type":"string"},"result":{"$ref":"#/components/schemas/ReviewResult"},"comment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"reviewedAt":{"format":"date-time","type":"string"},"invalidationGeneration":{"type":"number"},"organizationId":{"type":"string"},"capabilities":{"description":"Per-caller step capabilities (reassign/override) for this review row. Present ONLY on the GET /reports/{id} detail read (attached per review row there) — absent from list responses. Advisory for UI.","allOf":[{"$ref":"#/components/schemas/ReviewCapabilitiesDto"}]},"report":{"$ref":"#/components/schemas/ReportEntity"},"reviewer":{"$ref":"#/components/schemas/AccountEntity"}},"required":["id","reportId","result","createdAt","updatedAt","invalidationGeneration","organizationId"]},"ReportEntity":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatus"},"type":{"$ref":"#/components/schemas/ReportType"},"amount":{"format":"int64","type":"integer"},"baseCurrency":{"type":"string"},"accountId":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"shouldReinvoice":{"type":"boolean"},"departmentId":{"type":"string"},"projectId":{"type":"string"},"reviewComment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"},"submittedAt":{"format":"date-time","type":"string"},"kind":{"$ref":"#/components/schemas/ReportKind"},"presentation":{"$ref":"#/components/schemas/ReportPresentation"},"perDiemSupplements":{"description":"Per-diem supplements a scheme modifier paid on top of the kostgodtgjørelse (today: kompensasjonstillegg utland), one labelled line per kind with the døgn count. Already folded into the per-diem `amount`s and into `amount` — presentational, never to be added again. Present (possibly empty) on default report reads, detail and list alike.","type":"array","items":{"$ref":"#/components/schemas/PerDiemSupplementLineDto"}},"reportAttachments":{"type":"array","items":{"$ref":"#/components/schemas/ReportAttachmentSummaryDto"}},"advanceContext":{"$ref":"#/components/schemas/AdvanceContextDto"},"travelRequestContext":{"$ref":"#/components/schemas/TravelRequestContextDto"},"findings":{"$ref":"#/components/schemas/ReportFindingsCountsDto"},"validation":{"description":"Submit-completeness verdict computed from the same rules that gate POST /reports/:id/submit. Present on default report reads — BOTH the list endpoint and GET /reports/{id}. Unlike `capabilities`, it is not detail-only (absent only when a caller supplies a custom include).","allOf":[{"$ref":"#/components/schemas/ReportValidationDto"}]},"amendedSinceSubmit":{"nullable":true,"description":"Set when someone other than the owner corrected this report while it was in review, and cleared by every door out of review (unsubmit, resubmit, unapprove, unreject). Present — as an explicit null when there is nothing to report — on GET /reports/{id}, on the list endpoint, and on the amending write's own response.","allOf":[{"$ref":"#/components/schemas/AmendedSinceSubmitDto"}]},"capabilities":{"description":"Per-caller capability block: what the authenticated caller may do to this report right now. Derived from the same authorization + state checks the mutation endpoints run. Present ONLY on the GET /reports/{id} detail read — absent from list responses. Advisory for UI.","allOf":[{"$ref":"#/components/schemas/ReportCapabilitiesDto"}]},"marks":{"description":"The CALLING reviewer's own pass marks on this report — never another reviewer's. Detail reads only. Absent for a caller who has marked nothing.","type":"array","items":{"$ref":"#/components/schemas/ReviewerMarkEntity"}},"annotations":{"description":"Annotations visible to THIS caller: reviewers see every annotation, the submitter only the ones published to them. Detail reads only.","type":"array","items":{"$ref":"#/components/schemas/ReportAnnotationEntity"}},"account":{"$ref":"#/components/schemas/AccountEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"travel":{"$ref":"#/components/schemas/TravelEntity"},"travelRequest":{"$ref":"#/components/schemas/TravelRequestEntity"},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceEntity"}},"department":{"$ref":"#/components/schemas/DepartmentEntity"},"project":{"$ref":"#/components/schemas/ProjectEntity"},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEntity"}},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseEntity"}},"drives":{"type":"array","items":{"$ref":"#/components/schemas/DriveEntity"}},"perDiems":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}}},"required":["id","status","amount","baseCurrency","accountId","organizationId","createdAt","updatedAt"]},"ProjectEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"accountingCode":{"type":"string"},"accountingDescription":{"type":"string"},"description":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"managedByIntegrationId":{"type":"string"},"organizationId":{"type":"string"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseEntity"}},"drives":{"type":"array","items":{"$ref":"#/components/schemas/DriveEntity"}},"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","title","createdAt","updatedAt","organizationId"]},"PerDiemEntity":{"type":"object","properties":{"id":{"type":"string"},"date":{"format":"date-time","type":"string"},"isHalfDay":{"type":"boolean"},"dognIndex":{"type":"number","nullable":true,"description":"Zero-based position of this 24-hour period in the trip."},"periodStart":{"format":"date-time","type":"string","nullable":true,"description":"Start instant of the 24-hour per-diem period."},"periodEnd":{"format":"date-time","type":"string","nullable":true,"description":"Unclamped end instant of the 24-hour per-diem period."},"isFullDogn":{"type":"boolean","nullable":true,"description":"Whether this row represents a full per-diem period."},"stayBreakfast":{"type":"boolean","description":"Whether the covering stay includes breakfast."},"mealSelections":{"additionalProperties":true,"nullable":true,"description":"Dated meal facts, separate from the effective period-level deduction flags.","type":"array","items":{"$ref":"#/components/schemas/MealSelectionEntity"}},"status":{"$ref":"#/components/schemas/PerDiemStatus"},"country":{"type":"string"},"countrySource":{"nullable":true,"description":"Origin of the country used for the abroad country rung; city may still come from the stay. null = per-diem row created before provenance tracking; recomputed on the next recalc.","$ref":"#/components/schemas/PerDiemCountrySource"},"breakfast":{"type":"boolean"},"lunch":{"type":"boolean"},"dinner":{"type":"boolean"},"fullFareAmount":{"format":"int64","type":"integer"},"fullFareExemptAmount":{"format":"int64","type":"integer"},"taxAmount":{"format":"int64","type":"integer"},"exemptAmount":{"format":"int64","type":"integer"},"amount":{"format":"int64","type":"integer"},"compensationAmount":{"format":"int64","type":"integer","nullable":true,"description":"Kompensasjonstillegg utland folded into `amount` for this døgn (minor units, fully taxable). Null when none was earned."},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"exemptCriteria":{"$ref":"#/components/schemas/RateCriteria"},"taxCategoryId":{"type":"string"},"taxFreeCategoryId":{"type":"string"},"rateId":{"type":"string"},"reportId":{"type":"string"},"travelAccommodationId":{"type":"string"},"organizationId":{"type":"string"},"taxableAmount":{"format":"int64","type":"integer"},"breakdown":{"nullable":true,"description":"Exact server-side explanation of the stored compensated amount; null for unsettled rows.","allOf":[{"$ref":"#/components/schemas/PerDiemBreakdownEntity"}]},"projectId":{"type":"string","nullable":true,"description":"Effective project on full report reads: covering accommodation, then report."},"project":{"nullable":true,"description":"Effective project on full report reads: covering accommodation, then report.","allOf":[{"$ref":"#/components/schemas/ProjectEntity"}]},"taxCategory":{"$ref":"#/components/schemas/CategoryEntity"},"taxFreeCategory":{"$ref":"#/components/schemas/CategoryEntity"},"rate":{"$ref":"#/components/schemas/RateEntity"},"report":{"$ref":"#/components/schemas/ReportEntity"}},"required":["id","isHalfDay","status","breakfast","lunch","dinner","createdAt","updatedAt","reportId","organizationId"]},"RateAmountEntity":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"number"},"applicableYear":{"type":"number"},"rateId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"rate":{"$ref":"#/components/schemas/RateEntity"}},"required":["id","value","rateId","createdAt","updatedAt"]},"RateEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"criteria":{"$ref":"#/components/schemas/RateCriteria"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"organizationId":{"type":"string"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryEntity"}},"perDiems":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}},"amounts":{"type":"array","items":{"$ref":"#/components/schemas/RateAmountEntity"}}},"required":["id","criteria","createdAt","updatedAt"]},"CategoryEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"accountingCode":{"type":"string"},"altAccountingCode":{"type":"string"},"externalId":{"type":"string"},"description":{"type":"string"},"guidance":{"type":"string"},"context":{"type":"string"},"visibility":{"$ref":"#/components/schemas/CategoryVisibility"},"rateId":{"type":"string"},"managedByIntegrationId":{"type":"string"},"organizationId":{"type":"string"},"deletedAt":{"format":"date-time","type":"string"},"accommodationHotelOrganizationId":{"type":"string"},"accommodationCookingOrganizationId":{"type":"string"},"accommodationOtherOrganizationId":{"type":"string"},"accommodationBreakfastOrganizationId":{"type":"string"},"rate":{"$ref":"#/components/schemas/RateEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseEntity"}},"driveTaxExpenses":{"type":"array","items":{"$ref":"#/components/schemas/DriveEntity"}},"driveTaxFreeExpenses":{"type":"array","items":{"$ref":"#/components/schemas/DriveEntity"}},"perDiemTaxExpenses":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}},"perDiemTaxFreeExpenses":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemEntity"}}},"required":["id","title","visibility","organizationId"]},"PriceInterval":{"type":"string","enum":["MONTH","QUARTER","YEAR"]},"SubscriptionStatus":{"type":"string","enum":["active","canceled","trialing","past_due","suspended"]},"PriceType":{"type":"string","enum":["FIXED","PER_ACCOUNT","PER_EXPENSE","PER_REPORT","PER_INVOICE"]},"ProductType":{"type":"string","enum":["PLAN","ADD_ON","INTEGRATION"]},"CouponDuration":{"type":"string","enum":["FOREVER","ONCE","REPEATING"]},"CouponCodeEntity":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"expiresAt":{"format":"date-time","type":"string"},"maxRedemptions":{"type":"number"},"redeemedCount":{"type":"number"},"firstTimeRedemptionOnly":{"type":"boolean"},"couponId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"organizationId":{"type":"string"},"coupon":{"$ref":"#/components/schemas/CouponEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","code","active","redeemedCount","firstTimeRedemptionOnly","couponId","createdAt","updatedAt"]},"AppliedCouponEntity":{"type":"object","properties":{"id":{"type":"string"},"couponId":{"type":"string"},"subscriptionItemId":{"type":"string"},"appliedAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","type":"string"},"clockStartsAtFirstPaidInvoice":{"type":"boolean"},"coupon":{"$ref":"#/components/schemas/CouponEntity"},"subscriptionItem":{"$ref":"#/components/schemas/SubscriptionItemEntity"}},"required":["id","couponId","subscriptionItemId","appliedAt","clockStartsAtFirstPaidInvoice"]},"CouponEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"duration":{"$ref":"#/components/schemas/CouponDuration"},"durationInMonths":{"type":"number"},"percentOff":{"type":"number"},"expiresAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"appliesTo":{"type":"array","items":{"$ref":"#/components/schemas/ProductEntity"}},"couponCodes":{"type":"array","items":{"$ref":"#/components/schemas/CouponCodeEntity"}},"usedBy":{"type":"array","items":{"$ref":"#/components/schemas/AppliedCouponEntity"}}},"required":["id","name","duration","percentOff","createdAt","updatedAt"]},"ProductFeatureEntity":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"productId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"product":{"$ref":"#/components/schemas/ProductEntity"}},"required":["id","title","productId","createdAt","updatedAt"]},"ProductEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"type":{"$ref":"#/components/schemas/ProductType"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/PriceEntity"}},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/CouponEntity"}},"dependsOn":{"type":"array","items":{"$ref":"#/components/schemas/ProductEntity"}},"dependents":{"type":"array","items":{"$ref":"#/components/schemas/ProductEntity"}},"features":{"type":"array","items":{"$ref":"#/components/schemas/ProductFeatureEntity"}}},"required":["id","name","type","createdAt","updatedAt"]},"PriceEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"},"isDefault":{"type":"boolean"},"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"type":{"$ref":"#/components/schemas/PriceType"},"isActive":{"type":"boolean"},"productId":{"type":"string"},"poProductId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"product":{"$ref":"#/components/schemas/ProductEntity"},"subscriptionItems":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionItemEntity"}}},"required":["id","amount","recurringInterval","type","isActive","productId","createdAt","updatedAt"]},"SubscriptionItemEntity":{"type":"object","properties":{"id":{"type":"string"},"subscriptionId":{"type":"string"},"activeFrom":{"format":"date-time","type":"string"},"billableFrom":{"format":"date-time","type":"string"},"activeTo":{"format":"date-time","type":"string"},"priceId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"subscription":{"$ref":"#/components/schemas/SubscriptionEntity"},"price":{"$ref":"#/components/schemas/PriceEntity"},"appliedCoupon":{"$ref":"#/components/schemas/AppliedCouponEntity"},"total":{"type":"number"}},"required":["id","subscriptionId","activeFrom","priceId","createdAt","updatedAt"]},"SubscriptionEntity":{"type":"object","properties":{"id":{"type":"string"},"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"subscriptionStatus":{"$ref":"#/components/schemas/SubscriptionStatus"},"trialPeriodEnd":{"format":"date-time","type":"string"},"cancelAtPeriodEnd":{"type":"boolean"},"autoInvoice":{"type":"boolean"},"billingDay":{"type":"number"},"billingPeriodStart":{"format":"date-time","type":"string"},"billingPeriodEnd":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"canceledAt":{"format":"date-time","type":"string"},"muteNotifications":{"type":"boolean"},"paidSeats":{"type":"number"},"lastSeatTrueUpAt":{"format":"date-time","type":"string"},"organizationId":{"type":"string"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionItemEntity"}}},"required":["id","recurringInterval","cancelAtPeriodEnd","autoInvoice","billingPeriodStart","createdAt","updatedAt","muteNotifications","paidSeats","organizationId"]},"Usage":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"usersCount":{"type":"number"},"reportsCount":{"type":"number"},"expensesCount":{"type":"number"},"drivesCount":{"type":"number"},"travelsCount":{"type":"number"},"categoriesCount":{"type":"number"},"departmentsCount":{"type":"number"},"projectsCount":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","usersCount","reportsCount","expensesCount","drivesCount","travelsCount","categoriesCount","departmentsCount","projectsCount","createdAt","updatedAt"]},"UsageStatistic":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"usersCount":{"type":"number"},"expensesCount":{"type":"number"},"drivesCount":{"type":"number"},"travelsCount":{"type":"number"},"categoriesCount":{"type":"number"},"departmentsCount":{"type":"number"},"date":{"format":"date-time","type":"string"}},"required":["id","organizationId","usersCount","expensesCount","drivesCount","travelsCount","categoriesCount","departmentsCount","date"]},"OrganizationMonthlyUsage":{"type":"object","properties":{"organizationId":{"type":"string"},"monthStart":{"format":"date-time","type":"string"},"expensesCount":{"type":"number"},"drivesCount":{"type":"number"},"travelsCount":{"type":"number"},"totalUsageCount":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["organizationId","monthStart","expensesCount","drivesCount","travelsCount","totalUsageCount","createdAt","updatedAt"]},"CommunicationChannel":{"type":"string","enum":["EMAIL","SMS","PUSH","SLACK"]},"CommunicationEntity":{"type":"object","properties":{"id":{"type":"number"},"to":{"type":"string"},"subject":{"type":"string"},"message":{"type":"string"},"userId":{"type":"string"},"accountId":{"type":"string"},"organizationId":{"type":"string"},"dateTime":{"format":"date-time","type":"string"},"channel":{"$ref":"#/components/schemas/CommunicationChannel"},"user":{"$ref":"#/components/schemas/UserEntity"},"account":{"$ref":"#/components/schemas/AccountEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","dateTime","channel"]},"OrgAuthProviderKind":{"type":"string","enum":["ENTRA_COMMON","OIDC"]},"OrgAuthEmailAssurance":{"type":"string","enum":["NONE","IDP_VERIFIED"]},"OrganizationAuthProvider":{"type":"object","properties":{"id":{"type":"string"},"provider":{"$ref":"#/components/schemas/LoginProvider"},"kind":{"$ref":"#/components/schemas/OrgAuthProviderKind"},"providerKey":{"type":"string"},"issuer":{"type":"string"},"clientId":{"type":"string"},"clientSecretEnc":{"type":"string"},"encKeyId":{"type":"string"},"emailAssurance":{"$ref":"#/components/schemas/OrgAuthEmailAssurance"},"domain":{"type":"string"},"isEnabled":{"type":"boolean"},"createOnLogin":{"type":"boolean"},"entraTenantId":{"type":"string"},"activeDomainKey":{"type":"string"},"organizationId":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","provider","kind","emailAssurance","domain","isEnabled","createOnLogin","organizationId","updatedAt","createdAt"]},"ServiceAccountScope":{"type":"string","enum":["GLOBAL","ORGANIZATION"]},"ServiceAccessTokenEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tokenHash":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"serviceAccountId":{"type":"string"},"serviceAccount":{"$ref":"#/components/schemas/ServiceAccountEntity"}},"required":["id","tokenHash","createdAt"]},"IntegrationEntity":{"type":"object","properties":{"id":{"type":"string"},"webhookUrl":{"type":"string"},"hmacSecret":{"type":"string"},"events":{"type":"string"},"serviceAccountId":{"type":"string"},"organizationId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"integrationProviderId":{"type":"string"},"name":{"type":"string","description":"Provider-derived display label, e.g. \"Unimicro\" or the provider id if the provider is unknown."},"serviceAccount":{"$ref":"#/components/schemas/ServiceAccountEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","webhookUrl","hmacSecret","organizationId","createdAt","updatedAt"]},"ServiceAccountEntity":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"number"},"name":{"type":"string"},"scope":{"$ref":"#/components/schemas/ServiceAccountScope"},"organizationId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"serviceAccessTokens":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAccessTokenEntity"}},"integration":{"$ref":"#/components/schemas/IntegrationEntity"}},"required":["id","role","name","scope","createdAt","updatedAt"]},"RateAbroad":{"type":"object","properties":{"id":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"applicableYear":{"type":"number"},"organizationId":{"type":"string"}},"required":["id","amount","currency","createdAt","updatedAt"]},"EnterpriseAccountEntity":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"number"},"enterpriseId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"userId":{"type":"string"},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"},"user":{"$ref":"#/components/schemas/UserEntity"}},"required":["id","role","enterpriseId","createdAt","updatedAt","userId"]},"EnterpriseProductEntity":{"type":"object","properties":{"id":{"type":"string"},"enterpriseId":{"type":"string"},"productId":{"type":"string"},"activeFrom":{"format":"date-time","type":"string"},"activeTo":{"format":"date-time","type":"string"},"memberPriceId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"},"product":{"$ref":"#/components/schemas/ProductEntity"}},"required":["id","enterpriseId","productId","activeFrom","createdAt","updatedAt"]},"EnterpriseEntity":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"displayName":{"type":"string"},"orgNumber":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string"},"invoiceEmail":{"type":"string"},"iconStorageKey":{"type":"string"},"consolidatedBilling":{"type":"boolean"},"billingAnchorDay":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"poCustomerId":{"type":"string"},"iconUrl":{"type":"string"},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationEntity"}},"enterpriseAccounts":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}},"enterpriseProducts":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseProductEntity"}}},"required":["id","legalName","displayName","consolidatedBilling","billingAnchorDay","createdAt","updatedAt"]},"OrganizationCommentEntity":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"authorId":{"type":"string"},"content":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"author":{"$ref":"#/components/schemas/UserEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"}},"required":["id","organizationId","authorId","content","createdAt","updatedAt"]},"OrganizationEntity":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"displayName":{"type":"string"},"departmentDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized department labels keyed by locale, with singular and plural forms per locale."},"projectDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized project labels keyed by locale, with singular and plural forms per locale."},"handle":{"type":"string"},"isCategoryRequired":{"type":"boolean","default":false,"deprecated":true,"description":"Deprecated — the server requires a category on submit regardless of this flag; it is read-only and will be removed in a future release."},"isDepartmentRequired":{"type":"boolean"},"isProjectRequired":{"type":"boolean"},"collectAccountNumber":{"type":"boolean"},"invoiceEmail":{"type":"string"},"orgNumber":{"type":"string"},"invoiceSellerOrgNumber":{"type":"string"},"invoiceSellerLegalName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string"},"isVatRegistered":{"type":"boolean"},"invoiceAsEhf":{"type":"boolean"},"iconStorageKey":{"type":"string"},"paymentTerms":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"isApprovalFlowActive":{"type":"boolean"},"isTravelActive":{"type":"boolean"},"isTravelRequestActive":{"type":"boolean"},"isDriveActive":{"type":"boolean"},"isPersonal":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"isAltCategoriesEnabled":{"type":"boolean"},"useFlowBasedReviews":{"type":"boolean"},"amendPolicy":{"type":"object","additionalProperties":true,"nullable":true},"poCustomerId":{"type":"string"},"driveTaxFreeAccountingCode":{"type":"string"},"driveTaxableAccountingCode":{"type":"string"},"tollAccountingCode":{"type":"string"},"passengerAccountingCode":{"type":"string"},"driveTrailerAccountingCode":{"type":"string"},"driveOffroadAccountingCode":{"type":"string"},"perDiemTaxFreeAccountingCode":{"type":"string"},"perDiemTaxFreeNoOvernightAccountingCode":{"type":"string"},"perDiemTaxFreeHotelAccountingCode":{"type":"string"},"perDiemTaxFreeWithCookingAccountingCode":{"type":"string"},"perDiemTaxFreeWithoutCookingAccountingCode":{"type":"string"},"perDiemTaxableAccountingCode":{"type":"string"},"perDiemAbroadCompensationAccountingCode":{"type":"string"},"travelRateLevel":{"$ref":"#/components/schemas/OrganizationTravelRateLevel"},"driveRateLevel":{"$ref":"#/components/schemas/OrganizationDriveRateLevel"},"perDiemAbroadCompensation":{"type":"boolean"},"notes":{"type":"string"},"enterpriseId":{"type":"string"},"fingerprintEnabled":{"type":"boolean"},"isAgentEnabled":{"type":"boolean"},"apiProvisioningEnabled":{"type":"boolean"},"baseCurrency":{"type":"string"},"inboxEmailTemplate":{"type":"string"},"inboxLockForcedAt":{"format":"date-time","type":"string"},"iconUrl":{"type":"string"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryEntity"}},"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceEntity"}},"subscription":{"$ref":"#/components/schemas/SubscriptionEntity"},"usage":{"$ref":"#/components/schemas/Usage"},"usageStatistics":{"type":"array","items":{"$ref":"#/components/schemas/UsageStatistic"}},"monthlyUsage":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMonthlyUsage"}},"rates":{"type":"array","items":{"$ref":"#/components/schemas/RateEntity"}},"invitations":{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},"couponCodes":{"type":"array","items":{"$ref":"#/components/schemas/CouponCodeEntity"}},"communications":{"type":"array","items":{"$ref":"#/components/schemas/CommunicationEntity"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectEntity"}},"authProvider":{"$ref":"#/components/schemas/OrganizationAuthProvider"},"serviceAccounts":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAccountEntity"}},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEntity"}},"RateAbroad":{"type":"array","items":{"$ref":"#/components/schemas/RateAbroad"}},"inboxItems":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemEntity"}},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"},"comments":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationCommentEntity"}}},"required":["id","displayName","handle","isDepartmentRequired","isProjectRequired","collectAccountNumber","isVatRegistered","invoiceAsEhf","paymentTerms","createdAt","updatedAt","isApprovalFlowActive","isTravelActive","isTravelRequestActive","isDriveActive","isPersonal","isOnboardingCompleted","isAltCategoriesEnabled","useFlowBasedReviews","travelRateLevel","driveRateLevel","perDiemAbroadCompensation","fingerprintEnabled","isAgentEnabled","apiProvisioningEnabled","baseCurrency"]},"SlackInstallation":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"teamName":{"type":"string"},"userId":{"type":"string"},"botToken":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"accountId":{"type":"string"}},"required":["id","teamId","teamName","userId","botToken","createdAt","updatedAt","accountId"]},"AccountNotificationConfiguration":{"type":"object","properties":{"id":{"type":"string"},"mutedChannels":{"type":"string"},"invitationAccepted":{"type":"string"},"reportSubmitted":{"type":"string"},"reportApproved":{"type":"string"},"reportAmended":{"type":"string"},"reportRejected":{"type":"string"},"subscriptionUpdates":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"accountId":{"type":"string"}},"required":["id","createdAt","updatedAt","accountId"]},"ProjectAssignment":{"type":"object","properties":{"accountId":{"type":"string"},"projectId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["accountId","projectId","organizationId","role","createdAt","updatedAt"]},"AccountEntity":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"number"},"digest":{"type":"number"},"isNotificationsEnabled":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"isBlocked":{"type":"boolean","description":"Redeclared optional in the published schema, as before the column became\nNOT NULL: generated clients decode strictly, and responses built from a\nnarrowed select do not always carry it. The runtime value is never null."},"deletedAt":{"format":"date-time","type":"string"},"email":{"type":"string"},"accountNumber":{"type":"string"},"employeeNumber":{"type":"string"},"externalId":{"type":"string"},"externalIdSource":{"$ref":"#/components/schemas/ExternalIdSource"},"billingType":{"$ref":"#/components/schemas/AccountBillingType"},"baseCurrency":{"type":"string","nullable":true,"description":"ISO 4217 base currency; null inherits the organization's base currency"},"user":{"$ref":"#/components/schemas/UserEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"slackInstallation":{"$ref":"#/components/schemas/SlackInstallation"},"notificationConfiguration":{"$ref":"#/components/schemas/AccountNotificationConfiguration"},"departmentAssignments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentAssignmentEntity"}},"projectAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ProjectAssignment"}},"communications":{"type":"array","items":{"$ref":"#/components/schemas/CommunicationEntity"}},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEntity"}},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"subordinateAccounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"managerAccounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}}},"required":["id","role","digest","isNotificationsEnabled","createdAt","updatedAt"]},"RefreshTokenEntity":{"type":"object","properties":{"id":{"type":"number"},"tokenId":{"type":"string"},"tokenHash":{"type":"string"},"tokenFingerprint":{"type":"string"},"expires":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"createdByIp":{"type":"string"},"revoked":{"format":"date-time","type":"string"},"revokedByIp":{"type":"string"},"replacedByTokenId":{"type":"string"},"userId":{"type":"string"},"oauthGrantId":{"type":"string"},"installationId":{"type":"string"},"user":{"$ref":"#/components/schemas/UserEntity"}},"required":["id","tokenId","tokenHash","expires","created","userId"]},"PushPlatform":{"type":"string","enum":["APNS","FCM"]},"PushTokenEntity":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"platform":{"$ref":"#/components/schemas/PushPlatform"},"userId":{"type":"string"},"installationId":{"type":"string"},"user":{"$ref":"#/components/schemas/UserEntity"}},"required":["id","platform","userId"]},"LoginMethod":{"type":"object","properties":{"id":{"type":"number"},"provider":{"$ref":"#/components/schemas/LoginProvider"},"externalId":{"type":"string"},"userId":{"type":"string"},"lastUsed":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","provider","externalId","createdAt"]},"PersonalAccessToken":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tokenHash":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"userId":{"type":"string"}},"required":["id","tokenHash","expiresAt","createdAt","userId"]},"UserNotificationConfiguration":{"type":"object","properties":{"id":{"type":"string"},"mutedChannels":{"type":"string"},"inboxItemCreated":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"userId":{"type":"string"}},"required":["id","createdAt","updatedAt","userId"]},"Chat":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"userId":{"type":"string"}},"required":["id","title","createdAt","updatedAt","userId"]},"UserEntity":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"number"},"email":{"type":"string"},"phoneNumber":{"type":"string"},"givenName":{"type":"string"},"familyName":{"type":"string"},"fullName":{"type":"string"},"streetAddress":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"birthdate":{"format":"date-time","type":"string"},"accountNumber":{"type":"string"},"profilePictureStorageKey":{"type":"string"},"isNotificationsEnabled":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"isNewsletterConsentGiven":{"type":"boolean"},"isCustomMarketingConsentGiven":{"type":"boolean"},"isBlocked":{"type":"boolean","description":"Redeclared optional in the published schema, as before the column became\nNOT NULL: generated clients decode strictly, and responses built from a\nnarrowed select do not always carry it. The runtime value is never null."},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"profilePictureUrl":{"type":"string"},"intercomWebHash":{"type":"string"},"intercomIosHash":{"type":"string"},"intercomAndroidHash":{"type":"string"},"sessionToken":{"type":"string"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"enterpriseAccounts":{"type":"array","items":{"$ref":"#/components/schemas/EnterpriseAccountEntity"}},"refreshTokens":{"type":"array","items":{"$ref":"#/components/schemas/RefreshTokenEntity"}},"pushTokens":{"type":"array","items":{"$ref":"#/components/schemas/PushTokenEntity"}},"paymentCards":{"type":"array","items":{"$ref":"#/components/schemas/PaymentCard"}},"invitationsCreated":{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},"invitationsRevoked":{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},"communications":{"type":"array","items":{"$ref":"#/components/schemas/CommunicationEntity"}},"loginMethods":{"type":"array","items":{"$ref":"#/components/schemas/LoginMethod"}},"personalAccessTokens":{"type":"array","items":{"$ref":"#/components/schemas/PersonalAccessToken"}},"notificationConfiguration":{"$ref":"#/components/schemas/UserNotificationConfiguration"},"chats":{"type":"array","items":{"$ref":"#/components/schemas/Chat"}},"inbox":{"$ref":"#/components/schemas/InboxEntity"}},"required":["id","role","isNotificationsEnabled","isOnboardingCompleted","isNewsletterConsentGiven","isCustomMarketingConsentGiven","createdAt","updatedAt"]},"PersonalAccessTokenResponseDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"userId":{"type":"string"},"user":{"$ref":"#/components/schemas/UserEntity"}},"required":["id","expiresAt","createdAt","userId"]},"Address":{"type":"object","properties":{"streetAddress":{"type":"string"},"region":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"CreateUserDto":{"type":"object","properties":{"vippsId":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"birthdate":{"format":"date-time","type":"string"},"givenName":{"type":"string"},"familyName":{"type":"string"},"phoneNumber":{"type":"string"},"email":{"type":"string","format":"email"},"accountNumber":{"type":"string"}}},"UpdateUserNotificationConfigurationDto":{"type":"object","properties":{"mutedChannels":{"type":"string"},"id":{"type":"string"},"inboxItemCreated":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"userId":{"type":"string"}}},"UpdateUserDto":{"type":"object","properties":{"resetTokenExpires":{"format":"date-time","type":"string"},"resetToken":{"type":"string"},"streetAddress":{"type":"string"},"region":{"type":"string"},"postalCode":{"type":"string"},"isCustomMarketingConsentGiven":{"type":"boolean"},"isNotificationsEnabled":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"isNewsletterConsentGiven":{"type":"boolean"},"lastLogin":{"format":"date-time","type":"string"},"notificationConfiguration":{"$ref":"#/components/schemas/UpdateUserNotificationConfigurationDto"},"accountNumber":{"type":"string"},"email":{"type":"string","format":"email"},"givenName":{"type":"string"},"familyName":{"type":"string"}}},"UpdateUserRoleDto":{"type":"object","properties":{"role":{"type":"number","enum":[0,1,2,3,4]}},"required":["role"]},"AddPaymentCardDto":{"type":"object","properties":{"cardType":{"$ref":"#/components/schemas/PaymentCardType"},"last4":{"type":"string"},"brand":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"organizationId":{"type":"string","nullable":true}},"required":["cardType","last4","brand","description","isDefault","organizationId"]},"UpdatePaymentCardDto":{"type":"object","properties":{"cardType":{"$ref":"#/components/schemas/PaymentCardType"},"last4":{"type":"string"},"brand":{"type":"string"},"description":{"type":"string"},"isDefault":{"type":"boolean"},"organizationId":{"type":"string","nullable":true}}},"AddPushTokenDto":{"type":"object","properties":{"platform":{"$ref":"#/components/schemas/PushPlatform"},"installationId":{"type":"string","format":"uuid","description":"The device installation this push token was registered from."},"token":{"type":"string"}},"required":["platform","token"]},"CreateInboxDto":{"type":"object","properties":{"organizationId":{"type":"string","description":"Create an org-locked inbox for this organization"},"userId":{"type":"string"},"email":{"type":"string"}},"required":["userId"]},"UpdateInboxDto":{"type":"object","properties":{"email":{"type":"string"}}},"InboxAvailableResponse":{"type":"object","properties":{"available":{"type":"boolean"}},"required":["available"]},"MyInboxesResponse":{"type":"object","properties":{"inboxes":{"type":"array","items":{"$ref":"#/components/schemas/InboxEntity"}},"canCreatePersonalInbox":{"type":"boolean"}},"required":["inboxes","canCreatePersonalInbox"]},"AddInboxItemDto":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InboxItemStatus"},"organizationId":{"type":"string","nullable":true,"description":"Organization to tag the item with; null clears the tag. Ignored on organization-locked inboxes (the item is always stamped with the inbox organization); on personal inboxes it must be an organization the inbox owner is a member of."},"expenseId":{"type":"string","nullable":true,"description":"Expense to link the item to; must belong to the inbox owner. The literal string 'NULL' (or null) unlinks."},"from":{"type":"string"},"amount":{"type":"integer","format":"int64"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"merchant":{"type":"string"},"description":{"type":"string"},"reservationId":{"type":"string"}}},"UpdateInboxItemDto":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InboxItemStatus"},"organizationId":{"type":"string","nullable":true,"description":"Organization to tag the item with; null clears the tag. Ignored on organization-locked inboxes (the item is always stamped with the inbox organization); on personal inboxes it must be an organization the inbox owner is a member of."},"expenseId":{"type":"string","nullable":true,"description":"Expense to link the item to; must belong to the inbox owner. The literal string 'NULL' (or null) unlinks."},"from":{"type":"string"},"amount":{"type":"integer","format":"int64"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"merchant":{"type":"string"},"description":{"type":"string"},"reservationId":{"type":"string"}}},"DevicePlatform":{"type":"string","enum":["IOS","ANDROID","WEB","OTHER"]},"DeviceResponseDto":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"installationId":{"type":"string"},"platform":{"$ref":"#/components/schemas/DevicePlatform"},"appVersion":{"type":"string"},"appBuild":{"type":"string"},"osVersion":{"type":"string"},"deviceModel":{"type":"string"},"firstSeenAt":{"format":"date-time","type":"string"},"lastSeenAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"pushEnabled":{"type":"boolean","description":"True when a push-notification token is registered for this exact (userId, installationId). Requires both a device row and a push-token row — a stray token under another user on the same install does not flip it."},"isSignedIn":{"type":"boolean","description":"True when the device row is not soft-revoked AND at least one unrevoked, unexpired refresh token exists for this (userId, installationId). False after DELETE /users/current/devices/:installationId until the user signs in again from that install."}},"required":["id","userId","installationId","platform","firstSeenAt","lastSeenAt","pushEnabled","isSignedIn"]},"ProvisionDepartmentAssignmentDto":{"type":"object","properties":{"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"integer","minimum":0,"maximum":4}},"required":["departmentId"]},"ProvisionAccountDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"phoneNumber":{"type":"string","nullable":true},"givenName":{"type":"string","nullable":true},"familyName":{"type":"string","nullable":true},"streetAddress":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"birthdate":{"format":"date-time","type":"string","nullable":true},"userAccountNumber":{"type":"string","nullable":true},"role":{"type":"integer","minimum":0,"maximum":4},"accountEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"accountNumber":{"type":"string","nullable":true},"employeeNumber":{"type":"string","maxLength":20,"pattern":"^[a-zA-Z0-9-]*$","nullable":true},"externalId":{"type":"string","maxLength":64,"nullable":true},"digest":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isNotificationsEnabled":{"type":"boolean"},"billingType":{"$ref":"#/components/schemas/AccountBillingType"},"managerAccountIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"departmentAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ProvisionDepartmentAssignmentDto"}}},"required":["organizationId"]},"CreateAccountDto":{"type":"object","properties":{"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"number","enum":[0,1,2,3]},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"accountNumber":{"type":"string","nullable":true},"digest":{"type":"number"},"isNotificationsEnabled":{"type":"boolean"},"employeeNumber":{"type":"string","nullable":true},"externalId":{"type":"string","maxLength":64,"nullable":true},"billingType":{"$ref":"#/components/schemas/AccountBillingType","nullable":true}},"required":["userId","organizationId"]},"UpdateAccountNotificationConfigurationDto":{"type":"object","properties":{"mutedChannels":{"type":"string","nullable":true},"invitationAccepted":{"type":"string","nullable":true},"reportSubmitted":{"type":"string","nullable":true},"reportApproved":{"type":"string","nullable":true},"reportAmended":{"type":"string","nullable":true},"reportRejected":{"type":"string","nullable":true},"subscriptionUpdates":{"type":"string","nullable":true}}},"UpdateAccountDto":{"type":"object","properties":{"role":{"type":"number","enum":[0,1,2,3]},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"accountNumber":{"type":"string","nullable":true},"digest":{"type":"number"},"isNotificationsEnabled":{"type":"boolean"},"employeeNumber":{"type":"string","nullable":true},"externalId":{"type":"string","maxLength":64,"nullable":true},"billingType":{"$ref":"#/components/schemas/AccountBillingType","nullable":true},"baseCurrency":{"type":"string","enum":["NOK","SEK","DKK","EUR","USD","GBP","CHF","ISK","PLN","CZK",null],"description":"ISO 4217 base currency; null inherits the organization's base currency","nullable":true},"notificationConfiguration":{"allOf":[{"$ref":"#/components/schemas/UpdateAccountNotificationConfigurationDto"}],"nullable":true}}},"UpdatedAccountEntity":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"number"},"digest":{"type":"number"},"isNotificationsEnabled":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"isBlocked":{"type":"boolean","description":"Redeclared optional in the published schema, as before the column became\nNOT NULL: generated clients decode strictly, and responses built from a\nnarrowed select do not always carry it. The runtime value is never null."},"deletedAt":{"format":"date-time","type":"string"},"email":{"type":"string"},"accountNumber":{"type":"string"},"employeeNumber":{"type":"string"},"externalId":{"type":"string"},"externalIdSource":{"$ref":"#/components/schemas/ExternalIdSource"},"billingType":{"$ref":"#/components/schemas/AccountBillingType"},"baseCurrency":{"type":"string","nullable":true,"description":"ISO 4217 base currency; null inherits the organization's base currency"},"staleReportCount":{"type":"number","description":"Still-editable reports left on the previous currency by this update"},"strandedWalletCount":{"type":"number","description":"Active wallets left on the previous currency, which reports created from now on cannot draw on"},"user":{"$ref":"#/components/schemas/UserEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"slackInstallation":{"$ref":"#/components/schemas/SlackInstallation"},"notificationConfiguration":{"$ref":"#/components/schemas/AccountNotificationConfiguration"},"departmentAssignments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentAssignmentEntity"}},"projectAssignments":{"type":"array","items":{"$ref":"#/components/schemas/ProjectAssignment"}},"communications":{"type":"array","items":{"$ref":"#/components/schemas/CommunicationEntity"}},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEntity"}},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"subordinateAccounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"managerAccounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}}},"required":["id","role","digest","isNotificationsEnabled","createdAt","updatedAt"]},"AssignAccountSubordinatesDto":{"type":"object","properties":{"subordinateAccountIds":{"type":"array","items":{"type":"string"}}},"required":["subordinateAccountIds"]},"NotifyAccountDto":{"type":"object","properties":{"channels":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/CommunicationChannel"}},"subject":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"accountId":{"type":"string","minLength":1}},"required":["channels","subject","text","accountId"]},"EntitlementKeyType":{"type":"string","enum":["access","limit"]},"EntitlementKeyDto":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/EntitlementKeyType"},"key":{"type":"string"}},"required":["type","key"]},"Actor":{"type":"string","enum":["SYSTEM","USER","SERVICE_ACCOUNT"]},"EventSubjectType":{"type":"string","enum":["ACCOUNT","CATEGORY","DEPARTMENT","EXPENSE","DRIVE","PER_DIEM","ORGANIZATION","PROJECT","INVOICE","RATE","RATE_ABROAD","REPORT","USER","SUBSCRIPTION","SUBSCRIPTIONTIER","SUBSCRIPTIONTIERPRICE","TRAVEL","ATTACHMENT","ENTERPRISE","FINGERPRINT_MATCH","ENTITLEMENT","DUPLICATE_GROUP","FINDING","CHECK_POLICY","WALLET","PRODUCT","DIET_SCHEME","ORGANIZATION_DIET_SCHEME"]},"EventType":{"type":"string","enum":["CREATED","UPDATED","DELETED"]},"History":{"type":"object","properties":{"authorType":{"$ref":"#/components/schemas/Actor"},"entryPoint":{"type":"string","nullable":true,"description":"How the change was made — the route or agent tool behind it."},"eventSubjectType":{"$ref":"#/components/schemas/EventSubjectType"},"eventType":{"$ref":"#/components/schemas/EventType"},"id":{"type":"number"},"state":{"type":"object"},"eventSubjectId":{"type":"string"},"authorId":{"type":"string"},"organizationId":{"type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"}},"required":["authorType","eventSubjectType","eventType","id","state","eventSubjectId","authorId","organizationId","createdAt"]},"CaptureRequestCategoryDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"context":{"type":"string"},"description":{"type":"string"}},"required":["id","title"]},"CaptureRequestDto":{"type":"object","properties":{"ocr":{"type":"string"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CaptureRequestCategoryDto"}},"correlationId":{"type":"string"},"deviceTimeZone":{"type":"string"}},"required":["ocr"]},"ExpenseCaptureResponseDto":{"type":"object","properties":{"date":{"type":"string","description":"Transaction date as a true UTC instant. For timed receipts the OCR local\nwall-clock is converted to UTC in `dateTimeZone`; date-only receipts stay at\nUTC midnight of the calendar day (`dateHasTime: false`).","format":"date-time"},"dateTimeZone":{"type":"string","description":"IANA timezone the date is anchored to (e.g. Europe/Oslo)."},"dateTimeZoneSource":{"description":"How `dateTimeZone` was resolved (device / merchant-geocode / user / org default).","$ref":"#/components/schemas/DateTimeZoneSource"},"dateHasTime":{"type":"boolean","description":"Whether `date` carries a real time-of-day (vs a date-only receipt)."},"captureRef":{"type":"string","description":"Opaque single-use handle for the instant-scan handoff: pass it as\n`captureRef` on the attachment upload to adopt this scan (no second\nextraction). Minted only for authenticated scans; expires after 24h or on\nfirst use. LAST property on purpose — generated clients with positional\ninitializers gain a trailing optional arg instead of a leading one.","format":"uuid"},"invoiceDetected":{"type":"boolean","description":"Existing Capture invoice signal; absent when classification is unavailable."},"merchant":{"type":"string"},"amount":{"type":"number"},"amountIncludingVat":{"type":"number"},"amountExcludingVat":{"type":"number"},"vatAmount":{"type":"number"},"vatRate":{"type":"number"},"currency":{"type":"string"},"description":{"type":"string"},"categoryId":{"type":"string"}}},"AccommodationCaptureResponseDto":{"type":"object","properties":{"date":{"type":"string","nullable":true,"format":"date-time"},"checkInAt":{"type":"string","nullable":true,"format":"date-time","description":"Explicit hotel check-in date; null when not stated."},"checkOutAt":{"type":"string","nullable":true,"format":"date-time","description":"Explicit hotel check-out date, not the last billed night."},"transactionDate":{"type":"string","nullable":true,"format":"date-time","description":"Invoice issue or receipt transaction date, separate from the stay."},"invoiceDetected":{"type":"boolean","description":"Existing Capture invoice signal; absent when classification is unavailable."},"documentAmountIncludingVat":{"type":"number","nullable":true},"accommodationReview":{"type":"object"},"merchant":{"type":"string","nullable":true},"issuer":{"type":"string","nullable":true,"description":"The party that issued the document when it is not the hotel — a travel\nagency invoice covering a stay and a flight. Null on an ordinary hotel\ndocument, where `merchant` is already the invoicing party."},"amountIncludingVat":{"type":"number","nullable":true},"amountExcludingVat":{"type":"number","nullable":true},"vatAmount":{"type":"number","nullable":true},"vatRate":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"breakfastAmount":{"type":"number","nullable":true},"accommodationType":{"type":"string","nullable":true}},"required":["merchant","issuer","amountIncludingVat","amountExcludingVat","vatAmount","vatRate","currency","description","breakfastAmount","accommodationType"]},"CaptureResourceType":{"type":"string","enum":["image","pdf"]},"CaptureOcrRequestDto":{"type":"object","properties":{"resourceUrl":{"type":"string","minLength":1},"resourceType":{"$ref":"#/components/schemas/CaptureResourceType"}},"required":["resourceUrl","resourceType"]},"ExpenseCaptureRequestDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The expense this scan is for. Client-minted; the row may not exist yet. The returned captureRef adopts onto this expense and no other."},"ocr":{"type":"string","maxLength":100000},"deviceTimeZone":{"type":"string","description":"IANA timezone of the capturing device (e.g. Europe/Oslo). Used to resolve the receipt date to a true UTC instant."}},"required":["organizationId","expenseId","ocr"]},"CreateOrganizationDto":{"type":"object","properties":{"departmentDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized department labels keyed by locale, with singular and plural forms per locale."},"projectDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized project labels keyed by locale, with singular and plural forms per locale."},"legalName":{"type":"string"},"displayName":{"type":"string"},"handle":{"type":"string"},"orgNumber":{"type":"string"},"invoiceSellerOrgNumber":{"type":"string","nullable":true},"invoiceSellerLegalName":{"type":"string","nullable":true},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"invoiceEmail":{"type":"string","nullable":true,"format":"email"},"trial":{"type":"boolean"},"cancelAtPeriodEnd":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string","format":"email"},"poCustomerId":{"type":"string"},"perDiemTaxFreeAccountingCode":{"type":"string"},"perDiemTaxFreeNoOvernightAccountingCode":{"type":"string"},"perDiemTaxFreeHotelAccountingCode":{"type":"string"},"perDiemTaxFreeWithCookingAccountingCode":{"type":"string"},"perDiemTaxFreeWithoutCookingAccountingCode":{"type":"string"},"perDiemTaxableAccountingCode":{"type":"string"},"enterpriseId":{"type":"string"},"affiliateCode":{"type":"string","description":"Affiliate referral code. Picked up from the `ua_aff` cookie on the\nweb client OR typed manually in the OrganizationSearch step. The API\nvalidates it BEFORE creating the org (so an invalid code is a 4xx and\nno org row is written), then attaches it inside the\norg+subscription post-create flow via AffiliateAttributionService."}},"required":["legalName","displayName"]},"ResolvedAccessEntitlement":{"type":"object","properties":{"type":{"type":"string","enum":["access"]},"allowed":{"type":"boolean"}},"required":["type","allowed"]},"ResolvedLimitEntitlement":{"type":"object","properties":{"type":{"type":"string","enum":["limit"]},"limit":{"type":"number"}},"required":["type","limit"]},"AuthProviderDiscoveryHealthDto":{"type":"object","properties":{"ok":{"type":"boolean"},"latencyMs":{"type":"number","minimum":0},"error":{"type":"string"}},"required":["ok","latencyMs"]},"AuthProviderJwksHealthDto":{"type":"object","properties":{"ok":{"type":"boolean"},"latencyMs":{"type":"number","minimum":0},"error":{"type":"string"},"keyCount":{"type":"number","minimum":0}},"required":["ok","latencyMs","keyCount"]},"AuthProviderHealthDto":{"type":"object","properties":{"organizationId":{"type":"string"},"kind":{"type":"string","enum":["OIDC"],"description":"The operator-managed provider kind probed by this endpoint."},"issuer":{"type":"string"},"clientId":{"type":"string"},"tokenEndpointAuthMethod":{"type":"string","enum":["client_secret_post","none"]},"redirectUri":{"type":"string"},"discovery":{"$ref":"#/components/schemas/AuthProviderDiscoveryHealthDto"},"jwks":{"$ref":"#/components/schemas/AuthProviderJwksHealthDto"},"authorizationEndpoint":{"type":"string"},"codeChallengeMethodsSupported":{"type":"array","items":{"type":"string"}},"lastCheckedAt":{"type":"string","format":"date-time"}},"required":["organizationId","kind","issuer","clientId","tokenEndpointAuthMethod","redirectUri","discovery","jwks","lastCheckedAt"]},"UpsertOrganizationAuthProviderDto":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/LoginProvider"},"domain":{"type":"string","pattern":"/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/","example":"example.com"},"isEnabled":{"type":"boolean"},"createOnLogin":{"type":"boolean","description":"When false, SSO login is reserved to already-provisioned members and an\nunknown user on this domain is rejected instead of JIT-created. Optional —\ndefaults to true (behavior-preserving) so existing PATCH calls don't 400.\nAt most one enabled createOnLogin=true provider may exist per domain.","default":true},"entraTenantId":{"type":"string","description":"The Entra directory (tid) this provider is bound to. When set, logins whose\ntoken tid differs are rejected (cross-tenant lock). Usually resolved from\nthe domain via Microsoft discovery rather than entered by hand.","format":"uuid","example":"00000000-0000-0000-0000-000000000000"}},"required":["provider","domain","isEnabled"]},"OrganizationAuthProviderDto":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/LoginProvider"},"kind":{"description":"Who owns this row. ENTRA_COMMON is org-admin editable through these endpoints; OIDC is operator-managed and every write endpoint here refuses it (disable with isEnabled).","$ref":"#/components/schemas/OrgAuthProviderKind"},"domain":{"type":"string","nullable":true,"description":"The SSO email domain, or null for an operator-managed OIDC provider — those are keyed by issuer/clientId and their stored domain is a reserved placeholder, not a real domain."},"isEnabled":{"type":"boolean"},"createOnLogin":{"type":"boolean","description":"When false, SSO login is reserved to already-provisioned members."},"entraTenantId":{"type":"string","nullable":true,"description":"Bound Entra directory (tid), or null when unbound."}},"required":["provider","kind","domain","isEnabled","createOnLogin","entraTenantId"]},"UpdateOrganizationDto":{"type":"object","properties":{"departmentDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized department labels keyed by locale, with singular and plural forms per locale."},"projectDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized project labels keyed by locale, with singular and plural forms per locale."},"baseCurrency":{"type":"string","enum":["NOK","SEK","DKK","EUR","USD","GBP","CHF","ISK","PLN","CZK"],"description":"ISO 4217 base currency for inheriting accounts"},"inboxLockForced":{"type":"boolean","description":"Org-wide inbox-lock force policy; enabling is entitlement-gated"},"travelRateLevel":{"$ref":"#/components/schemas/OrganizationTravelRateLevel"},"driveRateLevel":{"$ref":"#/components/schemas/OrganizationDriveRateLevel"},"perDiemAbroadCompensation":{"type":"boolean","description":"Opt-in to kompensasjonstillegg utland (statens særavtale utenfor Norge § 12): a fixed, fully taxable supplement per døgn abroad on top of the kostgodtgjørelse. Off by default."},"perDiemAbroadCompensationAccountingCode":{"type":"string","nullable":true,"maxLength":20,"description":"Accounting code for the kompensasjonstillegg utland payroll line. Unset = booked under perDiemTaxableAccountingCode."},"amendPolicy":{"type":"object","additionalProperties":false,"description":"Tenant-specific narrowing of the report amend field tiers."},"invoiceAsEhf":{"type":"boolean"},"invoiceEmail":{"type":"string","nullable":true,"format":"email"},"paymentTerms":{"type":"number"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string","format":"email"},"isTravelActive":{"type":"boolean"},"isTravelRequestActive":{"type":"boolean"},"isDriveActive":{"type":"boolean"},"isApprovalFlowActive":{"type":"boolean"},"isDepartmentRequired":{"type":"boolean"},"isProjectRequired":{"type":"boolean"},"notes":{"type":"string"},"driveTaxFreeAccountingCode":{"type":"string"},"driveTaxableAccountingCode":{"type":"string"},"tollAccountingCode":{"type":"string"},"passengerAccountingCode":{"type":"string"},"driveTrailerAccountingCode":{"type":"string"},"driveOffroadAccountingCode":{"type":"string"},"perDiemTaxFreeAccountingCode":{"type":"string"},"perDiemTaxFreeNoOvernightAccountingCode":{"type":"string"},"perDiemTaxFreeHotelAccountingCode":{"type":"string"},"perDiemTaxFreeWithCookingAccountingCode":{"type":"string"},"perDiemTaxFreeWithoutCookingAccountingCode":{"type":"string"},"perDiemTaxableAccountingCode":{"type":"string"},"useFlowBasedReviews":{"type":"boolean"},"isAltCategoriesEnabled":{"type":"boolean"},"fingerprintEnabled":{"type":"boolean"},"collectAccountNumber":{"type":"boolean"},"inboxEmailTemplate":{"type":"string","nullable":true},"legalName":{"type":"string"},"displayName":{"type":"string"},"handle":{"type":"string"},"orgNumber":{"type":"string"},"invoiceSellerOrgNumber":{"type":"string","nullable":true},"invoiceSellerLegalName":{"type":"string","nullable":true},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"trial":{"type":"boolean"},"cancelAtPeriodEnd":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"poCustomerId":{"type":"string"},"enterpriseId":{"type":"string"},"affiliateCode":{"type":"string","description":"Affiliate referral code. Picked up from the `ua_aff` cookie on the\nweb client OR typed manually in the OrganizationSearch step. The API\nvalidates it BEFORE creating the org (so an invalid code is a 4xx and\nno org row is written), then attaches it inside the\norg+subscription post-create flow via AffiliateAttributionService."}}},"UpdatedOrganizationEntity":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"displayName":{"type":"string"},"departmentDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized department labels keyed by locale, with singular and plural forms per locale."},"projectDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized project labels keyed by locale, with singular and plural forms per locale."},"handle":{"type":"string"},"isCategoryRequired":{"type":"boolean","default":false,"deprecated":true,"description":"Deprecated — the server requires a category on submit regardless of this flag; it is read-only and will be removed in a future release."},"isDepartmentRequired":{"type":"boolean"},"isProjectRequired":{"type":"boolean"},"collectAccountNumber":{"type":"boolean"},"invoiceEmail":{"type":"string"},"orgNumber":{"type":"string"},"invoiceSellerOrgNumber":{"type":"string"},"invoiceSellerLegalName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string"},"isVatRegistered":{"type":"boolean"},"invoiceAsEhf":{"type":"boolean"},"iconStorageKey":{"type":"string"},"paymentTerms":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"isApprovalFlowActive":{"type":"boolean"},"isTravelActive":{"type":"boolean"},"isTravelRequestActive":{"type":"boolean"},"isDriveActive":{"type":"boolean"},"isPersonal":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"isAltCategoriesEnabled":{"type":"boolean"},"useFlowBasedReviews":{"type":"boolean"},"amendPolicy":{"type":"object","additionalProperties":true,"nullable":true},"poCustomerId":{"type":"string"},"driveTaxFreeAccountingCode":{"type":"string"},"driveTaxableAccountingCode":{"type":"string"},"tollAccountingCode":{"type":"string"},"passengerAccountingCode":{"type":"string"},"driveTrailerAccountingCode":{"type":"string"},"driveOffroadAccountingCode":{"type":"string"},"perDiemTaxFreeAccountingCode":{"type":"string"},"perDiemTaxFreeNoOvernightAccountingCode":{"type":"string"},"perDiemTaxFreeHotelAccountingCode":{"type":"string"},"perDiemTaxFreeWithCookingAccountingCode":{"type":"string"},"perDiemTaxFreeWithoutCookingAccountingCode":{"type":"string"},"perDiemTaxableAccountingCode":{"type":"string"},"perDiemAbroadCompensationAccountingCode":{"type":"string"},"travelRateLevel":{"$ref":"#/components/schemas/OrganizationTravelRateLevel"},"driveRateLevel":{"$ref":"#/components/schemas/OrganizationDriveRateLevel"},"perDiemAbroadCompensation":{"type":"boolean"},"notes":{"type":"string"},"enterpriseId":{"type":"string"},"fingerprintEnabled":{"type":"boolean"},"isAgentEnabled":{"type":"boolean"},"apiProvisioningEnabled":{"type":"boolean"},"baseCurrency":{"type":"string"},"inboxEmailTemplate":{"type":"string"},"inboxLockForcedAt":{"format":"date-time","type":"string"},"staleReportCount":{"type":"number","description":"Still-editable reports of inheriting accounts left on the previous currency"},"strandedWalletCount":{"type":"number","description":"Active wallets of inheriting accounts left on the previous currency, which reports created from now on cannot draw on"},"iconUrl":{"type":"string"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/AccountEntity"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryEntity"}},"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportEntity"}},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceEntity"}},"subscription":{"$ref":"#/components/schemas/SubscriptionEntity"},"usage":{"$ref":"#/components/schemas/Usage"},"usageStatistics":{"type":"array","items":{"$ref":"#/components/schemas/UsageStatistic"}},"monthlyUsage":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMonthlyUsage"}},"rates":{"type":"array","items":{"$ref":"#/components/schemas/RateEntity"}},"invitations":{"type":"array","items":{"$ref":"#/components/schemas/InvitationEntity"}},"couponCodes":{"type":"array","items":{"$ref":"#/components/schemas/CouponCodeEntity"}},"communications":{"type":"array","items":{"$ref":"#/components/schemas/CommunicationEntity"}},"projects":{"type":"array","items":{"$ref":"#/components/schemas/ProjectEntity"}},"authProvider":{"$ref":"#/components/schemas/OrganizationAuthProvider"},"serviceAccounts":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAccountEntity"}},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEntity"}},"RateAbroad":{"type":"array","items":{"$ref":"#/components/schemas/RateAbroad"}},"inboxItems":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemEntity"}},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"},"comments":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationCommentEntity"}}},"required":["id","displayName","handle","isDepartmentRequired","isProjectRequired","collectAccountNumber","isVatRegistered","invoiceAsEhf","paymentTerms","createdAt","updatedAt","isApprovalFlowActive","isTravelActive","isTravelRequestActive","isDriveActive","isPersonal","isOnboardingCompleted","isAltCategoriesEnabled","useFlowBasedReviews","travelRateLevel","driveRateLevel","perDiemAbroadCompensation","fingerprintEnabled","isAgentEnabled","apiProvisioningEnabled","baseCurrency"]},"AssignReportTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["templateId"]},"AssignTravelRequestTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["templateId"]},"CreateOrganizationCommentDto":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]},"UpdateOrganizationCommentDto":{"type":"object","properties":{"content":{"type":"string"}}},"CreateServiceAccountDto":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"number"}},"required":["name","role"]},"AssignableRoleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"description":"Permission keys granted by this role.","type":"array","items":{"type":"string"}}},"required":["id","name","permissions"]},"UpdateServiceAccountDto":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"number"}},"required":["name","role"]},"CreateServiceAccessTokenDto":{"type":"object","properties":{"expiresAt":{"format":"date-time","type":"string"},"name":{"type":"string"}}},"ServiceAccessTokenResponseDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"serviceAccountId":{"type":"string"},"serviceAccount":{"$ref":"#/components/schemas/ServiceAccountEntity"}},"required":["id","createdAt"]},"ServiceAccountRoleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string","enum":["GLOBAL","ORGANIZATION","ENTERPRISE","DEPARTMENT"]},"scopeId":{"type":"string"},"type":{"type":"string","enum":["SYSTEM","CUSTOM"]}},"required":["id","name","scope","scopeId","type"]},"ServiceAccountAccessDto":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAccountRoleDto"}},"permissions":{"type":"array","items":{"type":"string"}}},"required":["roles","permissions"]},"IntegrationEventType":{"type":"string","enum":["attachment.stored","invoice.created","invoice.error","account.joined","report.created","report.updated","report.deleted","report.submitted","report.claim.submitted","report.request.submitted","report.processed","report.policies-applied","report.approved","report.claim.approved","report.request.approved","report.amended","report.rejected","report.claim.rejected","report.request.rejected","report.stale","report.reviewed","report.claim.reviewed","report.request.reviewed","report.published","advance.granted","review.requested","review.completed","review.reassigned","review.overridden","review.invalidated","subscription.billing-period-reset","subscription.billing-period-ending","subscription.trial-period-ending","subscription.ending-soon","subscription.trial-started","subscription.canceled","subscription.reactivated","subscription.plan-switched","organization.created","organization.updated","organization.deleted","department.created","department.updated","department.deleted","expense.created","expense.updated","expense.deleted","drive.created","drive.updated","drive.deleted","project.created","project.updated","project.deleted","category.created","category.updated","category.deleted","service-account.created","service-account.updated","service-account.deleted","inbox-item.created","inbox.parse-no-attachments","inbox.parse-error","inbox.parse-no-inbox","invitation.created","invitation.accepted","enterprise-invitation.created","user.created","user.updated","user.deleted","principal.access-revoked","account.test-notification","pat.expiring","subscription-jobs.internal","fingerprint.duplicate-detected","fingerprint.integrity-issue","fingerprint.match-resolved","fingerprint.match-unresolved","finding.detected","finding.resolved","attachment.deleted","seat-ratchet.error","subscription-billing.customer-error","entitlement.changed","subscription-invoice.reconciliation-gap","subscription-invoice.dunning-escalation","billing-invariants.violation","subscription-payment-state.changed"]},"IntegrationEvent":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/IntegrationEventType"},"data":{"type":"object"}},"required":["type","data"]},"CreateIntegrationFromConfigDto":{"type":"object","properties":{"webhookUrl":{"type":"string"},"serviceAccountId":{"type":"string","nullable":true}},"required":["webhookUrl"]},"CreateIntegrationFromProviderDto":{"type":"object","properties":{"integrationProviderId":{"type":"string"},"setupFields":{"type":"array","items":{"$ref":"#/components/schemas/CreateIntegrationFromProviderSetupFieldDto"}}},"required":["integrationProviderId","setupFields"]},"CreateIntegrationFromProviderSetupFieldDto":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"object","nullable":false}},"required":["key","value"]},"CreateIntegrationDto":{"type":"object","properties":{"organizationId":{"type":"string"},"events":{"type":"string","nullable":true},"fromConfig":{"$ref":"#/components/schemas/CreateIntegrationFromConfigDto"},"fromProvider":{"$ref":"#/components/schemas/CreateIntegrationFromProviderDto"}},"required":["organizationId"]},"UpdateIntegrationDto":{"type":"object","properties":{"setupFields":{"type":"array","items":{"$ref":"#/components/schemas/CreateIntegrationFromProviderSetupFieldDto"}},"events":{"type":"array","items":{"type":"string"},"nullable":true}},"required":["setupFields"]},"IntegrationSetupFieldType":{"type":"string","enum":["STRING","NUMBER","BOOLEAN","SELECT","MULTISELECT","EMAIL_LIST","SCHEDULE","COLUMN_MAPPER","TEXTAREA"]},"IntegrationProviderSetupFieldEntity":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"type":{"$ref":"#/components/schemas/IntegrationSetupFieldType"},"label":{"type":"string"},"description":{"type":"string"},"default":{"type":"string"},"isRequired":{"type":"boolean"},"isHidden":{"type":"boolean"},"readOnly":{"type":"boolean"},"group":{"type":"string"},"order":{"type":"number"},"options":{"type":"string"},"placeholder":{"type":"string","description":"Placeholder text shown in empty inputs."},"visibleWhen":{"type":"string","description":"Conditional visibility expression `otherKey=value`. The field is only shown\nwhen the referenced field currently equals `value`."},"integrationProviderId":{"type":"string"}},"required":["id","key","type","label","isRequired","isHidden","readOnly"]},"IntegrationProviderEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"descriptionMarkdown":{"type":"string"},"createdBy":{"type":"string"},"docsUrl":{"type":"string"},"iconUrl":{"type":"string"},"tags":{"type":"string"},"events":{"type":"string"},"serviceAccountRole":{"type":"number"},"isPublic":{"type":"boolean","default":false},"baseUrl":{"type":"string"},"setupContext":{"type":"string"},"deleteContext":{"type":"string"},"setupUsesOnboarding":{"type":"boolean","default":false},"manualSyncEnabled":{"type":"boolean","default":false},"syncContext":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"setupFields":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationProviderSetupFieldEntity"}}},"required":["id","name","serviceAccountRole","isPublic","baseUrl","setupUsesOnboarding","manualSyncEnabled","createdAt","updatedAt"]},"CreateCategoryDto":{"type":"object","properties":{"title":{"type":"string"},"accountingCode":{"type":"string","nullable":true},"altAccountingCode":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"guidance":{"type":"string","nullable":true},"context":{"type":"string","nullable":true},"visibility":{"$ref":"#/components/schemas/CategoryVisibility"},"managedByIntegrationId":{"type":"string","nullable":true},"rateId":{"type":"string","nullable":true},"organizationId":{"type":"string"},"accommodationHotelOrganizationId":{"type":"string","nullable":true},"accommodationCookingOrganizationId":{"type":"string","nullable":true},"accommodationOtherOrganizationId":{"type":"string","nullable":true},"accommodationBreakfastOrganizationId":{"type":"string","nullable":true}},"required":["title","organizationId"]},"UpdateCategoryDto":{"type":"object","properties":{"title":{"type":"string"},"accountingCode":{"type":"string","nullable":true},"altAccountingCode":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"guidance":{"type":"string","nullable":true},"context":{"type":"string","nullable":true},"visibility":{"$ref":"#/components/schemas/CategoryVisibility"},"managedByIntegrationId":{"type":"string","nullable":true},"rateId":{"type":"string","nullable":true},"accommodationHotelOrganizationId":{"type":"string","nullable":true},"accommodationCookingOrganizationId":{"type":"string","nullable":true},"accommodationOtherOrganizationId":{"type":"string","nullable":true},"accommodationBreakfastOrganizationId":{"type":"string","nullable":true}}},"UpdateSubscriptionDto":{"type":"object","properties":{"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"priceUpdates":{"type":"object","description":"Required when changing recurringInterval. Maps subscription item IDs to new price IDs.","example":{"item-uuid-1":"price-uuid-1","item-uuid-2":"price-uuid-2"}},"cancelAtPeriodEnd":{"type":"boolean"},"autoInvoice":{"type":"boolean"},"muteNotifications":{"type":"boolean"},"billingPeriodStart":{"format":"date-time","type":"string"},"billingPeriodEnd":{"format":"date-time","type":"string"},"trialPeriodEnd":{"format":"date-time","type":"string"}}},"CreateSubscriptionDto":{"type":"object","properties":{"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"cancelAtPeriodEnd":{"type":"boolean"},"organizationId":{"type":"string"},"billingPeriodStart":{"format":"date-time","type":"string"},"billingDay":{"type":"number","description":"Civil day-of-month (1-31) to bill on. Defaults to the UTC day of\n`billingPeriodStart` (or today). The anchor is materialized at 00:00 UTC.","minimum":1,"maximum":31},"trial":{"type":"boolean"},"includeDefaultProducts":{"type":"boolean"},"muteNotifications":{"type":"boolean","description":"Suppress all billing-related notification emails for this subscription."},"autoInvoice":{"type":"boolean","description":"Whether to generate PowerOffice sales orders for this subscription."}},"required":["organizationId"]},"AddSubscriptionItemDto":{"type":"object","properties":{"priceId":{"type":"string"},"activeFrom":{"format":"date-time","type":"string"},"billableFrom":{"format":"date-time","type":"string"},"activeTo":{"format":"date-time","type":"string"}},"required":["priceId"]},"UpdateSubscriptionItemDto":{"type":"object","properties":{"priceId":{"type":"string"},"activeFrom":{"format":"date-time","type":"string"},"billableFrom":{"format":"date-time","type":"string"},"activeTo":{"format":"date-time","type":"string"}}},"ApplyCouponDto":{"type":"object","properties":{"couponId":{"type":"string"},"couponCodeId":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}},"required":["couponId"]},"ReactivateSubscriptionDto":{"type":"object","properties":{"couponCode":{"type":"string"}}},"SetTrialDto":{"type":"object","properties":{"days":{"type":"number","minimum":1}},"required":["days"]},"SwitchPlanDto":{"type":"object","properties":{"priceId":{"type":"string"}},"required":["priceId"]},"ForceSwitchPlanDto":{"type":"object","properties":{"priceId":{"type":"string"}},"required":["priceId"]},"CreateCouponDto":{"type":"object","properties":{"duration":{"$ref":"#/components/schemas/CouponDuration"},"appliesTo":{"description":"List of product ids the coupon applies to. If not provided, the coupon applies to all products.","type":"array","items":{"type":"string"}},"name":{"type":"string"},"durationInMonths":{"type":"number"},"percentOff":{"type":"number"},"expiresAt":{"format":"date-time","type":"string"}},"required":["duration","name","percentOff"]},"UpdateCouponDto":{"type":"object","properties":{"duration":{"$ref":"#/components/schemas/CouponDuration"},"appliesTo":{"description":"List of product ids the coupon applies to. If not provided, the coupon applies to all products.","type":"array","items":{"type":"string"}},"name":{"type":"string"},"durationInMonths":{"type":"number"},"percentOff":{"type":"number"},"expiresAt":{"format":"date-time","type":"string"}}},"AddProductsToCouponDto":{"type":"object","properties":{"productIds":{"type":"array","items":{"type":"string"}}}},"CreateCouponCodeDto":{"type":"object","properties":{"code":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"maxRedemptions":{"type":"number"},"firstTimeRedemptionOnly":{"type":"boolean"},"organizationId":{"type":"string"}},"required":["code"]},"UpdateCouponCodeDto":{"type":"object","properties":{"active":{"type":"boolean"}}},"CreateReportTemplateDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","minLength":1}},"required":["name","content"]},"UpdateReportTemplateDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"content":{"type":"string"}}},"PreviewExistingTemplateDto":{"type":"object","properties":{"reportType":{"$ref":"#/components/schemas/ReportType","nullable":true}}},"TestPdfTemplateDto":{"type":"object","properties":{"reportType":{"$ref":"#/components/schemas/ReportType"},"templateId":{"type":"string","nullable":true},"content":{"type":"string","nullable":true}},"required":["reportType"]},"PreviewDraftTemplateDto":{"type":"object","properties":{"reportType":{"$ref":"#/components/schemas/ReportType"},"content":{"type":"string"}},"required":["reportType","content"]},"CreateTravelRequestTemplateDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","minLength":1}},"required":["name","content"]},"UpdateTravelRequestTemplateDto":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"content":{"type":"string"}}},"TravelRequestFixtureName":{"type":"string","enum":["STANDARD","WITH_ADVANCE"]},"PreviewExistingTravelRequestTemplateDto":{"type":"object","properties":{"fixture":{"$ref":"#/components/schemas/TravelRequestFixtureName"}}},"TestPdfTravelRequestTemplateDto":{"type":"object","properties":{"fixture":{"$ref":"#/components/schemas/TravelRequestFixtureName"},"templateId":{"type":"string"},"content":{"type":"string"}}},"PreviewDraftTravelRequestTemplateDto":{"type":"object","properties":{"fixture":{"$ref":"#/components/schemas/TravelRequestFixtureName"},"content":{"type":"string"}},"required":["content"]},"AffiliateCommissionType":{"type":"string","enum":["RECURRING_PERCENT","FLAT_PER_CONVERSION"]},"CreateAffiliateDto":{"type":"object","properties":{"name":{"type":"string"},"contactEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"contactName":{"type":"string","nullable":true},"payoutDetails":{"type":"object","additionalProperties":{},"nullable":true},"active":{"type":"boolean"},"userId":{"type":"string","nullable":true},"organizationId":{"type":"string","nullable":true},"commissionType":{"$ref":"#/components/schemas/AffiliateCommissionType"},"commissionPercent":{"type":"integer","minimum":0,"maximum":100,"description":"Required when commissionType = RECURRING_PERCENT. 0-100.","nullable":true},"commissionFlatAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Required when commissionType = FLAT_PER_CONVERSION. Øre (NOK minor units) — same unit as the stored `Affiliate.commissionFlatAmount`; see src/subscriptions/subscription-money.ts.","nullable":true},"commissionDurationMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"null = forever. Months from firstPaidInvoiceAt; only used for RECURRING_PERCENT.","nullable":true}},"required":["name","commissionType"]},"UpdateAffiliateDto":{"type":"object","properties":{"name":{"type":"string"},"contactEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","nullable":true},"contactName":{"type":"string","nullable":true},"payoutDetails":{"type":"object","additionalProperties":{},"nullable":true},"active":{"type":"boolean"},"userId":{"type":"string","nullable":true},"organizationId":{"type":"string","nullable":true},"commissionType":{"$ref":"#/components/schemas/AffiliateCommissionType"},"commissionPercent":{"type":"integer","minimum":0,"maximum":100,"description":"Required when commissionType = RECURRING_PERCENT. 0-100.","nullable":true},"commissionFlatAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Required when commissionType = FLAT_PER_CONVERSION. Øre (NOK minor units) — same unit as the stored `Affiliate.commissionFlatAmount`; see src/subscriptions/subscription-money.ts.","nullable":true},"commissionDurationMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"null = forever. Months from firstPaidInvoiceAt; only used for RECURRING_PERCENT.","nullable":true}}},"CreateAffiliateLinkDto":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":64,"pattern":"^[a-z0-9-]+$","description":"Optional. Null = code-only link (no landing URL). Lower-case, dash-separated.","nullable":true},"redemptionCode":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[A-Z0-9-]+$","description":"Required. Upper-case, alphanumeric + dashes."},"sanitySubPageSlug":{"type":"string","maxLength":255,"description":"Optional. Sanity subPage slug to render at utleggsappen.no/<slug>. Must be null when slug is null (enforced server-side).","nullable":true},"active":{"type":"boolean"},"expiresAt":{"format":"date-time","type":"string","nullable":true},"couponId":{"type":"string"}},"required":["redemptionCode","couponId"]},"UpdateAffiliateLinkDto":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":64,"pattern":"^[a-z0-9-]+$","description":"Optional. Null = code-only link (no landing URL). Lower-case, dash-separated.","nullable":true},"redemptionCode":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[A-Z0-9-]+$","description":"Required. Upper-case, alphanumeric + dashes."},"sanitySubPageSlug":{"type":"string","maxLength":255,"description":"Optional. Sanity subPage slug to render at utleggsappen.no/<slug>. Must be null when slug is null (enforced server-side).","nullable":true},"active":{"type":"boolean"},"expiresAt":{"format":"date-time","type":"string","nullable":true},"couponId":{"type":"string"}}},"CreatePayoutDto":{"type":"object","properties":{"accrualIds":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Accruals being marked as paid. Their summed amount is the payout amount."},"paidAt":{"type":"string","format":"date-time"},"reference":{"type":"string","maxLength":255,"nullable":true}},"required":["accrualIds","paidAt"]},"AffiliateLinkPublicResponse":{"type":"object","properties":{"slug":{"type":"string","nullable":true},"affiliateLinkId":{"type":"string"},"code":{"type":"string"},"percentOff":{"type":"number"},"durationInMonths":{"type":"number","nullable":true},"durationLabel":{"type":"string"},"sanitySubPageSlug":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["slug","affiliateLinkId","code","percentOff","durationInMonths","durationLabel","sanitySubPageSlug","active"]},"ValidateAffiliateCodeDto":{"type":"object","properties":{"code":{"type":"string","minLength":3,"maxLength":64}},"required":["code"]},"AffiliateCodePreviewResponse":{"type":"object","properties":{"affiliateLinkId":{"type":"string"},"code":{"type":"string"},"percentOff":{"type":"number"},"durationInMonths":{"type":"number","nullable":true},"durationLabel":{"type":"string"},"sanitySubPageSlug":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["affiliateLinkId","code","percentOff","durationInMonths","durationLabel","sanitySubPageSlug","active"]},"CreateEnterpriseDto":{"type":"object","properties":{"displayName":{"type":"string"},"legalName":{"type":"string"},"orgNumber":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"invoiceEmail":{"type":"string","format":"email"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string","format":"email"},"poCustomerId":{"type":"string"},"consolidatedBilling":{"type":"boolean"},"billingAnchorDay":{"type":"number","minimum":1,"maximum":28}},"required":["displayName","legalName","orgNumber"]},"UpdateEnterpriseDto":{"type":"object","properties":{"displayName":{"type":"string"},"legalName":{"type":"string"},"orgNumber":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"invoiceEmail":{"type":"string","format":"email"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string","format":"email"},"poCustomerId":{"type":"string"},"consolidatedBilling":{"type":"boolean"},"billingAnchorDay":{"type":"number","minimum":1,"maximum":28}}},"CreateOrganizationInEnterpriseDto":{"type":"object","properties":{"departmentDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized department labels keyed by locale, with singular and plural forms per locale."},"projectDisplayNames":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":false,"required":["singular","plural"],"properties":{"singular":{"type":"string"},"plural":{"type":"string"}}},"example":{"nb":{"singular":"Avdeling","plural":"Avdelinger"},"en":{"singular":"Department","plural":"Departments"}},"description":"Localized project labels keyed by locale, with singular and plural forms per locale."},"legalName":{"type":"string"},"displayName":{"type":"string"},"handle":{"type":"string"},"orgNumber":{"type":"string"},"invoiceSellerOrgNumber":{"type":"string","nullable":true},"invoiceSellerLegalName":{"type":"string","nullable":true},"address":{"type":"string"},"postalCode":{"type":"string"},"region":{"type":"string"},"invoiceEmail":{"type":"string","nullable":true,"format":"email"},"trial":{"type":"boolean"},"cancelAtPeriodEnd":{"type":"boolean"},"isOnboardingCompleted":{"type":"boolean"},"contactPerson":{"type":"string"},"contactPersonEmail":{"type":"string","format":"email"},"poCustomerId":{"type":"string"},"perDiemTaxFreeAccountingCode":{"type":"string"},"perDiemTaxFreeNoOvernightAccountingCode":{"type":"string"},"perDiemTaxFreeHotelAccountingCode":{"type":"string"},"perDiemTaxFreeWithCookingAccountingCode":{"type":"string"},"perDiemTaxFreeWithoutCookingAccountingCode":{"type":"string"},"perDiemTaxableAccountingCode":{"type":"string"},"affiliateCode":{"type":"string","description":"Affiliate referral code. Picked up from the `ua_aff` cookie on the\nweb client OR typed manually in the OrganizationSearch step. The API\nvalidates it BEFORE creating the org (so an invalid code is a 4xx and\nno org row is written), then attaches it inside the\norg+subscription post-create flow via AffiliateAttributionService."}},"required":["legalName","displayName"]},"AddOrganizationToEnterpriseDto":{"type":"object","properties":{"applyEnterpriseCategories":{"type":"boolean"}}},"CreateEnterpriseProductDto":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"activeFrom":{"type":"string","nullable":true},"activeTo":{"type":"string","nullable":true},"memberPriceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Price that new organizations created under the enterprise are seeded with. Must be an active price of the product, which must be a PLAN; at most one active enterprise product may carry one. Platform operators only. null clears it.","nullable":true}},"required":["productId"]},"UpdateEnterpriseProductDto":{"type":"object","properties":{"memberPriceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Price that new organizations created under the enterprise are seeded with. Must be an active price of the product, which must be a PLAN; at most one active enterprise product may carry one. Platform operators only. null clears it.","nullable":true}}},"CreateEnterpriseAccountDto":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"number","enum":[0,1]}},"required":["userId","role"]},"UpdateEnterpriseAccountDto":{"type":"object","properties":{"role":{"type":"number","enum":[0,1]}},"required":["role"]},"EnterpriseCategoryEntity":{"type":"object","properties":{"id":{"type":"string"},"enterpriseId":{"type":"string"},"title":{"type":"string"},"accountingCode":{"type":"string"},"altAccountingCode":{"type":"string"},"description":{"type":"string"},"guidance":{"type":"string"},"context":{"type":"string"},"visibility":{"type":"string","enum":["VISIBLE","HIDDEN"]},"rateId":{"type":"string"},"autoPropagate":{"type":"boolean"},"isAccommodationHotel":{"type":"boolean"},"isAccommodationCooking":{"type":"boolean"},"isAccommodationOther":{"type":"boolean"},"isAccommodationBreakfast":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"}},"required":["id","enterpriseId","title","visibility","autoPropagate","isAccommodationHotel","isAccommodationCooking","isAccommodationOther","isAccommodationBreakfast","createdAt","updatedAt"]},"CreateEnterpriseCategoryDto":{"type":"object","properties":{"title":{"type":"string"},"accountingCode":{"type":"string"},"altAccountingCode":{"type":"string"},"description":{"type":"string"},"guidance":{"type":"string"},"context":{"type":"string"},"visibility":{"type":"object"},"rateId":{"type":"string"},"autoPropagate":{"type":"boolean"},"isAccommodationHotel":{"type":"boolean"},"isAccommodationCooking":{"type":"boolean"},"isAccommodationOther":{"type":"boolean"},"isAccommodationBreakfast":{"type":"boolean"},"propagateToExisting":{"type":"boolean"},"targetOrganizationIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["title"]},"UpdateEnterpriseCategoryDto":{"type":"object","properties":{"title":{"type":"string"},"accountingCode":{"type":"string"},"altAccountingCode":{"type":"string"},"description":{"type":"string"},"guidance":{"type":"string"},"context":{"type":"string"},"visibility":{"type":"object"},"rateId":{"type":"string"},"autoPropagate":{"type":"boolean"},"isAccommodationHotel":{"type":"boolean"},"isAccommodationCooking":{"type":"boolean"},"isAccommodationOther":{"type":"boolean"},"isAccommodationBreakfast":{"type":"boolean"}}},"OrganizationRefDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"EnterpriseUserSearchResultDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationRefDto"}}},"required":["id","name","email","phone","organizations"]},"CreateEnterpriseInvitationDto":{"type":"object","properties":{"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"role":{"type":"number","enum":[0,1]}},"required":["role"]},"EnterpriseInvitationEntity":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string"},"role":{"type":"number"},"enterpriseId":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"redeemedAt":{"format":"date-time","type":"string"},"revokedAt":{"format":"date-time","type":"string"},"createdByUserId":{"type":"string"},"redeemedByUserId":{"type":"string"},"enterprise":{"$ref":"#/components/schemas/EnterpriseEntity"},"createdByUser":{"$ref":"#/components/schemas/UserEntity"},"redeemedByUser":{"$ref":"#/components/schemas/UserEntity"}},"required":["id","token","role","enterpriseId","createdAt"]},"MultiSearchQueryDto":{"type":"object","properties":{"q":{"type":"string","nullable":true},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":100},"attributesToHighlight":{"type":"array","items":{"type":"string"}},"highlightPreTag":{"type":"string"},"highlightPostTag":{"type":"string"},"attributesToCrop":{"type":"array","items":{"type":"string"}},"cropLength":{"type":"integer","minimum":1,"maximum":9007199254740991},"cropMarker":{"type":"string"},"filter":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}]},"sort":{"type":"array","items":{"type":"string"}},"facets":{"type":"array","items":{"type":"string"}},"attributesToRetrieve":{"type":"array","items":{"type":"string"}},"showMatchesPosition":{"type":"boolean"},"matchingStrategy":{"type":"string","enum":["all","last","frequency"]},"hitsPerPage":{"type":"integer","minimum":1,"maximum":100},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"facetName":{"type":"string"},"facetQuery":{"type":"string"},"vector":{"type":"array","items":{"type":"number"},"nullable":true},"showRankingScore":{"type":"boolean"},"showRankingScoreDetails":{"type":"boolean"},"rankingScoreThreshold":{"type":"number","minimum":0,"maximum":1},"attributesToSearchOn":{"type":"array","items":{"type":"string"},"nullable":true},"hybrid":{"type":"object","properties":{"embedder":{"type":"string"},"semanticRatio":{"type":"number"}},"required":["embedder"]},"distinct":{"type":"string"},"retrieveVectors":{"type":"boolean"},"locales":{"type":"array","items":{"type":"string"}},"indexUid":{"type":"string","enum":["reports","expenses","projects","categories","departments","organizations","serviceAccounts","users","products","prices"]}},"required":["indexUid"]},"MultiSearchParamsDto":{"type":"object","properties":{"queries":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/MultiSearchQueryDto"}}},"required":["queries"]},"MultiSearchResponseDto":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object"}}},"required":["results"]},"TenantSearchDto":{"type":"object","properties":{"query":{"type":"string","maxLength":256,"description":"Query text; empty string is a valid placeholder search.","example":"Tokyo"},"types":{"type":"array","items":{"type":"string","enum":["report","expense","project","category","department","member"]},"description":"Which groups to search; defaults to every group when omitted.","uniqueItems":true,"example":["report","expense"],"nullable":true},"limit":{"type":"integer","minimum":1,"maximum":25,"description":"Per-group hit cap (1..25).","default":10}},"required":["query"]},"SearchHighlightDto":{"type":"object","properties":{"field":{"type":"string","example":"label"},"formatted":{"type":"string","example":"Business Trip to <mark>Tokyo</mark>"}},"required":["field","formatted"]},"ReportHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"description":{"type":"string"},"submitterName":{"type":"string"},"organizationId":{"type":"string"},"departmentId":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string","description":"Minor units, string-encoded (BigInt-safe); display-only.","example":"120000"},"currency":{"type":"string","example":"NOK"},"date":{"type":"string","nullable":true}},"required":["id","label","organizationId","status","amount","currency"]},"ExpenseHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"reportId":{"type":"string"},"description":{"type":"string"},"organizationId":{"type":"string"},"status":{"type":"string"},"amount":{"type":"string","description":"Minor units, string-encoded (BigInt-safe); display-only.","example":"120000"},"currency":{"type":"string","example":"NOK"},"date":{"type":"string","nullable":true}},"required":["id","label","reportId","organizationId","status","amount","currency"]},"ProjectHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"description":{"type":"string"},"organizationId":{"type":"string"}},"required":["id","label","organizationId"]},"CategoryHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"description":{"type":"string"},"organizationId":{"type":"string"}},"required":["id","label","organizationId"]},"DepartmentHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"description":{"type":"string"},"organizationId":{"type":"string"}},"required":["id","label","organizationId"]},"MemberHitDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"highlight":{"$ref":"#/components/schemas/SearchHighlightDto"},"email":{"type":"string"}},"required":["id","label"]},"SearchGroupDto":{"type":"object","properties":{"type":{"enum":["report","expense","project","category","department","member"],"type":"string"},"hits":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ReportHitDto"},{"$ref":"#/components/schemas/ExpenseHitDto"},{"$ref":"#/components/schemas/ProjectHitDto"},{"$ref":"#/components/schemas/CategoryHitDto"},{"$ref":"#/components/schemas/DepartmentHitDto"},{"$ref":"#/components/schemas/MemberHitDto"}]}},"estimatedTotalHits":{"type":"number","description":"Meili estimate of total matches for this group"}},"required":["type","hits","estimatedTotalHits"]},"TenantSearchResponseDto":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/SearchGroupDto"}},"processingTimeMs":{"type":"number","description":"Summed Meili processing time across groups (ms)"}},"required":["groups","processingTimeMs"]},"DepartmentConfigurationDto":{"type":"object","properties":{"invoicePaymentTerms":{"type":"number","nullable":true},"deliverByEhf":{"type":"boolean"},"deliverByEmail":{"type":"boolean"},"deliveryEmail":{"type":"string","nullable":true},"shouldOverrideInvoiceBuyer":{"type":"boolean"},"invoiceOrgNumber":{"type":"string","nullable":true},"invoiceLegalName":{"type":"string","nullable":true},"invoiceAddress":{"type":"string","nullable":true},"invoiceRegion":{"type":"string","nullable":true},"invoicePostalCode":{"type":"string","nullable":true}}},"CreateDepartmentDto":{"type":"object","properties":{"title":{"type":"string"},"organizationId":{"type":"string"},"configuration":{"allOf":[{"$ref":"#/components/schemas/DepartmentConfigurationDto"}],"nullable":true},"isPublic":{"type":"boolean"},"managedByIntegrationId":{"type":"string","nullable":true},"accountingCode":{"type":"string","nullable":true}},"required":["title","organizationId"]},"UpdateDepartmentDto":{"type":"object","properties":{"title":{"type":"string"},"configuration":{"allOf":[{"$ref":"#/components/schemas/DepartmentConfigurationDto"}],"nullable":true},"isPublic":{"type":"boolean"},"managedByIntegrationId":{"type":"string","nullable":true},"accountingCode":{"type":"string","nullable":true}}},"UpdateDepartmentAssignmentRoleDto":{"type":"object","properties":{"role":{"type":"number","enum":[0,1,2,3]}},"required":["role"]},"ConnectOrDisconnectAccountsDto":{"type":"object","properties":{"accountIds":{"type":"array","items":{"type":"string"}}},"required":["accountIds"]},"ConnectProjectsDto":{"type":"object","properties":{"projectIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["projectIds"]},"CreateReportDto":{"type":"object","properties":{"id":{"type":"string","description":"Client-minted report id (contract v2, phase 2). Creating with an id the\ncaller already owns returns THAT report instead of a second one, which is\nwhat makes a retry after a lost response safe — the client no longer has\nto dedupe on its own queue entry. An id owned by someone else is a 409.","format":"uuid"},"travelRequest":{"type":"boolean"},"type":{"$ref":"#/components/schemas/ReportType"},"shouldReinvoice":{"type":"boolean","nullable":true},"title":{"type":"string"},"accountId":{"type":"string"},"description":{"type":"string"},"departmentId":{"type":"string"},"projectId":{"type":"string"}},"required":["accountId"]},"UpdateReportDto":{"type":"object","properties":{"title":{"type":"string","nullable":true},"accountId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"shouldReinvoice":{"type":"boolean","nullable":true},"departmentId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"applyProjectToLines":{"type":"boolean","nullable":true}}},"ReportIncompleteResponseDto":{"type":"object","properties":{"validation":{"description":"The completeness verdict, from the same evaluator call as the read side.","allOf":[{"$ref":"#/components/schemas/ReportValidationDto"}]},"errorCode":{"type":"string","example":"report_incomplete"},"statusCode":{"type":"number","example":400},"message":{"type":"string","description":"Always a string. Clients key user-facing text on `errorCode` and the issue `rule`, never on this.","example":"Report is incomplete"},"path":{"type":"string","example":"/reports/94e6a1c2-0c1f-4f0a-9b2a-2f0a1c94e6a1/submit"}},"required":["validation","errorCode","statusCode","message","path"]},"ValidationErrorMessageResponseDto":{"type":"object","properties":{"message":{"oneOf":[{"$ref":"#/components/schemas/ValidationErrorMessageDto"},{"type":"string"}]},"errorCode":{"type":"string"},"statusCode":{"type":"number"}},"required":["message","errorCode","statusCode"]},"RequiredFieldsDto":{"type":"object","properties":{"report":{"description":"Missing fields directly on the report itself","example":["departmentId"],"type":"array","items":{"type":"string"}},"travel":{"description":"Missing fields travel","example":["fromDateTime","toDateTime"],"type":"array","items":{"type":"string"}},"travelRequest":{"description":"Missing fields travel request","example":["fromDateTime","toDateTime","purpose"],"type":"array","items":{"type":"string"}},"expenses":{"type":"object","description":"Missing fields for expenses","example":{"expenseId_123":["currency"],"expenseId_456":["amount","description"]},"additionalProperties":{"type":"array","items":{"type":"string"}}},"drives":{"type":"object","description":"Missing fields for drives","additionalProperties":{"type":"array","items":{"type":"string"}}},"perDiems":{"type":"object","description":"Missing fields for per diems","additionalProperties":{"type":"array","items":{"type":"string"}}},"accommodations":{"type":"object","description":"Missing fields for accommodations (flattened across both expenses for UI display)","example":{"accommodationId_123":["categoryId","date","description"]},"additionalProperties":{"type":"array","items":{"type":"string"}}},"accommodationExpenses":{"type":"object","description":"Detailed missing fields for accommodation expenses (per-expense breakdown for debugging)","example":{"accommodationId_123":{"mainExpense":["categoryId","date"],"breakfastExpense":["description"]}},"additionalProperties":{"$ref":"#/components/schemas/AccommodationExpenseValidationDto"}}}},"ValidationErrorMessageDto":{"type":"object","properties":{"requiredFields":{"$ref":"#/components/schemas/RequiredFieldsDto"}},"required":["requiredFields"]},"AccommodationExpenseValidationDto":{"type":"object","properties":{"mainExpense":{"description":"Missing fields on main accommodation expense","example":["categoryId","date"],"type":"array","items":{"type":"string"}},"breakfastExpense":{"description":"Missing fields on breakfast expense","example":["description","currency"],"type":"array","items":{"type":"string"}}}},"TransferReportDto":{"type":"object","properties":{"targetOrganizationId":{"type":"string","description":"The organization ID to transfer the report to"}},"required":["targetOrganizationId"]},"TransferReportResponseDto":{"type":"object","properties":{"sourceReportId":{"type":"string"},"targetReportId":{"type":"string"}},"required":["sourceReportId","targetReportId"]},"ReportTransferStatus":{"type":"string","enum":["COPIED","COMPLETED","FAILED"]},"ReportTransferReadDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportTransferStatus"},"sourceReportId":{"type":"string"},"targetReportId":{"type":"string"},"sourceOrganizationId":{"type":"string"},"targetOrganizationId":{"type":"string"},"sourceOrganizationName":{"type":"string","nullable":true},"targetOrganizationName":{"type":"string","nullable":true},"requestedByUserId":{"type":"string"},"requestedByName":{"type":"string","nullable":true},"requestedByAccountId":{"type":"string","nullable":true,"description":"The requester's account in the source organization"},"failedReason":{"type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string","nullable":true}},"required":["id","status","sourceReportId","targetReportId","sourceOrganizationId","targetOrganizationId","sourceOrganizationName","targetOrganizationName","requestedByUserId","requestedByName","requestedByAccountId","failedReason","createdAt","completedAt"]},"ApproveReportDto":{"type":"object","properties":{"comment":{"type":"string","description":"The approver's remark. Stored as a COMMENT review row beside the immutable\nAPPROVED one, so the timeline can show what was said without the decision\nitself becoming editable. Blank is treated as none.\n\nBounded by `reviews.comment`, which is VARCHAR(2000). The cap is enforced\nHERE, at the controller boundary, precisely because the remark is written\nafter the decision has landed: without it an over-long merknad fails the\ninsert and returns 500 on an approval that already committed.","maxLength":2000},"annotationIds":{"description":"Internal annotations to publish to the submitter as part of approving —\nthe approver chooses what to surface; anything unnamed stays internal.\nIds belonging to another report are ignored rather than failing the\napproval: a stale client must never be able to block a decision.","type":"array","items":{"type":"string","format":"uuid"}}}},"ReviewReportDto":{"type":"object","properties":{"comment":{"type":"string","description":"Bounded by `reviews.comment`. Without the cap an over-long rejection\nreason failed the insert rather than the request — the same shape of bug\nthe approval path carries, one endpoint over.","maxLength":2000}}},"OverrideReportDto":{"type":"object","properties":{"reason":{"type":"string","description":"Required reason for force-resolving this stuck report (audit trail)."}},"required":["reason"]},"RerunReportResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["COMPLETED","BLOCKED","FAILED","NO_ACTIVE_FLOW"],"description":"Outcome of the synchronous flow re-evaluation. COMPLETED = report reached APPROVED; BLOCKED = still stuck (see blockedAtNodeId/reason); FAILED = evaluation errored; NO_ACTIVE_FLOW = no published flow to run (use /override instead)."},"reportStatus":{"type":"string","enum":["DRAFT","PENDING","APPROVED","REJECTED","BLOCKED"],"description":"Report status after the rerun."},"blockedAtNodeId":{"type":"string","description":"Node the flow blocked on, if BLOCKED."},"blockedNodeName":{"type":"string","description":"Human-readable name of the blocking node."},"reason":{"type":"string","description":"Why the flow blocked or failed (diagnostic message)."}},"required":["status","reportStatus"]},"AccountRole":{"type":"number","enum":[0,1,2,3]},"DepartmentRole":{"type":"number","enum":[0,1,2,3],"description":"Department role level required for the review"},"ReassignReviewDto":{"type":"object","properties":{"accountId":{"type":"string","description":"Specific account ID to assign the review to"},"accountRole":{"description":"Account role level required for the review","$ref":"#/components/schemas/AccountRole"},"departmentRole":{"description":"Department role level required for the review","$ref":"#/components/schemas/DepartmentRole"},"managerOfSubmitter":{"type":"boolean","description":"Assign to the manager of the report submitter"},"reason":{"type":"string","description":"Optional reason for reassigning the review"}}},"OverrideReviewDto":{"type":"object","properties":{"reason":{"type":"string","description":"Required reason for overriding this review step","example":"Reviewer is on vacation, urgent report needs processing"}},"required":["reason"]},"MarkValueEnum":{"type":"string","enum":["OK","FOLLOW_UP","ANSWERED","DISMISSED","CONFIRMED","PENDING"]},"SetReviewerMarkDto":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/MarkValueEnum"},"rowUpdatedAt":{"type":"string","description":"The subject row's `updatedAt` at the moment of marking — the staleness\nanchor that lets a client say «endret etter din OK» when the row has moved\nsince. Meaningful for ITEM marks; ignored for the others.","format":"date-time"}},"required":["value"]},"AnnotationItemKindEnum":{"type":"string","enum":["EXPENSE","DRIVE","PER_DIEM","ACCOMMODATION"],"description":"Omit both item fields for an annotation about the whole report."},"AnnotationVisibilityEnum":{"type":"string","enum":["INTERNAL","SUBMITTER"],"description":"Defaults to INTERNAL, so nothing half-formed reaches the submitter. Publishing is a visibility flip, available at any time."},"CreateReportAnnotationDto":{"type":"object","properties":{"body":{"type":"string","maxLength":4000},"itemKind":{"description":"Omit both item fields for an annotation about the whole report.","$ref":"#/components/schemas/AnnotationItemKindEnum"},"itemId":{"type":"string","format":"uuid"},"visibility":{"description":"Defaults to INTERNAL, so nothing half-formed reaches the submitter. Publishing is a visibility flip, available at any time.","$ref":"#/components/schemas/AnnotationVisibilityEnum"}},"required":["body"]},"UpdateReportAnnotationDto":{"type":"object","properties":{"body":{"type":"string","maxLength":4000},"visibility":{"$ref":"#/components/schemas/AnnotationVisibilityEnum"}}},"PrivateInterruptionInputDto":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"timeZone":{"type":"string","example":"Europe/Madrid"}},"required":["startAt","endAt","timeZone"]},"PlaceInputDto":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"description":"MAP_SEARCH requires providerPlaceId, MAP_PIN requires lat+lng, and MANUAL forbids providerPlaceId."},"provider":{"$ref":"#/components/schemas/PlaceProvider","nullable":true,"description":"The map provider that minted providerPlaceId."},"providerPlaceId":{"type":"string","maxLength":255,"nullable":true},"name":{"type":"string","maxLength":255,"nullable":true},"formattedAddress":{"type":"string","maxLength":512,"nullable":true},"street":{"type":"string","maxLength":255,"nullable":true},"postalCode":{"type":"string","maxLength":16,"nullable":true},"city":{"type":"string","maxLength":255,"nullable":true},"region":{"type":"string","maxLength":255,"nullable":true},"countryName":{"type":"string","maxLength":255,"nullable":true},"countryCode":{"type":"string","maxLength":2,"description":"Accepted so a place candidate round-trips unchanged, then ignored: the stored country code is derived from the coordinates. Use countryName to state a country.","nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"nullable":true}}},"CreateTravelDto":{"type":"object","properties":{"fromDateTime":{"type":"string","format":"date-time"},"toDateTime":{"type":"string","format":"date-time"},"businessStartAt":{"type":"string","format":"date-time","description":"Business travel starts here after a leading private stay. Set or clear together with businessStartTimeZone; omission preserves the saved value.","nullable":true},"businessStartTimeZone":{"type":"string","example":"Europe/Madrid","nullable":true},"businessEndAt":{"type":"string","format":"date-time","description":"Business travel ends here before a trailing private stay. Set or clear together with businessEndTimeZone; omission preserves the saved value.","nullable":true},"businessEndTimeZone":{"type":"string","example":"Europe/Madrid","nullable":true},"privateInterruptions":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PrivateInterruptionInputDto"},"description":"Private time inside the business window. A supplied list replaces the saved one whole; null or [] clears it; omission preserves it. Each interruption lies strictly inside the business window and strictly apart from the others; at most 20.","nullable":true},"fromLocationName":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.name. Required unless fromPlace.name is set.","nullable":true},"toLocationName":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.name. Required unless toPlace.name is set.","nullable":true},"fromLocationPlaceId":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.providerPlaceId","nullable":true},"toLocationPlaceId":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.providerPlaceId","nullable":true},"fromLocationCity":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.city","nullable":true},"toLocationCity":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.city","nullable":true},"fromLocationCountry":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.countryName","nullable":true},"toLocationCountry":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.countryName","nullable":true},"fromLocationRegion":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.region","nullable":true},"toLocationRegion":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.region","nullable":true},"fromLocationSource":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"deprecated":true,"description":"Where the departure endpoint came from. MAP_SEARCH requires a non-empty place id, MAP_PIN requires the matching lat/lng pair, MANUAL must not carry a place id. Omitted: inferred as MAP_SEARCH when the place id is non-empty, otherwise null = unknown."},"toLocationSource":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"deprecated":true,"description":"Where the destination endpoint came from. MAP_SEARCH requires a non-empty place id, MAP_PIN requires the matching lat/lng pair, MANUAL must not carry a place id. Omitted: inferred as MAP_SEARCH when the place id is non-empty, otherwise null = unknown."},"fromLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use fromPlace.lat","nullable":true},"fromLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use fromPlace.lng","nullable":true},"toLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use toPlace.lat","nullable":true},"toLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use toPlace.lng","nullable":true},"fromPlace":{"allOf":[{"$ref":"#/components/schemas/PlaceInputDto"}],"nullable":true,"description":"The departure. Required unless fromLocationName is set — the requirement is either-or, so the schema cannot list either field as required."},"toPlace":{"allOf":[{"$ref":"#/components/schemas/PlaceInputDto"}],"nullable":true,"description":"The destination. Required unless toLocationName is set — the requirement is either-or, so the schema cannot list either field as required."},"purpose":{"type":"string"},"typeOfAccommodation":{"deprecated":true,"description":"Deprecated: accommodation is recorded per stay under the travel; omit and the travel defaults to NONE","$ref":"#/components/schemas/TravelAccommodationType"},"advanceAmount":{"type":"integer","format":"int64"},"disablePerDiemCalculation":{"type":"boolean","nullable":true}},"required":["fromDateTime","toDateTime","purpose"]},"PlacePatchDto":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"description":"MAP_SEARCH requires providerPlaceId, MAP_PIN requires lat+lng, and MANUAL forbids providerPlaceId — each judged only when this payload carries the property in question."},"provider":{"$ref":"#/components/schemas/PlaceProvider","nullable":true,"description":"The map provider that minted providerPlaceId."},"providerPlaceId":{"type":"string","maxLength":255,"nullable":true},"name":{"type":"string","maxLength":255,"nullable":true},"formattedAddress":{"type":"string","maxLength":512,"nullable":true},"street":{"type":"string","maxLength":255,"nullable":true},"postalCode":{"type":"string","maxLength":16,"nullable":true},"city":{"type":"string","maxLength":255,"nullable":true},"region":{"type":"string","maxLength":255,"nullable":true},"countryName":{"type":"string","maxLength":255,"nullable":true},"countryCode":{"type":"string","maxLength":2,"description":"Accepted so a place candidate round-trips unchanged, then ignored: the stored country code is derived from the coordinates. Use countryName to state a country.","nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"nullable":true}}},"UpdateTravelDto":{"type":"object","properties":{"fromDateTime":{"format":"date-time","type":"string","nullable":true},"toDateTime":{"format":"date-time","type":"string","nullable":true},"businessStartAt":{"type":"string","format":"date-time","description":"Business travel starts here after a leading private stay. Set or clear together with businessStartTimeZone; omission preserves the saved value.","nullable":true},"businessStartTimeZone":{"type":"string","example":"Europe/Madrid","nullable":true},"businessEndAt":{"type":"string","format":"date-time","description":"Business travel ends here before a trailing private stay. Set or clear together with businessEndTimeZone; omission preserves the saved value.","nullable":true},"businessEndTimeZone":{"type":"string","example":"Europe/Madrid","nullable":true},"privateInterruptions":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PrivateInterruptionInputDto"},"description":"Private time inside the business window. A supplied list replaces the saved one whole; null or [] clears it; omission preserves it. Each interruption lies strictly inside the business window and strictly apart from the others; at most 20.","nullable":true},"fromLocationName":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.name. Required unless fromPlace.name is set.","nullable":true},"toLocationName":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.name. Required unless toPlace.name is set.","nullable":true},"fromLocationPlaceId":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.providerPlaceId","nullable":true},"toLocationPlaceId":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.providerPlaceId","nullable":true},"fromLocationCity":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.city","nullable":true},"toLocationCity":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.city","nullable":true},"fromLocationCountry":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.countryName","nullable":true},"toLocationCountry":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.countryName","nullable":true},"fromLocationRegion":{"type":"string","deprecated":true,"description":"Deprecated: use fromPlace.region","nullable":true},"toLocationRegion":{"type":"string","deprecated":true,"description":"Deprecated: use toPlace.region","nullable":true},"fromLocationSource":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"deprecated":true,"description":"Deprecated: use fromPlace.source"},"toLocationSource":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"deprecated":true,"description":"Deprecated: use toPlace.source"},"fromLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use fromPlace.lat","nullable":true},"fromLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use fromPlace.lng","nullable":true},"toLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use toPlace.lat","nullable":true},"toLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use toPlace.lng","nullable":true},"fromPlace":{"allOf":[{"$ref":"#/components/schemas/PlacePatchDto"}],"nullable":true,"description":"Partial merge over the stored place: properties you omit are kept, an explicit null on a property clears it, and null for the whole object clears the place. Editing what identifies the place (name, address, city, provider place id) drops stored coordinates unless this payload carries the new pair."},"toPlace":{"allOf":[{"$ref":"#/components/schemas/PlacePatchDto"}],"nullable":true,"description":"Partial merge over the stored place: properties you omit are kept, an explicit null on a property clears it, and null for the whole object clears the place. Editing what identifies the place (name, address, city, provider place id) drops stored coordinates unless this payload carries the new pair."},"purpose":{"type":"string","nullable":true},"typeOfAccommodation":{"deprecated":true,"description":"Deprecated: accommodation is recorded per stay under the travel; omit and the travel defaults to NONE","$ref":"#/components/schemas/TravelAccommodationType"},"advanceAmount":{"type":"integer","format":"int64"},"disablePerDiemCalculation":{"type":"boolean","nullable":true}}},"SimulateSchemeDto":{"type":"object","properties":{"config":{"type":"object","description":"The candidate SchemeConfig to price the travel against. Shape mirrors what the resolver produces: `{ baseDeck: \"STATENS\", modifiers: [...] }`. Each modifier is one of the closed-set primitives (mealDeduction, longStayReduction, halfRateAfterN, abroadCompensation); an unknown modifier or malformed field is rejected as `diet_scheme_config_invalid` rather than silently dropped.","additionalProperties":true}},"required":["config"]},"SimulatedPerDiemDayResponse":{"type":"object","properties":{"date":{"type":"string"},"status":{"type":"string","enum":["COMPENSATED","EXCLUDED","MISSING_ACCOMMODATION","PRICING_UNAVAILABLE"]},"country":{"type":"string","nullable":true},"taxFreeCriteria":{"type":"string","nullable":true,"enum":["PER_DIEM_TAX_ABROAD_COMPENSATION","PER_DIEM_TAX_FROM_6_TO_12_HOURS","PER_DIEM_TAX_OVER_12_HOURS_WITHOUT_ACCOMMODATION","PER_DIEM_TAX_OVER_12_HOURS_WITH_ACCOMMODATION","DRIVE_TAX_MILEAGE","DRIVE_TAX_MILEAGE_WITH_PASSENGER","DRIVE_TAX_MILEAGE_WITH_TRAILER","DRIVE_TAX_MILEAGE_OFFROAD","PER_DIEM_TAXFREE_FROM_6_TO_12_HOURS","PER_DIEM_TAXFREE_OVER_12_HOURS_WITHOUT_ACCOMMODATION","PER_DIEM_TAXFREE_OVERNIGHT_WITH_HOTEL","PER_DIEM_TAXFREE_OVERNIGHT_WITH_COOKING","PER_DIEM_TAXFREE_OVERNIGHT_WITHOUT_COOKING","PER_DIEM_TAXFREE_OVERNIGHT_TRUCKER","PER_DIEM_TAXFREE_NIGHT_DOMESTIC","DRIVE_TAXFREE_MILEAGE","DRIVE_TAXFREE_MILEAGE_WITH_PASSENGER","DRIVE_TAXFREE_MILEAGE_WITH_TRAILER","DRIVE_TAXFREE_MILEAGE_OFFROAD"]},"isHalfDay":{"type":"boolean"},"longStayReducedTaxFree":{"type":"boolean"},"breakfast":{"type":"boolean"},"lunch":{"type":"boolean"},"dinner":{"type":"boolean"},"fullFareAmount":{"type":"string","nullable":true},"fullFareExemptAmount":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"exemptAmount":{"type":"string","nullable":true},"taxableAmount":{"type":"string","nullable":true},"compensationAmount":{"type":"string","nullable":true},"pricingFailureCause":{"type":"string","nullable":true}},"required":["date","status","isHalfDay","longStayReducedTaxFree","breakfast","lunch","dinner"]},"SimulatedTotalsResponse":{"type":"object","properties":{"amount":{"type":"string"},"exemptAmount":{"type":"string"},"taxableAmount":{"type":"string"},"compensationAmount":{"type":"string"}},"required":["amount","exemptAmount","taxableAmount","compensationAmount"]},"SimulateSchemeResultResponse":{"type":"object","properties":{"days":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedPerDiemDayResponse"}},"totals":{"$ref":"#/components/schemas/SimulatedTotalsResponse"}},"required":["days","totals"]},"ConvertTravelRequestDto":{"type":"object","properties":{"allowAdditional":{"type":"boolean"}}},"UpdateTravelRequestDto":{"type":"object","properties":{"fromDateTime":{"format":"date-time","description":"Timezone-qualified ISO datetime; time is preserved","type":"string","nullable":true},"toDateTime":{"format":"date-time","description":"Timezone-qualified ISO datetime; time is preserved","type":"string","nullable":true},"fromLocationName":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use fromPlace.name","nullable":true},"toLocationName":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use toPlace.name","nullable":true},"fromLocationPlaceId":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use fromPlace.providerPlaceId","nullable":true},"toLocationPlaceId":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use toPlace.providerPlaceId","nullable":true},"fromLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use fromPlace.lat","nullable":true},"fromLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use fromPlace.lng","nullable":true},"toLat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use toPlace.lat","nullable":true},"toLng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use toPlace.lng","nullable":true},"fromPlace":{"allOf":[{"$ref":"#/components/schemas/PlacePatchDto"}],"nullable":true,"description":"Partial merge over the stored place: properties you omit are kept, an explicit null on a property clears it, and null for the whole object clears the place. Editing what identifies the place (name, address, city, provider place id) drops stored coordinates unless this payload carries the new pair."},"toPlace":{"allOf":[{"$ref":"#/components/schemas/PlacePatchDto"}],"nullable":true,"description":"Partial merge over the stored place: properties you omit are kept, an explicit null on a property clears it, and null for the whole object clears the place. Editing what identifies the place (name, address, city, provider place id) drops stored coordinates unless this payload carries the new pair."},"purpose":{"type":"string","maxLength":512,"nullable":true},"estimatedCost":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Minor units; omit to keep, null to clear, 0 is stored as 0","nullable":true},"requestedAdvanceAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Minor units; omit to keep, null to clear, 0 is stored as 0","nullable":true},"ownCarApprovalRequested":{"type":"boolean"},"premiumClassApprovalRequested":{"type":"boolean"},"currency":{"type":"string"}}},"ClientAccommodationCountrySource":{"type":"string","enum":["USER","PREFILL_ACCEPTED"]},"CreateAccommodationDto":{"type":"object","properties":{"name":{"type":"string","deprecated":true,"description":"Deprecated: use place.name","nullable":true},"placeId":{"type":"string","deprecated":true,"description":"Deprecated: use place.providerPlaceId","nullable":true},"city":{"type":"string","deprecated":true,"description":"Deprecated: use place.city","nullable":true},"country":{"type":"string","deprecated":true,"description":"Deprecated: use place.countryName","nullable":true},"countrySource":{"$ref":"#/components/schemas/ClientAccommodationCountrySource","nullable":true,"description":"How the client chose country. PLACE_RESOLVED is server-assigned and is rejected on writes."},"region":{"type":"string","deprecated":true,"description":"Deprecated: use place.region","nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use place.lat","nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use place.lng","nullable":true},"place":{"allOf":[{"$ref":"#/components/schemas/PlaceInputDto"}],"nullable":true},"checkInAt":{"format":"date-time","type":"string","nullable":true},"checkOutAt":{"format":"date-time","type":"string","nullable":true},"type":{"$ref":"#/components/schemas/TravelAccommodationType"},"description":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"amount":{"type":"integer","format":"int64"},"currency":{"type":"string","nullable":true},"exchangeRate":{"type":"number","minimum":0.000001,"maximum":1000000,"nullable":true},"isManualExchangeRate":{"type":"boolean","deprecated":true,"description":"Legacy compatibility field; new clients use fx. True only when the user typed exchangeRate in this edit. Requires a rate, which takes precedence even when it equals the stored value. Omit both for a server quote; omit the flag when echoing a read model.","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false}]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod","nullable":true},"paymentCardId":{"type":"string","nullable":true},"transactionDate":{"format":"date-time","type":"string","nullable":true},"breakfastAmount":{"type":"integer","format":"int64"},"breakfastIncluded":{"type":"boolean"}}},"ReferenceAccommodationDto":{"type":"object","properties":{"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedCostsRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"type":{"type":"string","default":"HOTEL","enum":["HOTEL","COOKING_AVAILABLE","COOKING_UNAVAILABLE","NONE"]},"checkInAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"checkOutAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"breakfastIncluded":{"type":"boolean","default":false}},"required":["expenseId","expectedCostsRevision","id"],"additionalProperties":false},"DetachAccommodationExpenseDto":{"type":"object","properties":{"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expectedCostsRevision":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["expenseId","expectedCostsRevision"],"additionalProperties":false},"UpdateAccommodationDto":{"type":"object","properties":{"name":{"type":"string","deprecated":true,"description":"Deprecated: use place.name","nullable":true},"placeId":{"type":"string","deprecated":true,"description":"Deprecated: use place.providerPlaceId","nullable":true},"city":{"type":"string","deprecated":true,"description":"Deprecated: use place.city","nullable":true},"country":{"type":"string","deprecated":true,"description":"Deprecated: use place.countryName","nullable":true},"countrySource":{"$ref":"#/components/schemas/ClientAccommodationCountrySource","nullable":true,"description":"How the client chose country. PLACE_RESOLVED is server-assigned and is rejected on writes."},"region":{"type":"string","deprecated":true,"description":"Deprecated: use place.region","nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use place.lat","nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use place.lng","nullable":true},"place":{"allOf":[{"$ref":"#/components/schemas/PlacePatchDto"}],"nullable":true,"description":"Partial merge over the stored place: properties you omit are kept, an explicit null on a property clears it, and null for the whole object clears the place. Editing what identifies the place (name, address, city, provider place id) drops stored coordinates unless this payload carries the new pair."},"checkInAt":{"format":"date-time","type":"string","nullable":true},"checkOutAt":{"format":"date-time","type":"string","nullable":true},"type":{"$ref":"#/components/schemas/TravelAccommodationType"},"description":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"amount":{"type":"integer","format":"int64"},"currency":{"type":"string","nullable":true},"exchangeRate":{"type":"number","minimum":0.000001,"maximum":1000000,"nullable":true},"isManualExchangeRate":{"type":"boolean","deprecated":true,"description":"Legacy compatibility field; new clients use fx. True only when the user typed exchangeRate in this edit. Requires a rate, which takes precedence even when it equals the stored value. Omit both for a server quote; omit the flag when echoing a read model.","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["KEEP"]}},"required":["mode"],"additionalProperties":false}]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod","nullable":true},"paymentCardId":{"type":"string","nullable":true},"transactionDate":{"format":"date-time","type":"string","nullable":true},"breakfastAmount":{"type":"integer","format":"int64"},"breakfastIncluded":{"type":"boolean"}}},"UploadAccommodationAttachmentDto":{"type":"object","properties":{"correlationId":{"type":"string"},"performCapture":{"type":"boolean"},"performScan":{"type":"boolean"},"ocrText":{"type":"string"},"populateExpense":{"type":"string","enum":["none","empty","all"]}}},"PlaceVocabularyCountryDto":{"type":"object","properties":{"code":{"type":"string","description":"Wire identity clients store and send: ISO 3166-1 alpha-2, user-assigned XK for Kosovo, or one of the four supported ISO 3166-2 sub-jurisdiction codes.","example":"GB-NIR"},"parentCode":{"type":"string","nullable":true,"description":"ISO 3166-1 alpha-2 parent for a sub-jurisdiction; null for countries. A non-null value is the sub-jurisdiction discriminator.","example":"GB"},"aliases":{"description":"Every declared legacy input accepted for this code, including the code itself, canonical Norwegian Bokmål label, English name, and known aliases. Use these to map already-stored free-text values to code identity.","example":["GB-NIR","Nord-Irland","Northern Ireland"],"type":"array","items":{"type":"string"}},"perDiemDomestic":{"type":"boolean","description":"Whether this code uses the domestic per-diem pricing bucket (DOMESTIC_COUNTRY_CODES, including AQ and BV). This is not an “Innland” UI-grouping flag.","example":false}},"required":["code","parentCode","aliases","perDiemDomestic"]},"PlaceVocabularyDto":{"type":"object","properties":{"version":{"type":"string","description":"SHA-256 hash of the complete code-sorted countries content; use it as the vocabulary version and ETag identity.","example":"8f41c6f1f0f87ef3e245cc3f72c1ea228f41c6f1f0f87ef3e245cc3f72c1ea22"},"countries":{"description":"Global place entries sorted bytewise by code for stable, collation-independent content and versioning.","type":"array","items":{"$ref":"#/components/schemas/PlaceVocabularyCountryDto"}}},"required":["version","countries"]},"ReportAttachmentEntity":{"type":"object","properties":{"id":{"type":"string"},"storageKey":{"type":"string"},"filename":{"type":"string"},"reportId":{"type":"string"},"organizationId":{"type":"string"},"deletedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"url":{"type":"string"}},"required":["id","storageKey","reportId","organizationId","createdAt","updatedAt"]},"PromoteReportAttachmentDto":{"type":"object","properties":{"populateExpense":{"type":"string","enum":["none","empty","all"]}}},"TravelerPersonDto":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["PASSENGER","GUEST","BOOKING_CONTACT","PAYER","UNKNOWN"]},"legible":{"type":"boolean"},"roleCertain":{"type":"boolean"},"sourceText":{"type":"string"},"page":{"type":"number","nullable":true}},"required":["name","role","legible","roleCertain","sourceText","page"]},"TravelerAcknowledgmentDto":{"type":"object","properties":{"id":{"type":"string"},"actorId":{"type":"string"},"actorType":{"type":"string","enum":["SYSTEM","USER","SERVICE_ACCOUNT"]},"reason":{"type":"string","enum":["ON_BEHALF","NAME_VARIATION","OTHER"]},"explanation":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","actorId","actorType","reason","explanation","createdAt"]},"TravelerReadDto":{"type":"object","properties":{"attachmentId":{"type":"string"},"enabled":{"type":"boolean"},"status":{"type":"string","enum":["NOT_REQUESTED","PENDING","AVAILABLE","PARTIAL","UNAVAILABLE","FAILED"]},"latestAttemptStatus":{"type":"string","nullable":true,"enum":["PENDING","RUNNING","COMPLETE","FAILED","CANCELLED"]},"failureCode":{"type":"string","nullable":true},"resultId":{"type":"string","nullable":true},"outcome":{"type":"string","enum":["MATCH","MISMATCH","UNKNOWN","NOT_APPLICABLE"]},"evidenceKey":{"type":"string","nullable":true},"expectedName":{"type":"string","nullable":true},"documentKind":{"type":"string","nullable":true,"enum":["FLIGHT","OTHER_TRANSPORT","HOTEL","OTHER"]},"people":{"type":"array","items":{"$ref":"#/components/schemas/TravelerPersonDto"}},"findingId":{"type":"string","nullable":true},"acknowledgment":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/TravelerAcknowledgmentDto"}]}},"required":["attachmentId","enabled","status","latestAttemptStatus","failureCode","resultId","outcome","evidenceKey","expectedName","documentKind","people","findingId","acknowledgment"]},"TravelerCaptureRequestDto":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["requestId"],"additionalProperties":false},"TravelerAcknowledgeDto":{"type":"object","properties":{"evidenceKey":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reason":{"type":"string","enum":["ON_BEHALF","NAME_VARIATION","OTHER"]},"explanation":{"type":"string","maxLength":500}},"required":["evidenceKey","reason"],"additionalProperties":false},"FindingDto":{"type":"object","properties":{"id":{"type":"string"},"checkId":{"type":"string","description":"Catalog check id, e.g. amountMismatch"},"subjectType":{"type":"string","enum":["EXPENSE","ATTACHMENT","REPORT","DUPLICATE_GROUP"]},"subjectId":{"type":"string"},"reportId":{"type":"string"},"variant":{"type":"string","nullable":true,"description":"Check-specific variant, e.g. 'over'"},"detection":{"type":"string","enum":["OPEN","NOT_DETECTED","SUBJECT_GONE"]},"triage":{"type":"string","enum":["PENDING","DISMISSED","CONFIRMED"]},"confidence":{"type":"number","nullable":true},"tier":{"type":"string","nullable":true,"description":"Detector-assigned evidence tier the consequence rules key on. integrity aiOrigin: 'proof' (verified provenance) | 'corroborated' (high pixel score + an independent signal) | 'uncorroborated' (one signal alone, advisory by default). The signals behind it are in evidence.corroboration."},"evidence":{"type":"object","description":"Check-specific evidence payload"},"consequence":{"type":"string","description":"Consequence resolved at read time from catalog defaults + org CheckPolicy","enum":["INFO","WARN","REQUIRE_RESOLUTION"]},"baseline":{"type":"boolean","description":"Backfilled finding: informs, never gates"},"resolvedByUserId":{"type":"string","nullable":true},"resolvedBySystem":{"type":"boolean","description":"Resolved by re-evaluation, not a person"},"resolveReason":{"type":"string","nullable":true},"resolvedAt":{"format":"date-time","type":"string","nullable":true},"lastEvaluatedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","checkId","subjectType","subjectId","reportId","detection","triage","evidence","consequence","baseline","resolvedBySystem","lastEvaluatedAt","createdAt"]},"ReportFindingsSummaryDto":{"type":"object","properties":{"openCount":{"type":"number","description":"Open, non-baseline findings"},"requireCount":{"type":"number","description":"Of those, findings whose consequence blocks approval"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/FindingDto"}}},"required":["openCount","requireCount","findings"]},"DismissFindingDto":{"type":"object","properties":{"reason":{"type":"string","enum":["FALSE_POSITIVE","ACCEPTED","OTHER"],"description":"Reason for dismissing the finding"},"note":{"type":"string","maxLength":500,"description":"Additional notes about the dismissal","nullable":true}},"required":["reason"]},"ConfirmFindingDto":{"type":"object","properties":{"note":{"type":"string","maxLength":500,"description":"Additional notes about the confirmation","nullable":true}}},"ConsequenceRuleDto":{"type":"object","properties":{"when":{"allOf":[{"$ref":"#/components/schemas/ConsequenceRuleWhenDto"}],"nullable":true},"consequence":{"type":"string","enum":["INFO","WARN","REQUIRE_RESOLUTION"]}},"required":["consequence"]},"ConsequenceRuleWhenDto":{"type":"object","properties":{"variant":{"type":"string","nullable":true},"minConfidence":{"type":"number","minimum":0,"maximum":1,"nullable":true},"tier":{"type":"string","description":"Matches the finding's evidence tier; must be one the check declares (integrity aiOrigin: proof | corroborated | uncorroborated). An untiered finding never matches.","nullable":true}}},"UpdateCheckPolicyDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"null clears the override (falls back to the catalog/legacy toggle)","nullable":true},"params":{"type":"object","additionalProperties":{},"description":"Check-specific tuning, validated against the catalog schema. Replaces the stored params override; preserve existing keys when editing. amountMismatch accepts reportUnverifiable (boolean, default true): false suppresses only unverifiable findings on the next evaluation. Existing findings close on re-evaluation; changing params does not start a re-evaluation.","nullable":true},"consequenceRules":{"type":"array","items":{"$ref":"#/components/schemas/ConsequenceRuleDto"},"description":"Ordered first-match-wins rules; replaces the catalog set","nullable":true}}},"SetKillSwitchDto":{"type":"object","properties":{"mode":{"type":"string","enum":["DISABLED","MAX_INFO","OFF"]},"reason":{"type":"string","maxLength":500,"nullable":true}},"required":["mode"]},"CreateInvoiceDto":{"type":"object","properties":{"reportId":{"type":"string","minLength":1}},"required":["reportId"]},"UpdateInvoiceDto":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InvoiceStatus"},"deliveredAs":{"type":"string","maxLength":255,"nullable":true},"errorDescription":{"type":"string","nullable":true}}},"SendInvoiceDto":{"type":"object","properties":{"email":{"type":"boolean","nullable":true},"ehf":{"type":"boolean","nullable":true},"integrationIds":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"nullable":true},"acknowledgeDuplicateRisk":{"type":"boolean","nullable":true}}},"CreateRateDto":{"type":"object","properties":{"title":{"type":"string"},"amount":{"type":"number","minimum":0},"criteria":{"$ref":"#/components/schemas/RateCriteria"},"applicableYear":{"type":"integer","minimum":2020,"maximum":2100,"nullable":true},"organizationId":{"type":"string","nullable":true}},"required":["title","amount","criteria"]},"UpdateRateDto":{"type":"object","properties":{"title":{"type":"string","nullable":true},"amount":{"type":"number","minimum":0},"criteria":{"$ref":"#/components/schemas/RateCriteria"},"applicableYear":{"type":"integer","minimum":2020,"maximum":2100,"nullable":true}}},"FlowActionType":{"type":"string","enum":["APPROVE","REJECT","REQUIRE_REVIEW","COMMENT","UPDATE","HTTP_REQUEST"]},"FlowActionTypeDto":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/FlowActionType"}},"required":["actionType"]},"ConditionOperator":{"type":"string","enum":["EQUALS","NOT_EQUALS","GT","GTE","LT","LTE","IN","NOT_IN","MATCHES","IS_NULL","IS_NOT_NULL","ONE_OF","ALL","NONE"]},"ConditionOperatorDto":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionOperator"}},"required":["operator"]},"AccountRoleDto":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/AccountRole"}},"required":["role"]},"DepartmentRoleDto":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/DepartmentRole"}},"required":["role"]},"CollectionCriteriaDto":{"type":"object","properties":{"field":{"type":"string","description":"Relative field path within the array item (e.g., \"amount\", \"type\")","example":"amount"},"operator":{"description":"Scalar operator to apply (cannot be ONE_OF/ALL/NONE)","example":"GT","$ref":"#/components/schemas/ConditionOperator"},"value":{"type":"string","description":"Value to compare against (stored as string)","example":"5000"}},"required":["field","operator","value"]},"ConditionBranchDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for this branch","example":"branch-1"},"field":{"type":"string","description":"Dot-notation field path (e.g., \"report.totalAmount\", \"expensesList\")","example":"report.totalAmount"},"operator":{"description":"Operator to apply. Use ONE_OF/ALL/NONE for array fields with collectionCriteria.","example":"GT","$ref":"#/components/schemas/ConditionOperator"},"value":{"type":"string","description":"Value to compare against (stored as string). Empty for collection operators.","example":"10000"},"collectionCriteria":{"description":"Required for ONE_OF/ALL/NONE operators. Defines the condition to check on each array item.","allOf":[{"$ref":"#/components/schemas/CollectionCriteriaDto"}]},"nextNodeId":{"type":"string","description":"Node ID to execute if this branch matches","example":"approve-node-uuid"}},"required":["id","field","operator","value","nextNodeId"]},"ConditionNodeConfigDto":{"type":"object","properties":{"branches":{"description":"Branches to evaluate in order. First matching branch wins.","type":"array","items":{"$ref":"#/components/schemas/ConditionBranchDto"}},"defaultNodeId":{"type":"string","description":"Fallback node ID if no branch matches","example":"reject-node-uuid"}},"required":["branches"]},"FlowTrigger":{"type":"string","enum":["REPORT_SUBMITTED","REPORT_REVIEWED","FINDING_DETECTED","FINDING_RESOLVED"]},"CreateFlowNodeDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/FlowNodeType"},"config":{"type":"object","additionalProperties":{},"description":"Node configuration (type-specific)","nullable":true},"nextNodeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"positionX":{"type":"number","nullable":true},"positionY":{"type":"number","nullable":true}},"required":["name","type"]},"FlowNodeType":{"type":"string","enum":["CONDITION","ACTION","WAIT"]},"CreateFlowDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"trigger":{"$ref":"#/components/schemas/FlowTrigger","nullable":true,"deprecated":true,"description":"Deprecated: Use triggers array instead"},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/FlowTrigger"},"description":"Array of triggers that activate this flow","nullable":true},"isActive":{"type":"boolean","nullable":true},"rootNodeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CreateFlowNodeDto"},"nullable":true}},"required":["name"]},"FlowNodeDto":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/FlowNodeType"},"id":{"type":"string"},"name":{"type":"string"},"config":{"type":"object"},"nextNodeId":{"type":"string","nullable":true},"positionX":{"type":"number"},"positionY":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["type","id","name","config","nextNodeId","positionX","positionY","createdAt","updatedAt"]},"FlowDto":{"type":"object","properties":{"triggers":{"type":"array","items":{"$ref":"#/components/schemas/FlowTrigger"}},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"organizationId":{"type":"string"},"rootNodeId":{"type":"string","nullable":true,"description":"Draft entrypoint, editable via PATCH (not used for execution)."},"publishedRootNodeId":{"type":"string","nullable":true,"description":"Entrypoint of the published snapshot that actually executes. Diverges from\n`rootNodeId` while there are unpublished draft edits; null until first\npublish."},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/FlowNodeDto"}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"isPublished":{"type":"boolean","description":"Whether the flow has been published at least once"},"hasDraftChanges":{"type":"boolean","description":"Whether the draft differs from the published version"},"publishedAt":{"format":"date-time","type":"string","nullable":true,"description":"When the flow was last published"}},"required":["triggers","id","name","description","isActive","organizationId","rootNodeId","publishedRootNodeId","nodes","createdAt","updatedAt","isPublished","hasDraftChanges","publishedAt"]},"FlowListItemDto":{"type":"object","properties":{"triggers":{"type":"array","items":{"$ref":"#/components/schemas/FlowTrigger"}},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"rootNodeId":{"type":"string","nullable":true},"nodeCount":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"isPublished":{"type":"boolean","description":"Whether the flow has been published at least once"},"hasDraftChanges":{"type":"boolean","description":"Whether the draft differs from the published version"},"publishedAt":{"format":"date-time","type":"string","nullable":true,"description":"When the flow was last published"}},"required":["triggers","id","name","description","isActive","rootNodeId","nodeCount","createdAt","updatedAt","isPublished","hasDraftChanges","publishedAt"]},"TriggerInfoDto":{"type":"object","properties":{"trigger":{"$ref":"#/components/schemas/FlowTrigger"},"name":{"type":"string"},"description":{"type":"string"},"subjectType":{"type":"string"},"isAvailable":{"type":"boolean"}},"required":["trigger","name","description","subjectType","isAvailable"]},"LocalizedTextDto":{"type":"object","properties":{"en":{"type":"string","description":"English label"},"nb":{"type":"string","description":"Norwegian bokmål label"}},"required":["en","nb"]},"EnumValueDto":{"type":"object","properties":{"value":{"type":"string","description":"Wire value of the enum member"},"labels":{"$ref":"#/components/schemas/LocalizedTextDto"}},"required":["value","labels"]},"CollectionItemFieldSchemaDto":{"type":"object","properties":{"path":{"type":"string","description":"Relative field path within a collection item (e.g., \"amount\", \"projectId\")"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Collection item field data type"},"label":{"type":"string","description":"Human-readable label (legacy, English; equals labels.en)"},"description":{"type":"string","description":"Optional description"},"labels":{"description":"Localized labels; \"en\" always equals \"label\"","allOf":[{"$ref":"#/components/schemas/LocalizedTextDto"}]},"descriptions":{"description":"Localized descriptions","allOf":[{"$ref":"#/components/schemas/LocalizedTextDto"}]},"enumValues":{"description":"For enum-like string fields: the closed value set with display labels","type":"array","items":{"$ref":"#/components/schemas/EnumValueDto"}},"refEntity":{"type":"string","enum":["department","project","user","category","account"],"description":"Entity kind this id-field references — render an entity picker"},"format":{"type":"string","enum":["amountMinor"],"description":"Value format hint. \"amountMinor\": integer minor currency units (øre)"}},"required":["path","type","label","labels"]},"ContextFieldSchemaDto":{"type":"object","properties":{"path":{"type":"string","description":"Dot-notation path (e.g., \"report.amount\")"},"type":{"type":"string","enum":["string","number","boolean","date","array"],"description":"Field data type"},"label":{"type":"string","description":"Human-readable label (legacy, English; equals labels.en)"},"description":{"type":"string","description":"Optional description"},"labels":{"description":"Localized labels; \"en\" always equals \"label\"","allOf":[{"$ref":"#/components/schemas/LocalizedTextDto"}]},"descriptions":{"description":"Localized descriptions","allOf":[{"$ref":"#/components/schemas/LocalizedTextDto"}]},"enumValues":{"description":"For enum-like string fields: the closed value set with display labels","type":"array","items":{"$ref":"#/components/schemas/EnumValueDto"}},"refEntity":{"type":"string","enum":["department","project","user","category","account"],"description":"Entity kind this id-field references — render an entity picker"},"format":{"type":"string","enum":["amountMinor"],"description":"Value format hint. \"amountMinor\": integer minor currency units (øre)"},"group":{"type":"string","description":"Group id for UI grouping; present in the schema response \"groups\" list"},"usage":{"type":"string","enum":["condition","action","all"],"description":"Usage hint for UI: \"condition\" (for rule filters), \"action\" (for templates), \"all\" (both). Defaults to \"all\"."},"itemFields":{"description":"For array fields only: available item fields for collection operators (ONE_OF/ALL/NONE).","type":"array","items":{"$ref":"#/components/schemas/CollectionItemFieldSchemaDto"}}},"required":["path","type","label","labels"]},"ContextFieldGroupDto":{"type":"object","properties":{"id":{"type":"string","description":"Stable group id that fields reference via their \"group\""},"labels":{"$ref":"#/components/schemas/LocalizedTextDto"},"order":{"type":"number","description":"Display order (ascending)"}},"required":["id","labels","order"]},"TriggerSchemaDto":{"type":"object","properties":{"trigger":{"$ref":"#/components/schemas/FlowTrigger"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ContextFieldSchemaDto"}},"groups":{"description":"Localized field groups referenced by field.group","type":"array","items":{"$ref":"#/components/schemas/ContextFieldGroupDto"}}},"required":["trigger","fields","groups"]},"FlowDomain":{"type":"string","enum":["REPORT"]},"DomainSchemaDto":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/FlowDomain"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ContextFieldSchemaDto"}},"groups":{"description":"Localized field groups referenced by field.group","type":"array","items":{"$ref":"#/components/schemas/ContextFieldGroupDto"}}},"required":["domain","fields","groups"]},"UpdateFlowDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/FlowTrigger"},"description":"Array of triggers that activate this flow","nullable":true},"isActive":{"type":"boolean"},"rootNodeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CreateFlowNodeDto"},"nullable":true}}},"ValidationErrorDto":{"type":"object","properties":{"nodeId":{"type":"string"},"field":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"object"}},"required":["message","severity"]},"FlowValidationResultDto":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorDto"}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorDto"}}},"required":["valid","errors","warnings"]},"FlowSimulationRequestDto":{"type":"object","properties":{"trigger":{"$ref":"#/components/schemas/FlowTrigger","nullable":true},"data":{"type":"object","additionalProperties":{},"description":"Test values keyed by dot-path field name, e.g. `{\"account.employeeNumber\": \"70043\"}`.","nullable":true},"continueAfterBlocking":{"type":"boolean","nullable":true}}},"NodeSimulationResultDto":{"type":"object","properties":{"nodeId":{"type":"string"},"nodeName":{"type":"string"},"nodeType":{"type":"string"},"result":{"type":"object","properties":{"type":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"blocking":{"type":"boolean"},"terminal":{"type":"boolean"},"branchMatched":{"type":"boolean"},"branchId":{"type":"string","nullable":true},"conditionMet":{"type":"boolean"},"data":{"type":"object"}},"required":[]},"nextNodeId":{"type":"string","nullable":true}},"required":["nodeId","nodeName","nodeType","result","nextNodeId"]},"FlowSimulationResultDto":{"type":"object","properties":{"flowId":{"type":"string"},"flowName":{"type":"string"},"status":{"type":"object"},"nodeResults":{"type":"array","items":{"$ref":"#/components/schemas/NodeSimulationResultDto"}},"blockedAtNodeId":{"type":"string"},"error":{"type":"string"},"cycles":{"type":"array","items":{"required":false,"type":"array","items":{"type":"string"}}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["flowId","flowName","status","nodeResults","cycles"]},"FlowTraceDto":{"type":"object","properties":{"id":{"type":"string"},"flowId":{"type":"string"},"subjectType":{"type":"string"},"subjectId":{"type":"string"},"status":{"type":"string","enum":["RUNNING","COMPLETED","FAILED","BLOCKED"]},"startedAt":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string","nullable":true},"error":{"type":"string","nullable":true},"_count":{"type":"object","properties":{"logs":{"type":"number"}}}},"required":["id","flowId","subjectType","subjectId","status","startedAt"]},"NodeSnapshotDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/FlowNodeType"},"config":{"type":"object","additionalProperties":true},"nextNodeId":{"type":"string","nullable":true}},"required":["id","name","type","config"]},"FlowTraceLogDto":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"nodeSnapshot":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/NodeSnapshotDto"}]},"enteredAt":{"format":"date-time","type":"string"},"exitedAt":{"format":"date-time","type":"string","nullable":true},"result":{"type":"object","nullable":true,"additionalProperties":true},"error":{"type":"string","nullable":true}},"required":["id","nodeId","enteredAt"]},"FlowTraceWithLogsDto":{"type":"object","properties":{"id":{"type":"string"},"flowId":{"type":"string"},"subjectType":{"type":"string"},"subjectId":{"type":"string"},"status":{"type":"string","enum":["RUNNING","COMPLETED","FAILED","BLOCKED"]},"startedAt":{"format":"date-time","type":"string"},"completedAt":{"format":"date-time","type":"string","nullable":true},"error":{"type":"string","nullable":true},"_count":{"type":"object","properties":{"logs":{"type":"number"}}},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FlowTraceLogDto"}}},"required":["id","flowId","subjectType","subjectId","status","startedAt","logs"]},"DuplicateGroupMemberDto":{"type":"object","properties":{"attachmentId":{"type":"string","description":"Attachment in the duplicate group"},"expenseId":{"type":"string","nullable":true,"description":"Expense id — null for another user's member (redacted)"},"reportId":{"type":"string","nullable":true,"description":"Report id — null for another user's member (redacted)"},"sameUser":{"type":"boolean","description":"True when this member belongs to the requesting user"},"isCanonical":{"type":"boolean","description":"True for the canonical (representative) member"},"joinedViaMethod":{"type":"string","enum":["EXACT_FILE","PERCEPTUAL","FIELD_MATCH","EMBEDDING","EXIF_ANOMALY","ELA_ANOMALY","C2PA_AI_ORIGIN","EMBEDDING_CLASSIFIER","SPECTRAL_ANOMALY","ENHANCED_EXIF"],"description":"High-precision method that placed this member in the group"},"joinedAt":{"format":"date-time","type":"string"}},"required":["attachmentId","sameUser","isCanonical","joinedViaMethod","joinedAt"]},"DuplicateGroupDto":{"type":"object","properties":{"id":{"type":"string"},"size":{"type":"number","description":"Number of attachments in the group"},"canonicalAttachmentId":{"type":"string","description":"Canonical (earliest) attachment id"},"merchant":{"type":"string","nullable":true},"businessDay":{"type":"string","nullable":true,"description":"Local calendar day 'yyyy-MM-dd'"},"amountIncludingVat":{"type":"string","nullable":true,"description":"Amount in minor units, as a string (BigInt-safe)"},"status":{"type":"string","enum":["PENDING","DISMISSED","CONFIRMED"],"description":"Group-level resolution status (duplicates are advisory)"},"resolvedByUserId":{"type":"string","nullable":true},"resolveReason":{"type":"string","nullable":true},"resolvedAt":{"format":"date-time","type":"string","nullable":true},"members":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateGroupMemberDto"}},"createdAt":{"format":"date-time","type":"string"}},"required":["id","size","canonicalAttachmentId","status","members","createdAt"]},"DismissMatchDto":{"type":"object","properties":{"reason":{"type":"string","enum":["FALSE_POSITIVE","LEGITIMATE_RESUBMISSION","KNOWN_DUPLICATE","OTHER"],"description":"Reason for dismissing the match"},"note":{"type":"string","maxLength":500,"description":"Additional notes about the dismissal","nullable":true}},"required":["reason"]},"ConfirmMatchDto":{"type":"object","properties":{"note":{"type":"string","maxLength":500,"description":"Additional notes about the confirmation","nullable":true}}},"DuplicateGroupResolutionDto":{"type":"object","properties":{"id":{"type":"string"},"duplicateGroupId":{"type":"string"},"action":{"type":"string","enum":["DISMISSED","CONFIRMED","UNRESOLVED"]},"reason":{"type":"string"},"userId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","duplicateGroupId","action","userId","createdAt"]},"DisburseAdvanceDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"maximum":9007199254740991},"idempotencyKey":{"type":"string","minLength":1,"maxLength":76},"occurredAt":{"type":"string","nullable":true},"externalRef":{"type":"string","maxLength":255,"nullable":true}},"required":["amount","idempotencyKey"]},"AdvanceKind":{"type":"string","enum":["SOKNAD","OPENING"]},"AdvanceCanceledReason":{"type":"string","enum":["REQUEST_WITHDRAWN","REQUEST_REJECTED","MANUAL"]},"AdvanceEntity":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountId":{"type":"string"},"kind":{"$ref":"#/components/schemas/AdvanceKind"},"travelRequestId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"$ref":"#/components/schemas/AdvanceStatus"},"grantedById":{"type":"string"},"grantedAt":{"format":"date-time","type":"string"},"canceledAt":{"format":"date-time","type":"string"},"canceledReason":{"$ref":"#/components/schemas/AdvanceCanceledReason"},"grantNotifiedAt":{"format":"date-time","type":"string"},"grantNotifiedAmount":{"format":"int64","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"reportDepartmentId":{"type":"string"}},"required":["id","organizationId","accountId","kind","amount","currency","status","grantedAt","createdAt","updatedAt"]},"RepayAdvanceDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"maximum":9007199254740991},"idempotencyKey":{"type":"string","minLength":1,"maxLength":76},"occurredAt":{"type":"string","nullable":true},"externalRef":{"type":"string","maxLength":255,"nullable":true}},"required":["amount","idempotencyKey"]},"AdvanceAdjustReason":{"type":"string","enum":["CORRECTION","PAYROLL_DEDUCTION","RECOVERY_WAIVED"]},"AdjustAdvanceDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed, non-zero minor units"},"reasonCode":{"$ref":"#/components/schemas/AdvanceAdjustReason"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":76},"externalRef":{"type":"string","maxLength":255,"nullable":true}},"required":["amount","reasonCode","idempotencyKey"]},"WriteOffAdvanceDto":{"type":"object","properties":{"reasonCode":{"$ref":"#/components/schemas/AdvanceAdjustReason"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":76},"externalRef":{"type":"string","maxLength":255,"nullable":true}},"required":["reasonCode","idempotencyKey"]},"AdvanceBalanceDto":{"type":"object","properties":{"currency":{"type":"string"},"amount":{"type":"number"}},"required":["currency","amount"]},"AdvanceTransactionType":{"type":"string","enum":["DISBURSED","SETTLED","REVERSED","REPAID","ADJUSTED","WRITTEN_OFF"]},"AdvanceTransactionSource":{"type":"string","enum":["MANUAL","SYSTEM","INTEGRATION"]},"AccountAdvanceTransactionDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/AdvanceTransactionType"},"amount":{"type":"number"},"currency":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"source":{"$ref":"#/components/schemas/AdvanceTransactionSource"},"reportId":{"type":"string","nullable":true},"reversesId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"reasonCode":{"nullable":true,"$ref":"#/components/schemas/AdvanceAdjustReason"},"createdById":{"type":"string","nullable":true}},"required":["id","type","amount","currency","occurredAt","source","reportId","reversesId","externalRef","reasonCode","createdById"]},"AccountAdvanceDto":{"type":"object","properties":{"id":{"type":"string"},"kind":{"description":"`SOKNAD` — granted on an approved reisesøknad. `OPENING` — a balance carried over from the previous system, with no søknad behind it.","$ref":"#/components/schemas/AdvanceKind"},"travelRequestReportId":{"type":"string","nullable":true,"description":"The søknad-report this item was granted on; `null` on an `OPENING` item."},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"description":"Folded from the same ledger rows as `openBalance`, so the two can never disagree — not the stored column.","$ref":"#/components/schemas/AdvanceStatus"},"grantedAt":{"type":"string","format":"date-time"},"grantedById":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true,"format":"date-time"},"canceledReason":{"nullable":true,"$ref":"#/components/schemas/AdvanceCanceledReason"},"openBalance":{"type":"number"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/AccountAdvanceTransactionDto"}}},"required":["id","kind","travelRequestReportId","amount","currency","status","grantedAt","grantedById","canceledAt","canceledReason","openBalance","transactions"]},"AccountAdvancesDto":{"type":"object","properties":{"balances":{"description":"The person's saldo per currency, netted by the database over EVERY ledger row of theirs in the organization — not just the page below, so a client never sums pages.","type":"array","items":{"$ref":"#/components/schemas/AdvanceBalanceDto"}},"advances":{"description":"One page of the account's advances, newest grant first (`grantedAt` desc, `id` desc).","type":"array","items":{"$ref":"#/components/schemas/AccountAdvanceDto"}},"nextCursor":{"type":"string","nullable":true,"description":"Opaque continuation token — pass it back as `cursor` for the next page; `null` on the last page."}},"required":["balances","advances","nextCursor"]},"OpeningAdvanceDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"maximum":9007199254740991},"idempotencyKey":{"type":"string","minLength":1,"maxLength":76},"occurredAt":{"type":"string","description":"The date the balance was carried over. Becomes both `grantedAt` on the item and `occurredAt` on its DISBURSED row — an opening balance's age is what puts it in the oldest-first clearing order."},"externalRef":{"type":"string","minLength":1,"maxLength":255,"description":"The previous system's reference for this balance."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Defaults to the holder's effective base currency. When supplied, it must equal that effective base currency.","nullable":true}},"required":["amount","idempotencyKey","occurredAt","externalRef"]},"FxQuoteRequestDto":{"type":"object","properties":{"reportId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"currency":{"type":"string"},"date":{"$ref":"#/components/schemas/RequestDate"}},"required":["currency"],"additionalProperties":false},"FxQuoteDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["NORGES_BANK","IDENTITY"]},"from":{"type":"string"},"to":{"type":"string"},"rate":{"type":"number"},"requestedDate":{"allOf":[{"$ref":"#/components/schemas/RequestDate"}],"nullable":true},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"observations":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"number"},"date":{"type":"string"},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["currency","rate","date","retrievedAt"]}}},"required":["id","provider","from","to","rate","requestedDate","retrievedAt","expiresAt","observations"]},"ReceiptRemainderProposalDto":{"type":"object","properties":{"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"captureId":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"minimum":0},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"evidenceHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expectedCostsRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"documentTotal":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"claimedAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"remainingAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"declinedUnpriced":{"default":false,"type":"boolean"}},"required":["expenseId","attachmentId","captureId","sha256","evidenceHash","expectedCostsRevision","currency","documentTotal","claimedAmount","remainingAmount"],"additionalProperties":false},"ReceiptRemainderPreviewDto":{"type":"object","properties":{"proposal":{"allOf":[{"$ref":"#/components/schemas/ReceiptRemainderProposalDto"}],"nullable":true}},"required":["proposal"]},"ReceiptRemainderSuggestionDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"description":{"type":"string"},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"categoryTitle":{"type":"string","nullable":true},"sourceText":{"type":"string"}},"required":["amount","description","sourceText"]},"ReceiptRemainderSuggestionsDto":{"type":"object","properties":{"proposal":{"$ref":"#/components/schemas/ReceiptRemainderProposalDto"},"status":{"type":"string","enum":["SUGGESTED","MANUAL"]},"merchant":{"type":"string","nullable":true},"date":{"type":"string","nullable":true},"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ReceiptRemainderSuggestionDto"}}},"required":["proposal","status","organizationId","expenses"]},"ReceiptRemainderDeclineDto":{"type":"object","properties":{"proposal":{"$ref":"#/components/schemas/ReceiptRemainderProposalDto"},"reason":{"type":"string","enum":["PRIVATE","OTHER"]}},"required":["proposal","reason"],"additionalProperties":false},"ExpenseCostDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":0,"maximum":99},"description":{"type":"string","maxLength":512,"nullable":true},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"role":{"type":"string","enum":["GENERAL","LODGING","BREAKFAST"]},"grossAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"},"taxState":{"type":"string","enum":["UNKNOWN","KNOWN"]},"taxComponents":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["VAT"]},"jurisdiction":{"type":"string","maxLength":16,"nullable":true},"ratePercent":{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,4})?$","nullable":true},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"}},"required":["id","kind","amount"],"additionalProperties":false}},"dimensions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"definitionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valueId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["definitionId","valueId"],"additionalProperties":false}}},"required":["id","position","role","grossAmount","taxState","taxComponents","dimensions"],"additionalProperties":false},"ExpenseCostsDto":{"type":"object","properties":{"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costsRevision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"header":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","nullable":true},"dateHasTime":{"type":"boolean","nullable":true},"dateTimeZone":{"type":"string","maxLength":64,"nullable":true},"paymentMethod":{"type":"string","enum":["CARD","COMPANY_CARD","INVOICE","WALLET",null],"nullable":true},"paymentCardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"walletId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true}},"required":["amount","currency","date","dateHasTime","dateTimeZone","paymentMethod","paymentCardId","walletId"],"additionalProperties":false},"costs":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseCostDto"}},"baseCurrency":{"type":"string"},"exchangeRate":{"type":"string"},"exchangeRateSource":{"type":"string","enum":["SERVICE","MANUAL",null],"nullable":true},"fxSnapshot":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"mode":{"type":"string","enum":["AUTO","MANUAL"]},"currency":{"type":"string"},"baseCurrency":{"type":"string"},"appliedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"quote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["NORGES_BANK","IDENTITY"]},"from":{"type":"string"},"to":{"type":"string"},"rate":{"type":"number"},"requestedDate":{"allOf":[{"$ref":"#/components/schemas/RequestDate"}],"nullable":true},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"observations":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"number"},"date":{"type":"string"},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["currency","rate","date","retrievedAt"]}}},"required":["id","provider","from","to","rate","requestedDate","retrievedAt","expiresAt","observations"]},"referenceQuote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["NORGES_BANK","IDENTITY"]},"from":{"type":"string"},"to":{"type":"string"},"rate":{"type":"number"},"requestedDate":{"allOf":[{"$ref":"#/components/schemas/RequestDate"}],"nullable":true},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"observations":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"number"},"date":{"type":"string"},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["currency","rate","date","retrievedAt"]}}},"required":["id","provider","from","to","rate","requestedDate","retrievedAt","expiresAt","observations"]},"basis":{"type":"string","enum":["RATE","BASE_AMOUNT"]},"inheritedCharge":{"type":"object","properties":{"originalAmount":{"type":"number"},"baseAmount":{"type":"number"}},"required":["originalAmount","baseAmount"]},"originalAmount":{"type":"number"},"baseAmount":{"type":"number"},"reason":{"type":"string"},"actorId":{"type":"string","nullable":true},"actorType":{"type":"string"}},"required":["version","mode","currency","baseCurrency","appliedAt"],"nullable":true},"minorUnitScale":{"type":"string"},"amountInBaseCurrency":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"},"baseAmounts":{"type":"object","additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"}}},"required":["expenseId","costsRevision","header","costs","baseCurrency","exchangeRate","minorUnitScale","amountInBaseCurrency","baseAmounts"]},"ReceiptRemainderCostDto":{"type":"object","properties":{"costId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"description":{"type":"string","minLength":1,"maxLength":512}},"required":["costId","amount","description"],"additionalProperties":false},"ReceiptRemainderWriteDto":{"type":"object","properties":{"additionalCosts":{"type":"array","maxItems":19,"items":{"$ref":"#/components/schemas/ReceiptRemainderCostDto"}},"proposal":{"$ref":"#/components/schemas/ReceiptRemainderProposalDto"},"costId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"description":{"type":"string","minLength":1,"maxLength":512}},"required":["proposal","costId","amount","description"],"additionalProperties":false},"CreateExpenseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reportId":{"type":"string"},"accountId":{"type":"string"},"wrapperId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"format":"date-time","type":"string","nullable":true},"dateTimeZone":{"type":"string","nullable":true},"dateHasTime":{"type":"boolean","nullable":true},"amount":{"type":"integer","format":"int64"},"description":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"departmentId":{"type":"string","nullable":true},"categoryId":{"type":"string","nullable":true},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod","nullable":true},"paymentCardId":{"type":"string","nullable":true},"walletId":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"exchangeRate":{"type":"number","minimum":0.000001,"maximum":1000000,"nullable":true},"isManualExchangeRate":{"type":"boolean","deprecated":true,"description":"Legacy compatibility field; new clients use fx. True only when the user typed exchangeRate in this edit. Requires a rate, which takes precedence even when it equals the stored value. Omit both for a server quote; omit the flag when echoing a read model.","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false}]},"title":{"type":"string","nullable":true},"merchant":{"type":"string","maxLength":191,"nullable":true},"vatRate":{"type":"number","nullable":true},"vatAmount":{"type":"integer","format":"int64"},"isVatDeductible":{"type":"boolean","nullable":true}}},"ExpenseCurrencyDto":{"type":"object","properties":{"code":{"type":"string","example":"NOK"},"exponent":{"type":"number","example":2},"autoQuoted":{"type":"boolean","description":"Whether a rate for this currency can be quoted automatically. False means the\nuser must supply the exchange rate.","example":true}},"required":["code","exponent","autoQuoted"]},"ExchangeRateDto":{"type":"object","properties":{"currency":{"type":"string"},"baseCurrency":{"type":"string"},"date":{"$ref":"#/components/schemas/RequestDate"}},"required":["currency","date"]},"UpdateExpenseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reportId":{"type":"string","nullable":true},"accountId":{"type":"string","nullable":true},"date":{"format":"date-time","type":"string","nullable":true},"dateTimeZone":{"type":"string","nullable":true},"dateHasTime":{"type":"boolean","nullable":true},"amount":{"type":"integer","format":"int64"},"description":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"departmentId":{"type":"string","nullable":true},"categoryId":{"type":"string","nullable":true},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod","nullable":true},"paymentCardId":{"type":"string","nullable":true},"walletId":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"exchangeRate":{"type":"number","minimum":0.000001,"maximum":1000000,"nullable":true},"isManualExchangeRate":{"type":"boolean","deprecated":true,"description":"Legacy compatibility field; new clients use fx. True only when the user typed exchangeRate in this edit. Requires a rate, which takes precedence even when it equals the stored value. Omit both for a server quote; omit the flag when echoing a read model.","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["KEEP"]}},"required":["mode"],"additionalProperties":false}]},"title":{"type":"string","nullable":true},"merchant":{"type":"string","maxLength":191,"nullable":true},"vatRate":{"type":"number","nullable":true},"vatAmount":{"type":"integer","format":"int64"},"isVatDeductible":{"type":"boolean","nullable":true},"paymentDefaultOnly":{"type":"boolean","nullable":true},"paymentDefaultAttachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true}}},"UploadAttachmentIntentDto":{"type":"object","properties":{"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"captureRef":{"type":"string","format":"uuid","maxLength":64},"ocrText":{"type":"string"},"performCapture":{"type":"string"},"deviceTimeZone":{"type":"string","description":"IANA timezone of the capturing device (e.g. Europe/Oslo). Used to resolve the receipt date to a true UTC instant."},"populateExpense":{"type":"string","enum":["none","empty","all"]}},"required":["attachmentId","expenseId"]},"UploadAttachmentRequestDto":{"type":"object","properties":{"expenseId":{"type":"string"},"cashExpenseId":{"type":"string","deprecated":true,"description":"Use expenseId instead."},"correlationId":{"type":"string","deprecated":true,"description":"No longer used. Attachment Captures are now linked automatically."},"performCapture":{"type":"string"},"performScan":{"type":"string","deprecated":true,"description":"Deprecated alias for performCapture. Use performCapture instead."},"ocrText":{"type":"string"},"captureRef":{"type":"string","format":"uuid","maxLength":64},"populateExpense":{"type":"string","enum":["none","empty","all"]},"deviceTimeZone":{"type":"string","description":"IANA timezone of the capturing device (e.g. Europe/Oslo). Used to resolve the receipt date to a true UTC instant."},"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"AttachmentUploadTargetDto":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Form fields to send verbatim, in order, before the `file` part."},"expiresAt":{"type":"string","format":"date-time","description":"After this the form is refused. Replay the intent for a fresh one."}},"required":["url","fields","expiresAt"]},"UploadAttachmentResponseDto":{"type":"object","properties":{"id":{"type":"string"},"storageKey":{"type":"string"},"expenseId":{"type":"string"},"status":{"$ref":"#/components/schemas/AttachmentStatus"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"ocrText":{"type":"string"},"amountIncludingVat":{"format":"int64","type":"integer"},"amountExcludingVat":{"format":"int64","type":"integer"},"vatRate":{"type":"number"},"vatAmount":{"format":"int64","type":"integer"},"currency":{"type":"string"},"date":{"format":"date-time","type":"string"},"dateTimeZone":{"type":"string"},"dateTimeZoneSource":{"$ref":"#/components/schemas/DateTimeZoneSource"},"dateHasTime":{"type":"boolean"},"merchant":{"type":"string"},"description":{"type":"string"},"categoryId":{"type":"string"},"splitFromAttachmentId":{"type":"string"},"sha256":{"type":"string"},"pHash":{"type":"string"},"dHash":{"type":"string"},"embeddingId":{"type":"string"},"captures":{"description":"The most recent Attachment Capture record for this attachment","type":"array","items":{"$ref":"#/components/schemas/Capture"}},"autofill":{"type":"object","description":"Autofill outcome for the attachment upload request, including skip reason when expense fields were not applied."},"upload":{"description":"Present only for an upload intent (`Content-Type: application/json`): where to POST the bytes. Absent on the multipart route, which already carried them.","allOf":[{"$ref":"#/components/schemas/AttachmentUploadTargetDto"}]},"captureAdoption":{"type":"string","enum":["hit","miss"],"description":"Present iff the request carried a `captureRef`, and only on the write that first spent it: whether the scan was adopted. A replayed intent reports nothing, because nothing was adopted this time."},"url":{"type":"string"},"expense":{"$ref":"#/components/schemas/ExpenseEntity"}},"required":["id","storageKey","expenseId","status","createdAt","updatedAt","dateHasTime"]},"CostDeclinedEntryDto":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["ITEM"]},"itemizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","enum":["PRIVATE","OTHER"]}},"required":["kind","itemizationId","itemId","reason"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["BALANCE"]},"amount":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991,"format":"int64","minimum":0},"reason":{"type":"string","enum":["PRIVATE","OTHER"]}},"required":["kind","amount","reason"],"additionalProperties":false}]},"CostSplitContextDto":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"schemaVersion":{"type":"number","enum":[1]},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"selections":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"numerator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"},"denominator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"}},"required":["itemizationId","itemId","numerator","denominator"],"additionalProperties":false}},"adjustments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":500},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"}},"required":["description","amount"],"additionalProperties":false}},"basis":{"type":"string"},"status":{"type":"string","enum":["CURRENT","STALE","UNAVAILABLE"]}},"required":["id","costIds","selections","adjustments","basis","status"],"additionalProperties":false}},"declined":{"type":"array","default":[],"maxItems":100,"items":{"$ref":"#/components/schemas/CostDeclinedEntryDto"}},"snapshots":{"type":"array","items":{"type":"object","properties":{"itemizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["itemizationId","attachmentId"]}}},"required":["version","schemaVersion","groups"]},"CostDimensionCatalogDto":{"type":"object","properties":{"nextDefinitionCursor":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["PROJECT","DEPARTMENT","CUSTOM"]},"nextCursor":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true}},"required":["id","title","projectId","departmentId"]}}},"required":["id","key","title","kind","values"]}}},"required":["definitions"]},"CostsWriteDto":{"type":"object","properties":{"splitContext":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"groups":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"selections":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"numerator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"},"denominator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"}},"required":["itemizationId","itemId","numerator","denominator"],"additionalProperties":false}},"adjustments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":500},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"}},"required":["description","amount"],"additionalProperties":false}}},"required":["id","costIds","selections","adjustments"],"additionalProperties":false}},"declined":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/CostDeclinedEntryDto"}}},"required":["expectedVersion","groups"],"additionalProperties":false,"nullable":true},"expectedSplitContextVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedCostsRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"header":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","nullable":true},"dateHasTime":{"type":"boolean","nullable":true},"dateTimeZone":{"type":"string","maxLength":64,"nullable":true},"paymentMethod":{"type":"string","enum":["CARD","COMPANY_CARD","INVOICE","WALLET",null],"nullable":true},"paymentCardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"walletId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["KEEP"]}},"required":["mode"],"additionalProperties":false}]}},"required":["amount","currency","date","dateHasTime","dateTimeZone","paymentMethod","paymentCardId","walletId","fx"],"additionalProperties":false},"costs":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/ExpenseCostDto"}}},"required":["expectedCostsRevision","header","costs"],"additionalProperties":false},"CostsCreateDto":{"type":"object","properties":{"splitContext":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"groups":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"selections":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"numerator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"},"denominator":{"type":"string","pattern":"^[1-9]\\d{0,8}$"}},"required":["itemizationId","itemId","numerator","denominator"],"additionalProperties":false}},"adjustments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":500},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"}},"required":["description","amount"],"additionalProperties":false}}},"required":["id","costIds","selections","adjustments"],"additionalProperties":false}},"declined":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/CostDeclinedEntryDto"}}},"required":["expectedVersion","groups"],"additionalProperties":false,"nullable":true},"expectedSplitContextVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"header":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","nullable":true},"dateHasTime":{"type":"boolean","nullable":true},"dateTimeZone":{"type":"string","maxLength":64,"nullable":true},"paymentMethod":{"type":"string","enum":["CARD","COMPANY_CARD","INVOICE","WALLET",null],"nullable":true},"paymentCardId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"walletId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"fx":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["AUTO"]},"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL"]},"exchangeRate":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,6})?$"},"baseAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","minLength":1,"maxLength":512},"referenceQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","reason"],"additionalProperties":false}]}},"required":["amount","currency","date","dateHasTime","dateTimeZone","paymentMethod","paymentCardId","walletId","fx"],"additionalProperties":false},"costs":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/ExpenseCostDto"}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reportId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","maxLength":255},"description":{"type":"string","maxLength":2000},"from":{"type":"object","properties":{"expenseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"costIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"expectedCostsRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"mode":{"default":"MOVE","type":"string","enum":["MOVE","COPY"]}},"required":["expenseId","costIds","expectedCostsRevision"],"additionalProperties":false}},"required":["id","reportId"],"additionalProperties":false},"AttachmentItemDto":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":512},"quantity":{"type":"string","pattern":"^-?\\d{1,16}(\\.\\d{1,8})?$","nullable":true},"unit":{"type":"string","maxLength":32,"nullable":true},"unitPrice":{"type":"string","pattern":"^-?\\d{1,16}(\\.\\d{1,8})?$","nullable":true},"extendedAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64","nullable":true},"amountBasis":{"type":"string","enum":["GROSS","NET","UNKNOWN"]},"taxAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64","nullable":true},"taxRate":{"type":"string","pattern":"^\\d{1,3}(\\.\\d{1,4})?$","nullable":true},"sourcePage":{"type":"integer","minimum":1,"maximum":1000,"nullable":true},"sourceText":{"type":"string","maxLength":1024,"nullable":true},"warnings":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":120}},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ordinal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantity","unit","unitPrice","extendedAmount","amountBasis","taxAmount","taxRate","sourcePage","sourceText","warnings","id","ordinal"],"additionalProperties":false},"AttachmentItemizationDto":{"type":"object","properties":{"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["NOT_REQUESTED","PENDING","AVAILABLE","PARTIAL","UNAVAILABLE","FAILED"]},"latestAttemptStatus":{"type":"string","enum":["PENDING","AVAILABLE","PARTIAL","UNAVAILABLE","FAILED",null],"nullable":true},"snapshotId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","nullable":true},"generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"schemaVersion":{"type":"number","enum":[1]},"documentCurrency":{"type":"string","nullable":true},"documentTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64","nullable":true},"reconciliation":{"type":"string","enum":["RECONCILED","MISMATCH","UNKNOWN","PARTIAL",null],"nullable":true},"difference":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentItemDto"}},"adjustments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["DISCOUNT","SHIPPING","SERVICE","TIP","ROUNDING","DEPOSIT","RETURN","UNKNOWN"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"format":"int64","nullable":true},"inclusion":{"type":"string","enum":["ALREADY_INCLUDED","ADD_TO_TOTAL","UNKNOWN"]}},"required":["kind","amount","inclusion"],"additionalProperties":false}}},"required":["attachmentId","status","latestAttemptStatus","snapshotId","generation","schemaVersion","documentCurrency","documentTotal","reconciliation","difference","items","adjustments"]},"AttachmentItemizationRequestDto":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reextract":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false},"GetStatisticsDto":{"type":"object","properties":{"from":{"type":"string","description":"From date","format":"date-time"},"to":{"type":"string","description":"To date","format":"date-time"}}},"GetUsageStatisticsDto":{"type":"object","properties":{"from":{"type":"string","description":"From date","format":"date-time"},"to":{"type":"string","description":"To date","format":"date-time"},"organizationId":{"type":"string","description":"Organization id"}},"required":["organizationId"]},"MonthlyUsageStatistic":{"type":"object","properties":{"organizationId":{"type":"string"},"date":{"format":"date-time","type":"string"},"expensesCount":{"type":"number"},"drivesCount":{"type":"number"},"travelsCount":{"type":"number"},"totalUsageCount":{"type":"number"}},"required":["organizationId","date","expensesCount","drivesCount","travelsCount","totalUsageCount"]},"Statistic":{"type":"object","properties":{"reportsDraftCount":{"type":"number"},"reportsPendingCount":{"type":"number"},"reportsApprovedCount":{"type":"number"},"reportsRejectedCount":{"type":"number"},"date":{"format":"date-time","type":"string"},"id":{"type":"string"},"usersCount":{"type":"number"},"expensesCount":{"type":"number"},"travelsCount":{"type":"number"},"drivesCount":{"type":"number"},"organizationsCount":{"type":"number"},"personalOrganizationsCount":{"type":"number"},"departmentsCount":{"type":"number"},"invoicesCount":{"type":"number"},"accountsCount":{"type":"number"},"freeSubscriptionsCount":{"type":"number"},"paidSubscriptionsCount":{"type":"number"}},"required":["reportsDraftCount","reportsPendingCount","reportsApprovedCount","reportsRejectedCount","date","id","usersCount","expensesCount","travelsCount","drivesCount","organizationsCount","personalOrganizationsCount","departmentsCount","invoicesCount","accountsCount","freeSubscriptionsCount","paidSubscriptionsCount"]},"PlanBreakdownItem":{"type":"object","properties":{"productName":{"type":"string"},"count":{"type":"number"},"mrr":{"type":"number"}},"required":["productName","count","mrr"]},"EnterpriseBreakdownItem":{"type":"object","properties":{"enterpriseId":{"type":"string"},"enterpriseName":{"type":"string"},"orgCount":{"type":"number"},"mrr":{"type":"number"}},"required":["enterpriseId","enterpriseName","orgCount","mrr"]},"SubscriptionStatistic":{"type":"object","properties":{"customersByPlan":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/PlanBreakdownItem"}},"customersByEnterprise":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/EnterpriseBreakdownItem"}},"mrrBySubscription":{"type":"object","additionalProperties":{"type":"number"},"nullable":true},"id":{"type":"string"},"date":{"format":"date-time","type":"string"},"mrr":{"type":"number"},"arr":{"type":"number"},"fixedMrr":{"type":"number"},"usageMrr":{"type":"number"},"newMrr":{"type":"number"},"expansionMrr":{"type":"number"},"contractionMrr":{"type":"number"},"churnedMrr":{"type":"number"},"activeCount":{"type":"number"},"payingCount":{"type":"number"},"trialingCount":{"type":"number"},"canceledCount":{"type":"number"},"pendingChurnCount":{"type":"number"},"churnRate":{"type":"number"},"revenueChurnBps":{"type":"number"},"nrr":{"type":"number"},"trialConversionRate":{"type":"number"}},"required":["customersByPlan","customersByEnterprise","mrrBySubscription","id","date","mrr","arr","fixedMrr","usageMrr","newMrr","expansionMrr","contractionMrr","churnedMrr","activeCount","payingCount","trialingCount","canceledCount","pendingChurnCount","churnRate","revenueChurnBps","nrr","trialConversionRate"]},"DietSchemeEntity":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isBuiltIn":{"type":"boolean"},"ownerOrganizationId":{"type":"string"},"draftConfig":{"type":"object","additionalProperties":true},"publishedConfig":{"type":"object","additionalProperties":true,"nullable":true},"publishedAt":{"format":"date-time","type":"string"},"currentVersionId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"}},"required":["id","name","isBuiltIn","draftConfig","createdAt","updatedAt"]},"CreateDietSchemeDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":2000,"nullable":true},"draftConfig":{"type":"object","additionalProperties":{},"description":"Optional initial draft config. Validated up-front — an obviously-broken config never lands as a draft. Defaults to the empty STATENS deck when omitted.","nullable":true}},"required":["name"]},"UpdateDietSchemeDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":2000,"nullable":true},"draftConfig":{"type":"object","additionalProperties":{},"description":"Replacement draft config. Validated inline (same parser publish uses) so the UI preview reflects what publish will accept.","nullable":true}}},"PublishDietSchemeDto":{"type":"object","properties":{"changeNote":{"type":"string","maxLength":500,"description":"Human-readable note attached to this version (e.g. \"Add 25 % long-stay override\"). Stored on `DietSchemeVersion.changeNote`.","nullable":true}}},"DietSchemeVersionEntity":{"type":"object","properties":{"id":{"type":"string"},"dietSchemeId":{"type":"string"},"version":{"type":"number"},"config":{"type":"object","additionalProperties":true},"publishedAt":{"format":"date-time","type":"string"},"publishedBy":{"type":"string"},"changeNote":{"type":"string"}},"required":["id","dietSchemeId","version","config","publishedAt"]},"PublishDietSchemeResponseDto":{"type":"object","properties":{"scheme":{"$ref":"#/components/schemas/DietSchemeEntity"},"version":{"$ref":"#/components/schemas/DietSchemeVersionEntity"}},"required":["scheme","version"]},"OrganizationDietSchemeEntity":{"type":"object","properties":{"organizationId":{"type":"string"},"dietSchemeId":{"type":"string"},"priority":{"type":"number"},"appliesWhen":{"type":"object","additionalProperties":true,"nullable":true},"effectiveFrom":{"format":"date-time","type":"string"},"effectiveTo":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"}},"required":["organizationId","dietSchemeId","priority","createdAt"]},"CreateDietSchemeAssignmentDto":{"type":"object","properties":{"dietSchemeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"priority":{"type":"integer","description":"Higher priority wins when several assignments match at recalc time; the resolver breaks ties by `dietSchemeId` ASC.","default":0,"minimum":-9007199254740991,"maximum":9007199254740991},"appliesWhen":{"type":"object","additionalProperties":{},"description":"`{all: [{field, operator, value}]}` predicate over create-time-stable facts (organizationId, accountRole, departmentId). Null / omitted = applies unconditionally. Rejected upfront on any field not in the resolver context or any operator outside the closed set.","nullable":true},"effectiveFrom":{"type":"string","description":"Assignment activates on or after this ISO date-time (inclusive). Null / omitted = unbounded on this side.","nullable":true},"effectiveTo":{"type":"string","description":"Assignment deactivates strictly after this ISO date-time (inclusive). Null / omitted = unbounded on this side. Must be >= effectiveFrom when both are set.","nullable":true}},"required":["dietSchemeId"]},"PatchDietSchemeAssignmentDto":{"type":"object","properties":{"priority":{"type":"integer","description":"Higher priority wins when several assignments match at recalc time; the resolver breaks ties by `dietSchemeId` ASC.","default":0,"minimum":-9007199254740991,"maximum":9007199254740991},"appliesWhen":{"type":"object","additionalProperties":{},"description":"`{all: [{field, operator, value}]}` predicate over create-time-stable facts (organizationId, accountRole, departmentId). Null / omitted = applies unconditionally. Rejected upfront on any field not in the resolver context or any operator outside the closed set.","nullable":true},"effectiveFrom":{"type":"string","description":"Assignment activates on or after this ISO date-time (inclusive). Null / omitted = unbounded on this side.","nullable":true},"effectiveTo":{"type":"string","description":"Assignment deactivates strictly after this ISO date-time (inclusive). Null / omitted = unbounded on this side. Must be >= effectiveFrom when both are set.","nullable":true}}},"DriveWaypointDto":{"type":"object","properties":{"placeId":{"type":"string","maxLength":255,"nullable":true},"lat":{"type":"number","minimum":-90,"maximum":90,"nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"nullable":true}}},"CalculateDriveDistanceDto":{"type":"object","properties":{"placeIds":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string"},"nullable":true},"waypoints":{"minItems":2,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/DriveWaypointDto"},"nullable":true}}},"DriveLegDistanceDto":{"type":"object","properties":{"polyline":{"type":"string","description":"This leg’s geometry, Google’s encoded polyline format (precision 5). Transient: it is never stored server-side and must not be persisted client-side beyond the session. Google’s terms forbid storing route geometry. Google’s terms forbid drawing it on a non-Google map."},"distanceMeters":{"type":"number"}},"required":["distanceMeters"]},"DriveDistanceResponseDto":{"type":"object","properties":{"polyline":{"type":"string","description":"The whole route’s geometry, Google’s encoded polyline format (precision 5). Transient: it is never stored server-side and must not be persisted client-side beyond the session. Google’s terms forbid storing route geometry. Google’s terms forbid drawing it on a non-Google map."},"distanceMeters":{"type":"number"},"legs":{"type":"array","items":{"$ref":"#/components/schemas/DriveLegDistanceDto"}}},"required":["distanceMeters"]},"DriveStopDto":{"type":"object","properties":{"place":{"allOf":[{"$ref":"#/components/schemas/PlaceInputDto"}],"nullable":true},"address":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use place.name","nullable":true},"placeId":{"type":"string","maxLength":255,"deprecated":true,"description":"Deprecated: use place.providerPlaceId","nullable":true},"source":{"$ref":"#/components/schemas/PlaceSource","nullable":true,"deprecated":true,"description":"Deprecated: use place.source. MAP_SEARCH requires a placeId, MAP_PIN requires lat+lng, MANUAL must not carry a placeId. Omitted: inferred as MAP_SEARCH when a placeId is present, otherwise null = unknown."},"lat":{"type":"number","minimum":-90,"maximum":90,"deprecated":true,"description":"Deprecated: use place.lat","nullable":true},"lng":{"type":"number","minimum":-180,"maximum":180,"deprecated":true,"description":"Deprecated: use place.lng","nullable":true}}},"CreateDriveDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reportId":{"type":"string"},"accountId":{"type":"string"},"stops":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/DriveStopDto"},"nullable":true},"distance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"distanceSource":{"$ref":"#/components/schemas/DistanceSource","nullable":true,"description":"Provenance of a client-sent distance. ROUTE = computed by a map routing service, whether this API routed the stops (POST /drives/distance) or the client ran its own routing call. MANUAL = typed by a person. The server records ROUTE itself when it does the routing. Omitted: null = unknown."},"returnTrip":{"type":"boolean"},"tollAmount":{"type":"integer","format":"int64"},"vehicle":{"type":"string","maxLength":255,"nullable":true},"shouldCalculateToll":{"type":"boolean"},"departmentId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"date":{"format":"date-time","type":"string","nullable":true},"description":{"type":"string","maxLength":512,"nullable":true},"passengerNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passengerNames":{"type":"string","maxLength":255,"nullable":true},"isOffroad":{"type":"boolean"},"hasTrailer":{"type":"boolean"}}},"UpdateDriveDto":{"type":"object","properties":{"reportId":{"type":"string"},"stops":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/DriveStopDto"},"nullable":true},"distance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"distanceSource":{"$ref":"#/components/schemas/DistanceSource","nullable":true,"description":"Provenance of a client-sent distance. ROUTE = computed by a map routing service, whether this API routed the stops (POST /drives/distance) or the client ran its own routing call. MANUAL = typed by a person. The server records ROUTE itself when it does the routing. Omitted: null = unknown."},"returnTrip":{"type":"boolean"},"tollAmount":{"type":"integer","format":"int64"},"vehicle":{"type":"string","maxLength":255,"nullable":true},"shouldCalculateToll":{"type":"boolean"},"departmentId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"date":{"format":"date-time","type":"string","nullable":true},"description":{"type":"string","maxLength":512,"nullable":true},"passengerNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passengerNames":{"type":"string","maxLength":255,"nullable":true},"isOffroad":{"type":"boolean"},"hasTrailer":{"type":"boolean"}}},"QuoteDriveTollDto":{"type":"object","properties":{"from":{"type":"object","properties":{"placeId":{"type":"string","minLength":1,"maxLength":512},"name":{"default":"","type":"string","maxLength":512}},"required":["placeId"],"additionalProperties":false},"to":{"type":"object","properties":{"placeId":{"type":"string","minLength":1,"maxLength":512},"name":{"default":"","type":"string","maxLength":512}},"required":["placeId"],"additionalProperties":false},"vehicle":{"type":"string","maxLength":32},"returnTrip":{"type":"boolean","default":false},"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["from","to","baseCurrency"],"additionalProperties":false},"DriveTollQuoteDto":{"type":"object","properties":{"tollAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"format":"int64"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["tollAmount","currency"]},"PlaceBiasDto":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"radiusMeters":{"type":"number","minimum":100,"maximum":50000,"default":20000,"nullable":true}},"required":["lat","lng"]},"SuggestPlacesDto":{"type":"object","properties":{"query":{"type":"string","minLength":2,"maxLength":200,"description":"Free-text query. Proxied server-side — it never reaches the provider with any identifier attached."},"bias":{"allOf":[{"$ref":"#/components/schemas/PlaceBiasDto"}],"nullable":true}},"required":["query"]},"PlaceSuggestionDto":{"type":"object","properties":{"providerPlaceId":{"type":"string","description":"Opaque provider id. Send it back to POST /geo/places/details to resolve the full place."},"text":{"type":"string","description":"The whole line, as the provider formats it."},"mainText":{"type":"string","nullable":true,"description":"The place itself — usually the street address."},"secondaryText":{"type":"string","nullable":true,"description":"What disambiguates it — usually the postal area and country."}},"required":["providerPlaceId","text","mainText","secondaryText"]},"ReversePlaceDto":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude of the dropped pin. Proxied server-side — it reaches the provider with no identifier attached."},"lng":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude of the dropped pin."}},"required":["lat","lng"]},"PlaceCandidateDto":{"type":"object","properties":{"provider":{"nullable":true,"description":"Null together with `providerPlaceId`: no id, nothing minted it.","$ref":"#/components/schemas/PlaceProvider"},"providerPlaceId":{"type":"string","nullable":true},"source":{"nullable":true,"description":"Where this candidate came from, and what the write path stores as its\nprovenance.\n\nMAP_SEARCH from suggest/details: somebody searched and the provider named\nthe place. MAP_PIN from reverse: somebody pointed at the map, and the\nprovider supplied only a label — the coordinates are the person's own, so\nthey carry no provider retention clock. Null when the provider named\nnothing at all, because MAP_SEARCH without a place id is refused on write.\nSend this value back unchanged; restating a reverse candidate as\nMAP_SEARCH claims a pair we fetched, and the nightly sweep would then\ndelete a pin the person placed.","$ref":"#/components/schemas/PlaceSource"},"name":{"type":"string","nullable":true},"formattedAddress":{"type":"string","nullable":true},"street":{"type":"string","nullable":true,"description":"Street name and house number, in the order the address's own country\nwrites them — \"Storgata 1\", \"1600 Amphitheatre Parkway\"."},"postalCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"countryName":{"type":"string","nullable":true},"lat":{"type":"number","nullable":true},"lng":{"type":"number","nullable":true}},"required":["provider","providerPlaceId","source","name","formattedAddress","street","postalCode","city","region","countryCode","countryName","lat","lng"]},"PlaceDetailsDto":{"type":"object","properties":{"providerPlaceId":{"type":"string","minLength":1,"maxLength":255,"description":"Opaque provider id from a suggestion. Proxied server-side — it never reaches the provider with any identifier attached."}},"required":["providerPlaceId"]},"SetPerDiemDto":{"type":"object","properties":{"mealDate":{"type":"string","example":"2026-04-27","description":"Calendar date of the selected meal in Europe/Oslo; the meal flags sent with it are decisions on that date.","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"meals":{"type":"array","description":"Meal decisions, each on its own calendar date. Not combined with mealDate or the meal flags.","maxItems":9,"items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","example":"2026-04-27","description":"Calendar date of the meal in Europe/Oslo."},"meal":{"type":"string","enum":["breakfast","lunch","dinner"]},"isOn":{"type":"boolean"}},"required":["date","meal","isOn"]}},"breakfast":{"type":"boolean"},"lunch":{"type":"boolean"},"dinner":{"type":"boolean"},"amount":{"type":"integer","format":"int64"}}},"IssueTenantAccessGrantDto":{"type":"object","properties":{"userId":{"type":"string","format":"uuid","description":"The practitioner receiving access."},"roleId":{"type":"string","description":"The ORGANIZATION-scope role the practitioner acts under inside this tenant — a system role, or one of this organization’s own custom roles."},"expiresInDays":{"type":"number","minimum":1,"maximum":365,"description":"Time-box in days. Defaults to 90; a re-issue restarts it.","default":90}},"required":["userId","roleId"]},"CreateWalletDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","nullable":true},"initialAmount":{"type":"integer","minimum":0,"maximum":9007199254740991,"nullable":true}},"required":["organizationId","accountId"]},"WalletStatus":{"type":"string","enum":["ACTIVE","CLOSED"]},"WalletBalance":{"type":"object","properties":{"credited":{"format":"int64","type":"integer"},"spent":{"format":"int64","type":"integer"},"reserved":{"format":"int64","type":"integer"},"available":{"format":"int64","type":"integer"},"isOverspent":{"type":"boolean"},"overspentAmount":{"format":"int64","type":"integer","description":"How far over the funded amount the wallet is (0 when not overspent)"},"mismatchedExpenseCount":{"type":"number","description":"Wallet-linked expenses on a submitted or approved report that the sums left out because that report is based in another currency, and whose amounts are therefore not comparable to this balance (0 normally). Expenses on reports the sums never count — a draft, say — are not included here."}},"required":["credited","spent","reserved","available","isOverspent","overspentAmount","mismatchedExpenseCount"]},"WalletEntity":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountId":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"status":{"$ref":"#/components/schemas/WalletStatus"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"closedAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"account":{"$ref":"#/components/schemas/AccountEntity"},"balance":{"$ref":"#/components/schemas/WalletBalance"}},"required":["id","organizationId","accountId","currency","status","createdAt","updatedAt"]},"WalletActivityKind":{"type":"string","enum":["CREDIT","ADJUSTMENT","EXPENSE"]},"WalletActivityEntry":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/WalletActivityKind"},"amount":{"format":"int64","type":"integer","description":"Signed minor units: positive funds the wallet, negative draws it down."},"currency":{"type":"string","description":"The wallet's currency, restated on every row. A minor-unit integer means\nnothing without the exponent it was counted at, and this feed is flat — it\ncarries no wallet for a reader to fall back to."},"occurredAt":{"format":"date-time","type":"string"},"note":{"type":"string","nullable":true},"expenseId":{"type":"string","description":"Present for EXPENSE rows."},"title":{"type":"string","nullable":true},"reportStatus":{"description":"Report status for EXPENSE rows — tells reserved (PENDING/BLOCKED) from spent (APPROVED).","$ref":"#/components/schemas/ReportStatus"}},"required":["kind","amount","currency","occurredAt"]},"UpdateWalletDto":{"type":"object","properties":{"name":{"type":"string","nullable":true}}},"FundWalletDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"maximum":9007199254740991},"note":{"type":"string","nullable":true}},"required":["amount"]},"AdjustWalletDto":{"type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":"string"}},"required":["amount","note"]},"ReassignWalletDto":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["accountId"]},"IncomingOrganizationInvitationDto":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string"},"role":{"type":"number"},"expiresAt":{"format":"date-time","type":"string"},"invitedCount":{"type":"number"},"redeemedCount":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"createdByUserId":{"type":"string"},"revokedAt":{"format":"date-time","type":"string"},"revokedByUserId":{"type":"string"},"invalidRedemtionCount":{"type":"number"},"organizationId":{"type":"string"},"kind":{"type":"string","enum":["ORGANIZATION"]},"createdByUser":{"$ref":"#/components/schemas/UserEntity"},"revokedByUser":{"$ref":"#/components/schemas/UserEntity"},"organization":{"$ref":"#/components/schemas/OrganizationEntity"},"departments":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentEntity"}}},"required":["id","token","role","redeemedCount","createdAt","invalidRedemtionCount","organizationId","kind"]},"IncomingEnterpriseInvitationDto":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"enterpriseId":{"type":"string"},"enterpriseName":{"type":"string"},"role":{"type":"number"},"kind":{"type":"string","enum":["ENTERPRISE"]}},"required":["id","token","enterpriseId","enterpriseName","role","kind"]},"IncomingInvitationsPageDto":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/IncomingOrganizationInvitationDto"},{"$ref":"#/components/schemas/IncomingEnterpriseInvitationDto"}],"discriminator":{"propertyName":"kind","mapping":{"ORGANIZATION":"#/components/schemas/IncomingOrganizationInvitationDto","ENTERPRISE":"#/components/schemas/IncomingEnterpriseInvitationDto"}}}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]},"InviteByEmailDto":{"type":"object","properties":{"expiresAt":{"format":"date-time","type":"string","nullable":true},"role":{"$ref":"#/components/schemas/AccountRole","nullable":true},"invitedCount":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"organizationId":{"type":"string"},"departmentIds":{"type":"array","items":{"type":"string"},"nullable":true},"emails":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["organizationId","emails"]},"InviteRecipientStatus":{"type":"string","enum":["invited","already_member"]},"InviteResultItemDto":{"type":"object","properties":{"recipient":{"type":"string","description":"The normalized recipient the outcome refers to (E.164 phone or lowercased email)."},"status":{"$ref":"#/components/schemas/InviteRecipientStatus"}},"required":["recipient","status"]},"InviteResultDto":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/InviteResultItemDto"}}},"required":["results"]},"InviteByPhoneDto":{"type":"object","properties":{"expiresAt":{"format":"date-time","type":"string","nullable":true},"role":{"$ref":"#/components/schemas/AccountRole","nullable":true},"invitedCount":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"organizationId":{"type":"string"},"departmentIds":{"type":"array","items":{"type":"string"},"nullable":true},"phoneNumbers":{"type":"array","minItems":1,"items":{"type":"string"}}},"required":["organizationId","phoneNumbers"]},"InviteByLinkDto":{"type":"object","properties":{"expiresAt":{"format":"date-time","type":"string","nullable":true},"role":{"$ref":"#/components/schemas/AccountRole","nullable":true},"invitedCount":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"organizationId":{"type":"string"},"departmentIds":{"type":"array","items":{"type":"string"},"nullable":true}},"required":["organizationId"]},"RevokeInviteTokenDto":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"AcceptInviteTokenDto":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"AcceptInviteResponseDto":{"type":"object","properties":{"handle":{"type":"string"}},"required":["handle"]},"GetInviteTokenDto":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"TriggerSubscriptionJobsDto":{"type":"object","properties":{"date":{"format":"date-time","type":"string"},"subscriptionIds":{"type":"array","items":{"type":"string"}}},"required":["date","subscriptionIds"]},"BillingProvider":{"type":"string","enum":["POWEROFFICE"]},"SubscriptionInvoiceStatus":{"type":"string","enum":["PAID","OPEN","OVERDUE"]},"SubscriptionInvoiceEntity":{"type":"object","properties":{"id":{"type":"string"},"provider":{"$ref":"#/components/schemas/BillingProvider"},"invoiceNo":{"type":"string"},"organizationId":{"type":"string"},"enterpriseId":{"type":"string"},"totalAmount":{"type":"number"},"balance":{"type":"number"},"dueDate":{"format":"date-time","type":"string"},"sentAt":{"format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/SubscriptionInvoiceStatus"},"paymentReference":{"type":"string"},"lastChanged":{"format":"date-time","type":"string"},"dunningStage":{"type":"number"},"lastReminderAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","provider","invoiceNo","totalAmount","balance","status","lastChanged","dunningStage","createdAt","updatedAt"]},"CreditNoteLineDto":{"type":"object","properties":{"productCode":{"type":"string","description":"PowerOffice product code (`poProductId`); omit for a free-text credit line."},"description":{"type":"string"},"quantity":{"type":"number","description":"Positive magnitude — posted to PowerOffice as a negative quantity.","minimum":1},"unitPriceOre":{"type":"number","description":"Positive unit price in øre (NOK minor units).","minimum":1}},"required":["description","quantity","unitPriceOre"]},"IssueCreditNoteDto":{"type":"object","properties":{"reason":{"type":"string"},"lines":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CreditNoteLineDto"}},"originalBillingRunId":{"type":"string","description":"The `SubscriptionBillingRun` id this credit reverses. Present ⇒ the credit\nlinks to that run in our ledger and its id keys the deterministic\nidempotency reference."},"idempotencyReference":{"type":"string","description":"Caller-supplied deterministic token for an ad-hoc credit (no run) — e.g. a\nplan-downgrade proration. Required when `originalBillingRunId` is absent; a\nuuid must NOT be used (it would defeat retry-dedup)."},"relatedInvoiceNo":{"type":"string","description":"The original PowerOffice invoice number to link the credit to\n(`RelatedInvoiceNo`), when known."}},"required":["reason","lines"]},"ProrateSwitchPreviewPlanEntity":{"type":"object","properties":{"priceId":{"type":"string"},"productName":{"type":"string"},"priceName":{"type":"string","nullable":true},"amountOre":{"type":"number","description":"Full-period plan price in øre."}},"required":["priceId","productName","priceName","amountOre"]},"ProrateSwitchPreviewEntity":{"type":"object","properties":{"direction":{"type":"string","description":"charge ⇒ PowerOffice proration order; credit ⇒ credit note; none ⇒ nothing posted.","enum":["charge","credit","none"]},"oldTailOre":{"type":"number","description":"Credit for the unused tail of the current plan (øre)."},"newTailOre":{"type":"number","description":"Charge for the new plan over the same tail (øre)."},"netOre":{"type":"number","description":"newTail − oldTail; sign gives the direction."},"effectiveAt":{"format":"date-time","type":"string","description":"The switch instant the tail is measured from (now)."},"periodEnd":{"format":"date-time","type":"string","description":"Kept unchanged — the next regular run still bills at this boundary."},"currentPlan":{"$ref":"#/components/schemas/ProrateSwitchPreviewPlanEntity"},"newPlan":{"$ref":"#/components/schemas/ProrateSwitchPreviewPlanEntity"}},"required":["direction","oldTailOre","newTailOre","netOre","effectiveAt","periodEnd","currentPlan","newPlan"]},"ProrateSwitchPlanDto":{"type":"object","properties":{"priceId":{"type":"string","description":"The target PLAN `Price` id. The execute endpoint switches to it\nimmediately; the preview only quotes the resulting proration."}},"required":["priceId"]},"SubscriptionBillingRunEntity":{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"format":"date-time","type":"string"},"periodEnd":{"format":"date-time","type":"string"},"totalAmount":{"type":"number"},"consolidated":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"reissuable":{"type":"boolean","description":"Whether re-issuing this run's invoice would be accepted. True only for a standalone run (not consolidated) that carries a stored PowerOffice reference. Consolidated runs and runs that predate reference tracking are refused by the re-issue action (422), so the UI can disable it up front rather than round-trip a rejection. (A `true` here can still be refused at action time by the dynamic 409 guards — already issued / billing in progress.)"}},"required":["id","periodStart","periodEnd","consolidated","createdAt","reissuable"]},"AlertType":{"type":"string","enum":["INFO","WARNING","ERROR"]},"AlertSeverity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"Alert":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/AlertType"},"severity":{"$ref":"#/components/schemas/AlertSeverity"},"id":{"type":"number"},"title":{"type":"string"},"message":{"type":"string"},"url":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"startDateTime":{"format":"date-time","type":"string"},"endDateTime":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"displayInDashboard":{"type":"boolean"},"displayInApp":{"type":"boolean"}},"required":["type","severity","id","title","message","url","isActive","startDateTime","endDateTime","createdAt","updatedAt","displayInDashboard","displayInApp"]},"CreateAlertDto":{"type":"object","properties":{"title":{"type":"string"},"message":{"type":"string"},"url":{"type":"string","nullable":true},"type":{"$ref":"#/components/schemas/AlertType"},"severity":{"$ref":"#/components/schemas/AlertSeverity"},"startDateTime":{"type":"string","format":"date-time"},"endDateTime":{"format":"date-time","type":"string","nullable":true},"displayInDashboard":{"type":"boolean"},"displayInApp":{"type":"boolean"}},"required":["title","message","type","severity"]},"UpdateAlertDto":{"type":"object","properties":{"title":{"type":"string"},"message":{"type":"string"},"url":{"type":"string","nullable":true},"type":{"$ref":"#/components/schemas/AlertType"},"severity":{"$ref":"#/components/schemas/AlertSeverity"},"startDateTime":{"type":"string","format":"date-time"},"endDateTime":{"format":"date-time","type":"string","nullable":true},"displayInDashboard":{"type":"boolean"},"displayInApp":{"type":"boolean"},"isActive":{"type":"boolean"}}},"CreateProjectDto":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"accountingCode":{"type":"string","nullable":true},"accountingDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"managedByIntegrationId":{"type":"string","nullable":true}},"required":["organizationId","title"]},"UpdateProjectDto":{"type":"object","properties":{"title":{"type":"string","minLength":1},"accountingCode":{"type":"string","nullable":true},"accountingDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"managedByIntegrationId":{"type":"string","nullable":true}}},"ConnectAccountsDto":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"role":{"type":"number","enum":[0,1,2,3]}},"required":["accountIds"]},"DisconnectAccountsDto":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["accountIds"]},"UpdateProjectAssignmentRoleDto":{"type":"object","properties":{"role":{"type":"number","enum":[0,1,2,3]}},"required":["role"]},"BlogPostType":{"type":"string","enum":["GUIDE","NEWS"]},"BlogPostStatus":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED","SCHEDULED"]},"CreateBlogPostDto":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"},"type":{"$ref":"#/components/schemas/BlogPostType"},"status":{"$ref":"#/components/schemas/BlogPostStatus"},"category":{"type":"string","nullable":true},"markdown":{"type":"string"},"scheduledAt":{"format":"date-time","type":"string","nullable":true}},"required":["slug","title","description","imageUrl","type","status","markdown"]},"BlogPost":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/BlogPostType"},"status":{"$ref":"#/components/schemas/BlogPostStatus"},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"},"category":{"type":"string"},"markdown":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"scheduledAt":{"format":"date-time","type":"string"},"publishedAt":{"format":"date-time","type":"string"}},"required":["type","status","id","slug","title","description","imageUrl","category","markdown","createdAt","updatedAt","scheduledAt","publishedAt"]},"UpdateBlogPostDto":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"},"type":{"$ref":"#/components/schemas/BlogPostType"},"status":{"$ref":"#/components/schemas/BlogPostStatus"},"category":{"type":"string","nullable":true},"markdown":{"type":"string"},"scheduledAt":{"format":"date-time","type":"string","nullable":true}}},"ChatDto":{"type":"object","properties":{"prompt":{"type":"string"},"chatId":{"type":"string","nullable":true}},"required":["prompt"]},"CreateProductDto":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ProductType"},"name":{"type":"string"},"description":{"type":"string"}},"required":["type","name"]},"UpdateProductDto":{"type":"object","properties":{"isDefault":{"type":"boolean","description":"Included by default in new subscriptions. Multi-valued — setting it does not unset other products."},"name":{"type":"string"},"description":{"type":"string"}}},"ProductSubscriberDto":{"type":"object","properties":{"subscriptionStatus":{"nullable":true,"$ref":"#/components/schemas/SubscriptionStatus"},"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"organizationId":{"type":"string"},"organizationName":{"type":"string"},"subscriptionId":{"type":"string"},"priceId":{"type":"string"},"itemActiveFrom":{"format":"date-time","type":"string"},"itemActiveTo":{"format":"date-time","type":"string","nullable":true}},"required":["subscriptionStatus","recurringInterval","organizationId","organizationName","subscriptionId","priceId","itemActiveFrom","itemActiveTo"]},"AddDependenciesDto":{"type":"object","properties":{"dependencyIds":{"type":"array","items":{"type":"string"}}},"required":["dependencyIds"]},"CreatePriceDto":{"type":"object","properties":{"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"type":{"$ref":"#/components/schemas/PriceType"},"name":{"type":"string"},"amount":{"type":"number"},"description":{"type":"string"},"poProductId":{"type":"string"}},"required":["recurringInterval","type","name","amount"]},"UpdatePriceDto":{"type":"object","properties":{"recurringInterval":{"$ref":"#/components/schemas/PriceInterval"},"type":{"$ref":"#/components/schemas/PriceType"},"name":{"type":"string"},"amount":{"type":"number"},"description":{"type":"string"},"poProductId":{"type":"string"}}},"UiEventResourceType":{"type":"string","enum":["report","organization","department","expense","user","account","invoice"]},"UiEventType":{"type":"string","enum":["created","updated","deleted","submitted","approved","rejected","reviewed","published","stale"]},"ClientUiEvent":{"type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/UiEventResourceType"},"eventType":{"$ref":"#/components/schemas/UiEventType"},"resourceId":{"type":"string"},"timestamp":{"type":"number"},"id":{"type":"string"},"reportKind":{"$ref":"#/components/schemas/ReportKind"}},"required":["resourceType","eventType","resourceId","timestamp"]},"UiEventScope":{"type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/UiEventResourceType"},"resourceId":{"type":"string"},"organizationId":{"type":"string"},"eventType":{"$ref":"#/components/schemas/UiEventType"}}},"LabLabelDto":{"type":"object","properties":{"label":{"type":"string","nullable":true,"description":"null on a note-only post: the sample keeps its last asserted label.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"note":{"type":"string","nullable":true},"split":{"type":"string","nullable":true,"enum":["train","val","test","holdout"]},"createdAt":{"type":"string","format":"date-time"},"id":{"type":"string"},"userId":{"type":"string"}},"required":["label","note","split","createdAt","id","userId"]},"LabServingVerdictDto":{"type":"object","properties":{"pAi":{"type":"number","nullable":true},"decisionPolicy":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"label":{"type":"string","description":"The serving classifier's argmax label — never a fusion of evaluators."}},"required":["pAi","decisionPolicy","source","label"]},"LabProductionAiVerdictDto":{"type":"object","properties":{"pAi":{"type":"number","nullable":true},"modelVersion":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"provider":{"type":"string"},"method":{"type":"string"},"label":{"type":"string","description":"`real` | `ai_generated`."},"confidence":{"type":"number","description":"The max class posterior — the gating semantics production uses."}},"required":["pAi","modelVersion","createdAt","provider","method","label","confidence"]},"LabProductionFindingDto":{"type":"object","properties":{"variant":{"type":"string","nullable":true},"detection":{"type":"string","enum":["OPEN","NOT_DETECTED","SUBJECT_GONE"]},"triage":{"type":"string","enum":["PENDING","DISMISSED","CONFIRMED"]},"confidence":{"type":"number","nullable":true},"tier":{"type":"string","nullable":true,"description":"The detector's evidence tier — for an integrity aiOrigin finding,\n`proof` | `corroborated` | `uncorroborated` (the corroboration ladder).\nNull when the check has no tiers or the row predates them."},"severity":{"type":"string","description":"The CATALOG default consequence for this finding (`INFO` | `WARN` |\n`REQUIRE_RESOLUTION`). An organization may override its rules; this is\nthe platform's reading, not that organization's gate.","enum":["INFO","WARN","REQUIRE_RESOLUTION"]},"createdAt":{"type":"string","format":"date-time"},"checkId":{"type":"string","description":"`integrity` | `duplicate` | … (the check catalog's id)."}},"required":["variant","detection","triage","confidence","tier","severity","createdAt","checkId"]},"LabProductionSnapshotDto":{"type":"object","properties":{"aiVerdicts":{"type":"array","items":{"$ref":"#/components/schemas/LabProductionAiVerdictDto"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/LabProductionFindingDto"}}},"required":["aiVerdicts","findings"]},"LabSampleSourceDto":{"type":"object","properties":{"productionSnapshot":{"description":"Production's signals at import time, beside the lab's own runs.","allOf":[{"$ref":"#/components/schemas/LabProductionSnapshotDto"}]},"importedByUserId":{"type":"string","nullable":true,"description":"The FIRST importer; a re-import does not change it. Null = the system (the nightly auto-import)."},"importReason":{"type":"string","description":"Why this attachment was imported: an auto-import rule or `manual`. Only\never raised — a later human decision makes it `human_resolved`.","enum":["ai_flagged","human_resolved","flagged_then_deleted","random_baseline","manual"]},"suggestedLabel":{"type":"string","nullable":true,"description":"The label this attachment's human production decision suggests.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"suggestedFrom":{"type":"string","nullable":true,"description":"That decision as a token: `finding:<checkId>:<variant>:<triage>`."},"importedAt":{"type":"string","description":"The first import.","format":"date-time"},"lastImportedAt":{"type":"string","description":"The latest import — when `productionSnapshot` was last refreshed.","format":"date-time"},"id":{"type":"string"},"organizationId":{"type":"string"},"expenseId":{"type":"string"},"attachmentId":{"type":"string"},"attachmentSha256":{"type":"string","description":"sha256 of the bytes read from storage at import time."}},"required":["productionSnapshot","importedByUserId","importReason","suggestedLabel","suggestedFrom","importedAt","lastImportedAt","id","organizationId","expenseId","attachmentId","attachmentSha256"]},"LabSampleDto":{"type":"object","properties":{"createdByUserId":{"type":"string","nullable":true,"description":"The first uploader or importer. Null = the system (the nightly auto-import)."},"contentType":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"label":{"nullable":true,"description":"Latest label in the history, note-only posts included.","allOf":[{"$ref":"#/components/schemas/LabLabelDto"}]},"effectiveLabel":{"type":"string","nullable":true,"description":"Last label that actually asserted a verdict.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"split":{"type":"string","nullable":true,"enum":["train","val","test","holdout"]},"servingVerdict":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/LabServingVerdictDto"}]},"evaluators":{"type":"object","description":"evaluator → transport → { status, score, alert, threshold, reason? }","additionalProperties":{"type":"object"}},"origin":{"type":"string","description":"`upload` — these bytes were uploaded directly at least once, and the\nsample is the uploader's own; `import` — they only ever came from\nproduction imports, and retention releases the sample with its last\nsource.","enum":["upload","import"]},"importReason":{"type":"string","nullable":true,"description":"Why these bytes are in the lab: the highest-priority `importReason` of\nits sources (`human_resolved`, `ai_flagged`, `flagged_then_deleted`,\n`random_baseline`, `manual`), null for a hand upload. Derived from the\nsources; visible to reviewers: a reason is not identity.","enum":["ai_flagged","human_resolved","flagged_then_deleted","random_baseline","manual"]},"suggestedLabel":{"type":"string","nullable":true,"description":"The label a human's production decision suggests (a dismissed or\nconfirmed integrity finding). Accept it with an ordinary label post; it\nis never an asserted label.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"suggestedFrom":{"type":"string","nullable":true,"description":"The decision behind the suggestion: `finding:<checkId>:<variant>:<triage>`."},"disagreement":{"type":"string","nullable":true,"description":"How the newest run's INDEPENDENT origin evaluators (every `origin`\nevaluator but `pixel_baseline`, production's own model family) disagree\nwith production's newest AI verdict on these bytes:\n`possible_production_miss` — production did not flag it, an independent\nevaluator alerts (or signed provenance proves AI origin);\n`unsupported_production_flag` — production flagged it, none alerts.\nnull otherwise. The queue puts these first, a possible miss ahead.","enum":["possible_production_miss","unsupported_production_flag"]},"sources":{"description":"Platform ROOT/ADMIN only; absent for a Lab reviewer. Customer identity: organization, expense and attachment ids, plus production’s signals at import time.","type":"array","items":{"$ref":"#/components/schemas/LabSampleSourceDto"}},"id":{"type":"string"},"engineSampleId":{"type":"string","description":"The engine's content-addressed id — the sha256 of the uploaded bytes."},"filename":{"type":"string"},"sha256":{"type":"string"},"pageCount":{"type":"number"}},"required":["createdByUserId","contentType","createdAt","label","effectiveLabel","split","servingVerdict","evaluators","origin","importReason","suggestedLabel","suggestedFrom","disagreement","id","engineSampleId","filename","sha256","pageCount"]},"LabAlreadyImportedDto":{"type":"object","properties":{"filename":{"type":"string"},"sampleId":{"type":"string"}},"required":["filename","sampleId"]},"LabRejectedFileDto":{"type":"object","properties":{"filename":{"type":"string"},"reason":{"type":"string","description":"The engine's reason class for refusing the file (e.g. a decode error)."}},"required":["filename","reason"]},"LabUploadResultDto":{"type":"object","properties":{"samples":{"type":"array","items":{"$ref":"#/components/schemas/LabSampleDto"}},"alreadyImported":{"description":"Uploaded files whose bytes are already in the lab through a production\nimport. The upload added a run; the sample stays `origin: import` and\nunder that import's retention.","type":"array","items":{"$ref":"#/components/schemas/LabAlreadyImportedDto"}},"rejected":{"description":"Files the engine could not decode. Scoring runs before persistence, so\n a rejected file leaves no sample behind.","type":"array","items":{"$ref":"#/components/schemas/LabRejectedFileDto"}}},"required":["samples","alreadyImported","rejected"]},"LabEvaluatorDto":{"type":"object","properties":{"target":{"type":"string","nullable":true},"threshold":{"type":"number","nullable":true},"source":{"type":"string","enum":["engine","api"]},"name":{"type":"string"},"kind":{"type":"string"}},"required":["target","threshold","source","name","kind"]},"LabDiscrepancyDto":{"type":"object","properties":{"score":{"type":"number","nullable":true},"sampleId":{"type":"string"},"filename":{"type":"string"},"evaluator":{"type":"string"},"transport":{"type":"string"},"label":{"type":"string"},"expectedAlert":{"type":"boolean"},"alert":{"type":"boolean"}},"required":["score","sampleId","filename","evaluator","transport","label","expectedAlert","alert"]},"LabSummaryDto":{"type":"object","properties":{"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/LabEvaluatorDto"}},"samples":{"type":"number","description":"Every sample in the lab, labelled or not. A count, never capped."},"labeled":{"type":"number","description":"Samples with an asserted label (the gradable corpus). A count, never capped; `samples - labeled` is the reviewer queue."},"counts":{"type":"object","additionalProperties":{"type":"object"},"description":"evaluator → transport → { tp, fp, fn, tn, unknown }. Only evaluators whose target a label speaks to (`origin`, `alteration`); every other evaluator is in `informational`."},"informational":{"type":"object","additionalProperties":{"type":"object"},"description":"evaluator → transport → { alerted, assessed, notAssessed } for evaluators whose target no label speaks to (`claim_inconsistency`, `price_outlier`, none). Counted, never graded: they never appear in `counts` or `discrepancies`."},"discrepancies":{"type":"array","items":{"$ref":"#/components/schemas/LabDiscrepancyDto"}},"considered":{"type":"number","description":"Labelled samples the matrix was computed over: the newest labelled ones, at most 500. Always ≤ `labeled`."},"truncated":{"type":"boolean","description":"`labeled > considered` — labelled samples exist that the matrix did not grade; it is a window over the newest, not the whole corpus."}},"required":["evaluators","samples","labeled","counts","informational","discrepancies","considered","truncated"]},"LabDatasetManifestDto":{"type":"object","properties":{"cases":{"type":"array","items":{"type":"object"}},"version":{"type":"string"},"dataset_id":{"type":"string"}},"required":["cases","version","dataset_id"]},"LabConfigDto":{"type":"object","properties":{"maxFiles":{"type":"number","description":"Files per upload."},"maxCaptureFiles":{"type":"number","description":"Files per upload with `capture=true`."},"maxUploadBytes":{"type":"number","description":"Bytes per upload, summed across every file."},"maxFileBytes":{"type":"number","description":"Bytes per file."}},"required":["maxFiles","maxCaptureFiles","maxUploadBytes","maxFileBytes"]},"LabEvaluationDto":{"type":"object","properties":{"source":{"type":"string","description":"Which side produced the row: the Python engine or this API.","enum":["engine","api"]},"page":{"type":"number","nullable":true,"description":"1-based page; null for an evaluator that judges the whole document."},"status":{"type":"string","enum":["completed","failed","unavailable","not_assessed"]},"score":{"type":"number","nullable":true},"alert":{"type":"boolean","nullable":true,"description":"null means this evaluator did not answer. Never read null as false."},"threshold":{"type":"number","nullable":true},"target":{"type":"string","nullable":true,"description":"`origin` | `alteration` | `claim_inconsistency` | null."},"details":{"type":"object","nullable":true},"version":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true,"description":"Why a non-completed row did not answer."},"evaluator":{"type":"string","description":"Evaluator name — `pixel_baseline`, `c2pa_api`, `arithmetic`, …"},"view":{"type":"string","description":"The engine's transport (`rgb`, `jpeg85`) or `source` for an API row."}},"required":["source","page","status","score","alert","threshold","target","version","reason","evaluator","view"]},"LabRunDto":{"type":"object","properties":{"engineRunId":{"type":"string","nullable":true,"description":"The engine run this row mirrors; null when only API evaluators ran."},"createdAt":{"type":"string","format":"date-time"},"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/LabEvaluationDto"}},"servingVerdict":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/LabServingVerdictDto"}]},"id":{"type":"string"}},"required":["engineRunId","createdAt","evaluations","servingVerdict","id"]},"LabSampleDetailDto":{"type":"object","properties":{"createdByUserId":{"type":"string","nullable":true,"description":"The first uploader or importer. Null = the system (the nightly auto-import)."},"contentType":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"label":{"nullable":true,"description":"Latest label in the history, note-only posts included.","allOf":[{"$ref":"#/components/schemas/LabLabelDto"}]},"effectiveLabel":{"type":"string","nullable":true,"description":"Last label that actually asserted a verdict.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"split":{"type":"string","nullable":true,"enum":["train","val","test","holdout"]},"servingVerdict":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/LabServingVerdictDto"}]},"evaluators":{"type":"object","description":"evaluator → transport → { status, score, alert, threshold, reason? }","additionalProperties":{"type":"object"}},"origin":{"type":"string","description":"`upload` — these bytes were uploaded directly at least once, and the\nsample is the uploader's own; `import` — they only ever came from\nproduction imports, and retention releases the sample with its last\nsource.","enum":["upload","import"]},"importReason":{"type":"string","nullable":true,"description":"Why these bytes are in the lab: the highest-priority `importReason` of\nits sources (`human_resolved`, `ai_flagged`, `flagged_then_deleted`,\n`random_baseline`, `manual`), null for a hand upload. Derived from the\nsources; visible to reviewers: a reason is not identity.","enum":["ai_flagged","human_resolved","flagged_then_deleted","random_baseline","manual"]},"suggestedLabel":{"type":"string","nullable":true,"description":"The label a human's production decision suggests (a dismissed or\nconfirmed integrity finding). Accept it with an ordinary label post; it\nis never an asserted label.","enum":["ai_generated","digitally_edited","genuine","unknown"]},"suggestedFrom":{"type":"string","nullable":true,"description":"The decision behind the suggestion: `finding:<checkId>:<variant>:<triage>`."},"disagreement":{"type":"string","nullable":true,"description":"How the newest run's INDEPENDENT origin evaluators (every `origin`\nevaluator but `pixel_baseline`, production's own model family) disagree\nwith production's newest AI verdict on these bytes:\n`possible_production_miss` — production did not flag it, an independent\nevaluator alerts (or signed provenance proves AI origin);\n`unsupported_production_flag` — production flagged it, none alerts.\nnull otherwise. The queue puts these first, a possible miss ahead.","enum":["possible_production_miss","unsupported_production_flag"]},"sources":{"description":"Platform ROOT/ADMIN only; absent for a Lab reviewer. Customer identity: organization, expense and attachment ids, plus production’s signals at import time.","type":"array","items":{"$ref":"#/components/schemas/LabSampleSourceDto"}},"runs":{"description":"Newest first. Append-only: a rerun adds a run, it never edits one.","type":"array","items":{"$ref":"#/components/schemas/LabRunDto"}},"labels":{"description":"Oldest first — the label history as it happened.","type":"array","items":{"$ref":"#/components/schemas/LabLabelDto"}},"engineSync":{"type":"string","description":"Whether the engine's copy of the label is in step with this one.\n\n`failed` means the label IS stored here — this record is the truth — and\nthe forward to the engine did not land. Nothing is lost and nothing needs\nre-posting: the sample's next rerun re-forwards from this history. A read\nthat forwarded nothing answers `ok`.","enum":["ok","failed"]},"id":{"type":"string"},"engineSampleId":{"type":"string","description":"The engine's content-addressed id — the sha256 of the uploaded bytes."},"filename":{"type":"string"},"sha256":{"type":"string"},"pageCount":{"type":"number"}},"required":["createdByUserId","contentType","createdAt","label","effectiveLabel","split","servingVerdict","evaluators","origin","importReason","suggestedLabel","suggestedFrom","disagreement","runs","labels","engineSync","id","engineSampleId","filename","sha256","pageCount"]},"LabelLabSampleDto":{"type":"object","properties":{"label":{"type":"string","enum":["ai_generated","digitally_edited","genuine","unknown"]},"note":{"type":"string","minLength":1,"maxLength":500},"split":{"type":"string","enum":["train","val","test","holdout"]}}},"LabCandidateOrganizationDto":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"]},"LabCandidateDto":{"type":"object","properties":{"organization":{"$ref":"#/components/schemas/LabCandidateOrganizationDto"},"receiptDate":{"type":"string","nullable":true,"description":"The expense's date (the attachment's OCR date when the expense has none).","format":"date-time"},"amountMinor":{"type":"number","nullable":true,"description":"The expense's amount, minor units of `currency` — the import's claim."},"currency":{"type":"string","nullable":true},"merchant":{"type":"string","nullable":true},"signalAt":{"type":"string","description":"The newest qualifying signal — what the page is ordered by. For an id\nlookup of an attachment production never flagged, its upload time.","format":"date-time"},"signals":{"description":"Production's AI verdicts (newest 5) and findings on the attachment.","allOf":[{"$ref":"#/components/schemas/LabProductionSnapshotDto"}]},"labSampleId":{"type":"string","nullable":true,"description":"The lab sample these bytes already are — matched by content hash, so a\ndirect upload of the same file counts — or null."},"attachmentId":{"type":"string"},"expenseId":{"type":"string"},"inLab":{"type":"boolean","description":"`labSampleId !== null`."},"deletedInApp":{"type":"boolean","description":"Deleted IN THE APP — the attachment, its expense, report or organization\ncarries `deletedAt` — but still physically stored. Still a candidate and\nstill importable (flagged-then-deleted receipts are useful cases); the\nflag says so."},"previewPath":{"type":"string","description":"Route that serves the receipt's own bytes (PDF or image) to a platform\noperator, for a preview before import. Relative to the API root."}},"required":["organization","receiptDate","amountMinor","currency","merchant","signalAt","signals","labSampleId","attachmentId","expenseId","inLab","deletedInApp","previewPath"]},"LabCandidatePageDto":{"type":"object","properties":{"candidates":{"type":"array","items":{"$ref":"#/components/schemas/LabCandidateDto"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass back as `cursor` for the next page; null at the end. A page SHORTER\nthan `limit` with a cursor is not the end — the scan window ran out\nbefore the page filled."}},"required":["candidates","nextCursor"]},"LabCandidateExpenseDto":{"type":"object","properties":{"merchant":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"date":{"type":"string","nullable":true,"format":"date-time"},"categoryTitle":{"type":"string","nullable":true},"amountMinor":{"type":"number","description":"Minor units of `currency`."}},"required":["merchant","currency","date","categoryTitle","amountMinor"]},"LabCandidateAiVerdictDto":{"type":"object","properties":{"pAi":{"type":"number","nullable":true},"modelVersion":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"label":{"type":"string","description":"`real` | `ai_generated`."},"confidence":{"type":"number"},"provider":{"type":"string"},"method":{"type":"string"}},"required":["pAi","modelVersion","createdAt","label","confidence","provider","method"]},"LabCandidateFindingDto":{"type":"object","properties":{"variant":{"type":"string","nullable":true},"detection":{"type":"string","enum":["OPEN","NOT_DETECTED","SUBJECT_GONE"]},"triage":{"type":"string","enum":["PENDING","DISMISSED","CONFIRMED"]},"confidence":{"type":"number","nullable":true},"tier":{"type":"string","nullable":true,"description":"Evidence tier (integrity aiOrigin: `proof` | `corroborated` | `uncorroborated`); null when untiered."},"severity":{"type":"string","description":"The CATALOG default consequence (`INFO` | `WARN` | `REQUIRE_RESOLUTION`).","enum":["INFO","WARN","REQUIRE_RESOLUTION"]},"resolveReason":{"type":"string","nullable":true,"description":"The resolver's reason, as the customer's approver wrote it."},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"checkId":{"type":"string"}},"required":["variant","detection","triage","confidence","tier","severity","resolveReason","resolvedAt","createdAt","checkId"]},"LabCandidateDetailDto":{"type":"object","properties":{"organization":{"$ref":"#/components/schemas/LabCandidateOrganizationDto"},"expense":{"$ref":"#/components/schemas/LabCandidateExpenseDto"},"receiptDate":{"type":"string","nullable":true,"description":"The expense's date, else the receipt's OCR date.","format":"date-time"},"aiVerdicts":{"description":"Every production AI verdict on the receipt, newest first.","type":"array","items":{"$ref":"#/components/schemas/LabCandidateAiVerdictDto"}},"findings":{"description":"Every finding on the receipt (any check, any state), newest first.","type":"array","items":{"$ref":"#/components/schemas/LabCandidateFindingDto"}},"labSampleId":{"type":"string","nullable":true},"attachmentId":{"type":"string"},"expenseId":{"type":"string"},"inLab":{"type":"boolean"},"deletedInApp":{"type":"boolean"},"previewPath":{"type":"string","description":"The receipt's own bytes (see the preview route)."},"evaluatePath":{"type":"string","description":"Score it without keeping it (`POST`, see the evaluate route)."}},"required":["organization","expense","receiptDate","aiVerdicts","findings","labSampleId","attachmentId","expenseId","inLab","deletedInApp","previewPath","evaluatePath"]},"EvaluateLabCandidateDto":{"type":"object","properties":{"capture":{"type":"boolean"},"llm":{"type":"boolean"}}},"LabCandidateEvaluationDto":{"type":"object","properties":{"persisted":{"description":"Always false.","type":"boolean"},"contentType":{"type":"string","nullable":true},"pageCount":{"type":"number","nullable":true,"description":"Pages the engine decoded; null when it did not say."},"evaluations":{"description":"Engine rows (per page × transport) and API rows, as a LabRun's.","type":"array","items":{"$ref":"#/components/schemas/LabEvaluationDto"}},"evaluators":{"type":"object","additionalProperties":{"type":"object"},"description":"evaluator → transport → { status, score, alert, threshold, reason? }"},"servingVerdict":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/LabServingVerdictDto"}]},"thumbnailPngBase64":{"type":"string","nullable":true,"description":"Page 1 as a PNG, base64, when the engine rendered one."},"rejectedReason":{"type":"string","nullable":true,"description":"Why the engine could not score the bytes (a decode failure, …); then\n`evaluations` is empty. Null when it scored them."},"attachmentId":{"type":"string"},"sha256":{"type":"string","description":"sha256 of the bytes scored (lowercase hex)."}},"required":["persisted","contentType","pageCount","evaluations","evaluators","servingVerdict","thumbnailPngBase64","rejectedReason","attachmentId","sha256"]},"ImportLabSamplesDto":{"type":"object","properties":{"attachmentIds":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"capture":{"type":"boolean"}},"required":["attachmentIds"]},"LabImportRejectedDto":{"type":"object","properties":{"filename":{"type":"string"},"reason":{"type":"string","description":"The engine's reason class for refusing the file (e.g. a decode error)."},"attachmentId":{"type":"string","description":"The attachment that could not be imported."}},"required":["filename","reason","attachmentId"]},"LabImportResultDto":{"type":"object","properties":{"samples":{"description":"Samples created or extended, with their `sources` (operator view).","type":"array","items":{"$ref":"#/components/schemas/LabSampleDto"}},"rejected":{"description":"Attachments that did not become a sample, with why: `attachment_not_found`\n(no such row, no storage reference, or its bytes never arrived),\n`attachment_too_large`, `attachment_bytes_missing` (the stored file is gone), `attachment_bytes_unavailable` (storage did not answer — retry),\n`attachment_format_unsupported`, `import_batch_too_large`,\n`attachment_removed_during_import` (physically removed while it was being\nimported — its lab copy was released again), `engine_result_unmapped`, or\nthe engine's own refusal. A receipt deleted in the app but still stored IS\nimported.","type":"array","items":{"$ref":"#/components/schemas/LabImportRejectedDto"}}},"required":["samples","rejected"]},"CreateAgentConversationDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["organizationId"]},"SendAgentMessageDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","maxLength":5000},"attachedInboxItemIds":{"type":"array","maxItems":10,"items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contextPrefix":{"type":"string","maxLength":2000}},"required":["organizationId","text"]},"DecideAgentApprovalDto":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"decision":{"type":"string","enum":["approve","counter","skip"]},"reason":{"type":"string","maxLength":1000,"nullable":true}},"required":["organizationId","decision"]},"McpConnectionResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Grant id — the handle used to revoke this connection."},"clientId":{"type":"string","description":"The registered OAuth client id the connection was granted to."},"clientName":{"type":"string","description":"Human-readable vendor name, e.g. `OpenAI` or `Claude`."},"resource":{"type":"string","description":"The MCP endpoint the connection is bound to."},"scopes":{"description":"Scopes granted to the client.","type":"array","items":{"type":"string"}},"createdAt":{"format":"date-time","type":"string","description":"When the user approved the connection."},"lastUsedAt":{"format":"date-time","type":"string","nullable":true,"description":"Last time the client authenticated with this grant, if ever."},"revokedAt":{"format":"date-time","type":"string","nullable":true,"description":"Revocation state — `null` while the connection is live."}},"required":["id","clientId","clientName","resource","scopes","createdAt","lastUsedAt","revokedAt"]}}}}