{"openapi":"3.1.0","info":{"title":"Fynch Mobility API","description":"\nThe [Fynch Mobility Platform API](https://fynchmobility.com/mobility-platform/), offers a variety of mobility and expense related functionalities as a service. Please get in touch with us in case you are interested in integrating Fynch functionalities into your own applications.\n\n## Authentication\n\nProvide a Firebase ID Token as a bearer token as part of an `Authorization` request \nheader to authenticate as an end-user:\n\n    Authorization: Bearer <id_token>\n\nA 401 response will be returned if the token is somehow invalid. Endpoints requiring a verified email address will return a 403 response if that is not the case.\n\n## Error responses\n\nThis API uses [RFC9457 Problem Details](https://www.rfc-editor.org/rfc/rfc9457) for all error responses. However, load balancers etc might still generate responses without such a response body. It is therefore best to first check if you see a `Content-Type: application/problem+json` response header before interpreting a problem detail response body. Otherwise, fall back to the HTTP-level semantics carried by the status code. \n\n## Conditional requests\n\nSome endpoints support (soft) conditional requests by means of a `Last-Modified` response header, and an `If-Modified-Since` or `If-Unmodified-Since` request header. These can be used to poll (slightly more) efficiently for periodic updates. Or to avoid the [lost update problem](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests#avoiding_the_lost_update_problem_with_optimistic_locking) by providing optimistic locking when updating a resource.\n","termsOfService":"https://fynchmobility.com/en/terms-of-use","contact":{"name":"Fynch Mobility","url":"https://fynchmobility.com/","email":"support@fynchmobility.com"},"version":"2.7.0 (#ec324dc)"},"paths":{"/auth/email/verify":{"post":{"tags":["auth"],"summary":"Trigger email verification","operationId":"action_handler_verify_auth_email_verify_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionUrlRequest"}}}},"responses":{"202":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/auth/email/reset":{"post":{"tags":["auth"],"summary":"Trigger password reset","operationId":"action_handler_reset_auth_email_reset_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionUrlRequest"}}}},"responses":{"202":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/auth/email/signin":{"post":{"tags":["auth"],"summary":"Trigger email-based sign-in","description":"Sends an e-mail sign-in link to a user.","operationId":"action_handler_signin_auth_email_signin_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignInRequest"}}}},"responses":{"202":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/auth/provider":{"get":{"tags":["auth"],"summary":"Find federated identity provider","description":"Look up federated identity provider for the given email address, or return a 404\nif no provider was found for the domain.","operationId":"provider_auth_provider_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"The user's email address","format":"email","title":"Email"},"description":"The user's email address"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Federated identity provider found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"No federated identity provider found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/auth/session":{"post":{"tags":["auth"],"summary":"Create login session","description":"Start a new user session, creating a new account record for the authenticated\nuser if needed.\n\nReturn 201 if a new account was created, otherwise 303 pointing to the\nexisting account.\n\nIn case of a 201, the client should force-refresh the ID Token to ensure that\ncustom claims are propagated properly.\n\nFor convenience, the response body contains the currently active subscriptions\nas would be returned by GET /user/subscriptions (see the content-location header).\n\nThe redirected URL (see the location header) can be used to look up further\naccount information.\n\nThis endpoint updates the user's language if an accept-language header is provided.","operationId":"login_auth_session_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"201":{"description":"Session for new account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_SubscriptionSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"303":{"description":"Session for existing account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_SubscriptionSchema_"}}}}}},"delete":{"tags":["auth"],"summary":"Destroy login session","description":"Sign the current user out.\n\nThis endpoint works with an unverified email address.","operationId":"logout_auth_session_delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/auth/signin":{"post":{"tags":["auth"],"summary":"Sign in","description":"Sign in with an email address and password, or with an ID token from Google or\nApple. Google and Apple accounts are created on first sign-in.\n\nUsers must verify their email address first: until then, this returns a 403\nof type /errors/application/email-not-verified, and the apps can offer to\nresend the email with POST /auth/email/verify.","operationId":"sign_in_auth_signin_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PasswordSignInRequest"},{"$ref":"#/components/schemas/FederatedSignInRequest"}],"discriminator":{"propertyName":"method","mapping":{"password":"#/components/schemas/PasswordSignInRequest","google.com":"#/components/schemas/FederatedSignInRequest","apple.com":"#/components/schemas/FederatedSignInRequest"}},"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"The email address isn't verified (type /errors/application/email-not-verified), or the user's organisation requires another sign-in method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register with email and password","description":"Create an account with an email address and password, and send a link to\nverify the email address. Google and Apple accounts are created by signing in.\n\nThis doesn't sign the user in: that only works once the email address is\nverified. The apps can resend the email with POST /auth/email/verify.\n\nA password that doesn't meet the requirements gets a 422 of type\n/errors/application/sign-in/weak-password, whose unmet_requirements lists\nwhich ones: min-length (8 characters), lowercase, uppercase, number and\nspecial-character.","operationId":"register_auth_register_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"The email address isn't verified (type /errors/application/email-not-verified), or the user's organisation requires another sign-in method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"409":{"description":"An account already exists for this email address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh session","description":"Exchange a refresh token for a new ID token: before the old one expires (see\nexpires_in), when the API answers 401 for an expired token, or when the\nuser's claims changed, e.g. after subscribing to a license.\n\nUse the returned refresh token from then on; the old one may stop working.","operationId":"refresh_auth_refresh_post","parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"The email address isn't verified (type /errors/application/email-not-verified), or the user's organisation requires another sign-in method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/errors/{status_code}/traces/{trace_id}":{"get":{"tags":["debug"],"summary":"Trace ID support page","description":"Render support page for customer-facing errors.","operationId":"error_trace_errors__status_code__traces__trace_id__get","parameters":[{"name":"status_code","in":"path","required":true,"schema":{"type":"integer","description":"HTTP status code","title":"Status Code"},"description":"HTTP status code"},{"name":"trace_id","in":"path","required":true,"schema":{"type":"string","description":"Platform trace identifier","title":"Trace Id"},"description":"Platform trace identifier"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"401":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"text/html":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user":{"get":{"tags":["user"],"summary":"Retrieve user account details","description":"Retrieve the user's account information. This is a read-only resource, see\nthe user profile endpoint for the editable parts.\n\nThis endpoint supports conditional requests by passing an If-Modified-Since header.","operationId":"get_user_user_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAccountResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"304":{"description":"User account details not modified"}}},"delete":{"tags":["user"],"summary":"Off-board user account","description":"Initiate off-boarding for the authenticated account.","operationId":"delete_user_user_delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/addresses":{"get":{"tags":["user"],"summary":"Retrieve a list of user's addresses","description":"Returns all addresses for a user.","operationId":"get_addresses_user_addresses_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}],"title":"Type"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_AddressResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["user"],"summary":"Create address","description":"Create a new address for the user or return an existing address.","operationId":"create_address_user_addresses_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressRequestSchema"}}}},"responses":{"201":{"description":"New address created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"200":{"description":"Returning existing address"}}}},"/user/addresses/offices":{"get":{"tags":["user"],"summary":"Retrieve a list of user's offices","description":"Returns all offices linked to the user's primary license.","operationId":"get_offices_user_addresses_offices_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_AddressResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/addresses/{address_id}":{"get":{"tags":["user"],"summary":"Retrieve a user address","description":"Retrieve a user's address.","operationId":"get_address_user_addresses__address_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"path","required":true,"schema":{"type":"integer","title":"Address Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"patch":{"tags":["user"],"summary":"Update address","description":"Update attributes of an address.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_address_user_addresses__address_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"path","required":true,"schema":{"type":"integer","title":"Address Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAddressSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}},"delete":{"tags":["user"],"summary":"Delete address","description":"Delete an address.","operationId":"delete_address_user_addresses__address_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"path","required":true,"schema":{"type":"integer","title":"Address Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Address not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/days/wpm":{"post":{"tags":["user"],"summary":"Submit WPM commute survey results","description":"Mark the given period as WPM commute survey results.","operationId":"set_wpm_for_month_user_days_wpm_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"query","required":true,"schema":{"type":"integer","maximum":12,"minimum":1,"title":"Month"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"delete":{"tags":["user"],"summary":"Unsubmit WPM commute survey results","description":"Unmark the given period as WPM commute survey results.","operationId":"unset_wpm_for_month_user_days_wpm_delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"query","required":true,"schema":{"type":"integer","maximum":12,"minimum":1,"title":"Month"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/days":{"get":{"tags":["user"],"summary":"Retrieve a list of user's days within a given period","description":"Retrieve a user's days within a given period.\n\nHalf-Open interval is used here, where 'since' is inclusive\nand 'until' is exclusive.","operationId":"get_days_user_days_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"since","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Since"}},{"name":"until","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Until"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_DaySchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/days/{date}":{"get":{"tags":["user"],"summary":"Retrieve a day","description":"Retrieve a user's days.","operationId":"get_day_user_days__date__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DaySchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"patch":{"tags":["user"],"summary":"Update a user's day status","description":"Add or update a user's day status.","operationId":"update_day_user_days__date__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DayRequest"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"put":{"tags":["user"],"summary":"Create a new day status","description":"Add or update a user's day status.","operationId":"update_day_user_days__date__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DayRequest"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/days/{date}/submit":{"post":{"tags":["user"],"summary":"Complete and process a day","description":"Process a day, generating expenses if the user's license requires it.\n\nWhen the license has no expense reporting configured, the day is immediately marked\nas completed and a synchronous `200` response is returned.\n\nWhen expense reporting is enabled, the request is forwarded to fynch-runners to\ncompute the day's expenses. The response depends on how runners handles it:\n\n- 200 OK — processing completed synchronously; response body contains the result.\n- 202 Accepted — processing is running asynchronously. The `Location` header\n  points to `/user/jobs/{workflow_id}` which can be polled for status. The `ETag`\n  header can be used for conditional requests on that job resource.\n\nRaises `409` if the day has already been completed\nRaises `422` if the day cannot be edited (e.g. locked period, already reported)","operationId":"process_day_user_days__date__submit_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/days/submit":{"post":{"tags":["user"],"summary":"Complete and process multiple days","description":"Process a list of days, generating expenses for each one that is eligible.\n\nOnly days with an expense state of `open` are submitted; all others are silently\nskipped.","operationId":"submit_days_user_days_submit_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DaysBulkSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DaysBulkSubmitResponse"},{"type":"null"}],"title":"Response Submit Days User Days Submit Post"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/days/{date}/open":{"post":{"tags":["user"],"summary":"Re-open a day","operationId":"open_day_user_days__date__open_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DaySchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/expenses":{"get":{"tags":["user"],"summary":"Get Expenses","operationId":"get_expenses_user_expenses_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"since","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Since"}},{"name":"until","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Until"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ExpenseRuleType"},{"type":"null"}],"title":"Type"}},{"name":"subtype","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_ExpenseResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/expenses/complete":{"post":{"tags":["user"],"summary":"Mark all expenses in a month as complete","operationId":"complete_days_for_month_user_expenses_complete_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"query","required":true,"schema":{"type":"integer","maximum":12,"minimum":1,"title":"Month"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/jobs/{workflow_id}":{"get":{"tags":["user"],"summary":"Get the status of a background job","operationId":"get_job_status_user_jobs__workflow_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/journeys":{"get":{"tags":["user"],"summary":"Retrieve a list of a user's journeys","description":"Returns all journeys for a user.","operationId":"get_journeys_user_journeys_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_JourneyResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["user"],"summary":"Create journey","description":"Create a new journey and its segments.","operationId":"create_journey_user_journeys_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyRequestSchema"}}}},"responses":{"201":{"description":"New journey created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/journeys/wfo":{"get":{"tags":["user"],"summary":"Retrieve a list of a user's WFO journeys","description":"Returns journeys for a user that are used for WFO.\nNote: not all commute journeys are used in WFO.","operationId":"get_wfo_journeys_user_journeys_wfo_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/journeys/{journey_id}":{"get":{"tags":["user"],"summary":"Retrieve a user's journey","description":"Retrieve a user's journey.","operationId":"get_journey_user_journeys__journey_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"put":{"tags":["user"],"summary":"Replace user journey","description":"Replace a journey.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"replace_journey_user_journeys__journey_id__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyRequestSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}},"patch":{"tags":["user"],"summary":"Update user journey","description":"Update attributes of a journey.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_journey_user_journeys__journey_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyUpdateSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}},"delete":{"tags":["user"],"summary":"Delete journey","description":"Delete a journey.","operationId":"delete_journey_user_journeys__journey_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Journey not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/journeys/order":{"put":{"tags":["user"],"summary":"Update journey's priority order","description":"Update a user's preferred journey order.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_journey_order_user_journeys_order_put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"User Journey Data"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/user/journeys/{journey_id}/segments/{journey_segment_id}":{"get":{"tags":["user"],"summary":"Retrieve a user's journey segment","description":"Retrieve a user's journey segment.","operationId":"get_journey_segment_user_journeys__journey_id__segments__journey_segment_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"journey_segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Segment Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneySegmentResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"patch":{"tags":["user"],"summary":"Update user journey segment","description":"Update attributes of a journey segment.\n\nStart/stop address and segment priority are excluded as these affect other segments.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_journey_segment_user_journeys__journey_id__segments__journey_segment_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"journey_segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Segment Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneySegmentUpdateSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/user/journeys/{journey_id}/segments":{"put":{"tags":["user"],"summary":"Update user journey segments","description":"Add or update and validate a list of journey segments.","operationId":"update_journey_segments_user_journeys__journey_id__segments_put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCollectionEnvelope_JourneySegmentRequestSchema_"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_JourneySegmentResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/user/profile":{"get":{"tags":["user"],"summary":"Retrieve user profile","description":"Retrieve the user's profile information.\n\nThis endpoint supports conditional requests by passing an If-Modified-Since header.","operationId":"get_profile_user_profile_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"304":{"description":"User profile not modified"}}},"put":{"tags":["user"],"summary":"Replace user profile","description":"Replace the user's profile information.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"replace_profile_user_profile_put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileRequestSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else"}}},"patch":{"tags":["user"],"summary":"Update user profile","description":"Update one or more attributes in the user's profile.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_profile_user_profile_patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileUpdateSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else"}}}},"/user/project_codes":{"get":{"tags":["user"],"summary":"All user project codes.","description":"Lists all project codes available to the user.","operationId":"list_new_user_project_codes_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Project codes retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_ProjectCodeResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/receipt_categories":{"get":{"tags":["user"],"summary":"Retrieve receipt categories","description":"Retrieve a user's license receipt categories.","operationId":"list_receipt_categories_user_receipt_categories_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_ReceiptCategorySchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/reports/trips":{"post":{"tags":["user"],"summary":"Submit trip export request","description":"Generate a trip export for the user for the given period.","operationId":"publish_trips_report_user_reports_trips_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripReportRequest"}}}},"responses":{"202":{"description":"Export request submitted."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/reports/expenses/monthly":{"post":{"tags":["user"],"summary":"Send monthly expenses","description":"Enqueue a job that (re)generates and emails the user's expense report for the\ngiven month.\n\nBy default the report only covers new expenses, and a month without any new\nexpense is a 404. Pass ``include_completed_expenses=true`` to also cover the\nalready submitted/completed expenses in the month.\n\nThe job is idempotent: re-requesting the same month only produces a new report\nwhen an expense in that month has changed since the previous request (see\n``latest_update_date`` below); otherwise DBOS de-duplicates on the workflow id.\n\nThe selected expenses are passed to the worker by id, so the report reflects the\nmonth as it was when the user requested it: completing the expenses right after\n(before the queued job runs) does not turn the report empty.","operationId":"send_expense_report_user_reports_expenses_monthly_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","maximum":9999,"minimum":2000,"title":"Year"}},{"name":"month","in":"query","required":true,"schema":{"type":"integer","maximum":12,"minimum":1,"title":"Month"}},{"name":"include_completed_expenses","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Completed Expenses"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"202":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/reports/expenses/{license_id}":{"post":{"tags":["user"],"summary":"Submit expenses report request","description":"Generate an expenses report for the user for the given period.","operationId":"publish_expenses_report_user_reports_expenses__license_id__post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"License Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportRequest"}}}},"responses":{"202":{"description":"Message published."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"No active subscription found for license ID."}}}},"/user/reports/expenses/submitpreview":{"get":{"tags":["user"],"summary":"Get preview of expenses to be submitted","description":"Endpoint that returns a summary of what the user is about to submit for a month.","operationId":"get_submit_preview_user_reports_expenses_submitpreview_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"query","required":true,"schema":{"type":"integer","title":"Month"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Expense submit preview calculated","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/subscriptions":{"post":{"tags":["user"],"summary":"Create subscription","description":"(Re)subscribe a user onto a license.\n\nA user can be subscribed by:\n\n- Email domain\n- License invitation code\n- Personal invitation code (future)\n- App/Play Store purchase identifier (future)\n\nIf a code is provided it will be tried first.","operationId":"create_subscription_user_subscriptions_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest","default":{}}}}},"responses":{"201":{"description":"New subscription created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"303":{"description":"Existing subscription found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"404":{"description":"No valid license found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}},"get":{"tags":["user"],"summary":"List subscriptions","description":"Retrieve the user's active subscriptions.","operationId":"list_subscriptions_user_subscriptions_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_SubscriptionSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/subscriptions/qonversion":{"post":{"tags":["user"],"summary":"Create Qonversion subscription","description":"(Re)subscribe a user onto a license based on Qonversion user ID.","operationId":"create_qonversion_subscription_user_subscriptions_qonversion_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QonversionSubscribeRequest"}}}},"responses":{"201":{"description":"New subscription created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"303":{"description":"Existing subscription found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"404":{"description":"No valid license found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/subscriptions/primary":{"get":{"tags":["user"],"summary":"Retrieve primary subscription","description":"Retrieve the primary user subscription.\n\nThis endpoint supports conditional requests by passing an If-Modified-Since header.","operationId":"get_primary_subscription_user_subscriptions_primary_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/subscriptions/{license_id}":{"get":{"tags":["user"],"summary":"Retrieve subscription","description":"Retrieve a subscription.","operationId":"get_subscription_user_subscriptions__license_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionSchema-Output"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}},"delete":{"tags":["user"],"summary":"Delete subscription","description":"Unsubscribe the user from the given license.","operationId":"delete_subscription_user_subscriptions__license_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","title":"License Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/transactions":{"get":{"tags":["user"],"summary":"All transactions of all types for the current user","description":"Lists transactions of all types, with a \"type\" field to distinguish them.\n\nThe parameters since and until form a half-open interval [since,until).","operationId":"list_all_user_transactions_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"since","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Since"}},{"name":"until","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Until"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_ListItemResponse_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/transactions/new":{"get":{"tags":["user"],"summary":"All transactions that have not yet been submitted.","operationId":"list_new_user_transactions_new_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page","title":"Cursor"},"description":"Cursor for the next page"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Size"},"description":"Page size"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPage_TypeVar_Customized_ListItemResponse_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/transactions/nsbc/{id}":{"get":{"tags":["user"],"summary":"Get a single NSBC transaction.","operationId":"get_nsbc_user_transactions_nsbc__id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NSBCResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"patch":{"tags":["user"],"summary":"Get a single NSBC transaction.","operationId":"update_nsbc_user_transactions_nsbc__id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectiveUpdate"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/transactions/receipts/scan":{"post":{"tags":["user"],"summary":"Upload a receipt","description":"Endpoint to upload and scan a receipt image or PDF.\n\nSupports both:\n- multipart/form-data with field `file`\n- direct binary uploads with content-type image/* or application/pdf","operationId":"scan_receipt_user_transactions_receipts_scan_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/transactions/receipts":{"post":{"tags":["user"],"summary":"Create a receipt","operationId":"add_receipt_user_transactions_receipts_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/transactions/receipts/{receipt_id}":{"patch":{"tags":["user"],"summary":"Update a receipt","operationId":"update_receipt_user_transactions_receipts__receipt_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptUpdateSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"delete":{"tags":["user"],"summary":"Delete receipt","description":"Delete a receipt.","operationId":"delete_receipt_user_transactions_receipts__receipt_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","title":"Receipt Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Receipt not found"}}}},"/user/trips/day/{date}":{"get":{"tags":["user"],"summary":"List trips on a specific day","description":"Retrieve all trips made on a certain day (in the time zone of the trip) in\nreverse chronological order.\n\nThe trip's local time zone is used when filtering on day boundaries, since this\nfeels most natural in case a user is travelling.","operationId":"get_trips_user_trips_day__date__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_TripSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/trips/journey/{journey_id}":{"post":{"tags":["user"],"summary":"Create trips from a journey","description":"Create trip(s) from a user journey.","operationId":"create_trips_from_journey_user_trips_journey__journey_id__post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"integer","title":"Journey Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyTripsCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_TripSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/trips":{"post":{"tags":["user"],"summary":"Create trip","description":"Create a trip for a user.","operationId":"create_trip_user_trips_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripCreate"}}}},"responses":{"201":{"description":"New trip created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/trips/{trip_id}/return":{"post":{"tags":["user"],"summary":"Create a return trip","description":"Create a return trip for a user.","operationId":"create_return_trip_user_trips__trip_id__return_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"trip_id","in":"path","required":true,"schema":{"type":"integer","title":"Trip Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnTrip"}}}},"responses":{"201":{"description":"New trip created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Original trip was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/trips/{trip_id}":{"patch":{"tags":["user"],"summary":"Update trip","description":"Update (PATCH) a user's trip data.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_trip_user_trips__trip_id__patch","deprecated":true,"security":[{"OpenIdConnect":[]}],"parameters":[{"name":"trip_id","in":"path","required":true,"schema":{"type":"integer","title":"Trip Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripBase"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else"}}},"delete":{"tags":["user"],"summary":"Delete trip","description":"Delete a trip.","operationId":"delete_trip_user_trips__trip_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"trip_id","in":"path","required":true,"schema":{"type":"integer","title":"Trip Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Trip not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/vehicles":{"get":{"tags":["user"],"summary":"List vehicles","description":"Retrieve the user's vehicles.","operationId":"list_vehicles_user_vehicles_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_VehicleResponseSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["user"],"summary":"Create vehicle","description":"Create a new vehicle for the user.","operationId":"create_vehicle_user_vehicles_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleRequestSchema"}}}},"responses":{"201":{"description":"New vehicle created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"409":{"description":"Vehicle already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/user/vehicles/{vehicle_id}":{"get":{"tags":["user"],"summary":"Retrieve vehicle","description":"Retrieve a vehicle.","operationId":"get_vehicle_user_vehicles__vehicle_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"vehicle_id","in":"path","required":true,"schema":{"type":"integer","title":"Vehicle Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Vehicle not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}},"put":{"tags":["user"],"summary":"Replace user vehicle","description":"Replace a vehicle.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"replace_vehicle_user_vehicles__vehicle_id__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"vehicle_id","in":"path","required":true,"schema":{"type":"integer","title":"Vehicle Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleRequestSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}},"patch":{"tags":["user"],"summary":"Update user vehicle","description":"Update attributes of a vehicle.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_vehicle_user_vehicles__vehicle_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"vehicle_id","in":"path","required":true,"schema":{"type":"integer","title":"Vehicle Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleUpdateSchema"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}},"delete":{"tags":["user"],"summary":"Delete vehicle","description":"Delete a vehicle.","operationId":"delete_vehicle_user_vehicles__vehicle_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"vehicle_id","in":"path","required":true,"schema":{"type":"integer","title":"Vehicle Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Vehicle not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/vehicles/order":{"put":{"tags":["user"],"summary":"Update vehicles priority order","description":"Update a user's preferred vehicles order.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_vehicle_order_user_vehicles_order_put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"User Vehicle Data"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}},"/user/vehicles/lookup/{country}/{registration}":{"get":{"tags":["user"],"summary":"Look up vehicle information","description":"Look up vehicle details by registration number.","operationId":"lookup_vehicle_user_vehicles_lookup__country___registration__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","title":"Country"}},{"name":"registration","in":"path","required":true,"schema":{"type":"string","minLength":6,"maxLength":8,"title":"Registration"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Vehicle information found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleLookupResponseSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Vehicle information not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/app/reports/timeframe":{"get":{"tags":["user","app"],"summary":"Get allowed expense timeframe","description":"Temporary endpoint that returns a list of dates (YYYY-MM)\nfor which the user can create expenses for.","operationId":"get_allowed_timeframe_user_app_reports_timeframe_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Expense timeframe calculated","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/app/transactions/receipts/file/{file_name}":{"get":{"tags":["user","app"],"summary":"Get Receipt File","description":"Returns a receipt image/PDF file stored in GCS.\nEnsures proper MIME type and caching headers.","operationId":"get_receipt_file_user_app_transactions_receipts_file__file_name__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"file_name","in":"path","required":true,"schema":{"type":"string","title":"File Name"}},{"name":"draft","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Draft"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/app/trips/wfo/{date}":{"post":{"tags":["user","app"],"summary":"Create WFO trips from Fynch app","description":"Create bidirectional WFO trips for a user.","operationId":"create_wfo_trips_user_app_trips_wfo__date__post","deprecated":true,"security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripWFO"}}}},"responses":{"201":{"description":"New WFO trips created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_TripSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"Missing distances could not be calculated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"400":{"description":"WFO trips already exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}},"404":{"description":"Distance or address not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}},"delete":{"tags":["user","app"],"summary":"Delete WFO trips","description":"Delete WFO trips for a given day.","operationId":"delete_wfo_trips_user_app_trips_wfo__date__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"source","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TripSource","default":"wfo"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"WFO trips not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}}}}}},"/user/app/trips":{"post":{"tags":["user","app"],"summary":"Create trip from Fynch app","description":"Create a trip for a user.","operationId":"create_trip_user_app_trips_post","deprecated":true,"security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripCreate"}}}},"responses":{"201":{"description":"New trip created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripSchema"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/user/app/trips/{trip_id}":{"patch":{"tags":["user","app"],"summary":"Update trip from Fynch app","description":"Update (PATCH) a user's trip data.\n\nThis endpoint supports conditional requests by passing an If-Unmodified-Since\nheader; use this to detect if someone else updated the resource in the meantime.","operationId":"update_trip_user_app_trips__trip_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"trip_id","in":"path","required":true,"schema":{"type":"integer","title":"Trip Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripBase"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"Resource was modified by someone else"}}}},"/modalities":{"get":{"tags":["modalities"],"summary":"Retrieve modalities","description":"Retrieve all available modalities.","operationId":"list_modalities_modalities_get","deprecated":true,"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionEnvelope_ModalitySchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/modalities/vehicleclasses/{country}":{"get":{"tags":["modalities"],"summary":"Retrieve vehicle classes","description":"Retrieve all available vehicle classes for a country.","operationId":"list_vehicle_classes_modalities_vehicleclasses__country__get","parameters":[{"name":"country","in":"path","required":true,"schema":{"type":"string","minLength":2,"maxLength":2,"title":"Country"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Size"},"description":"Page size"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_TypeVar_Customized_VehicleClassSchema_"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/integrations/loket/authorize":{"get":{"tags":["integrations"],"summary":"Redirect to Loket to authorize an integration","description":"Validate the state of an onboarding link and redirect to the Loket login.","operationId":"redirect_to_loket_integrations_loket_authorize_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"Integration state parameter","title":"State"},"description":"Integration state parameter"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"303":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"302":{"description":"Invalid, used or expired link: redirected to failed page"}}}},"/integrations/loket/return":{"get":{"tags":["integrations"],"summary":"Return from Loket after authorizing an integration","description":"Store the Loket refresh token and redirect to the success or failed page.","operationId":"return_from_loket_integrations_loket_return_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"Integration state parameter","title":"State"},"description":"Integration state parameter"},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Authorization code, absent when not authorized","title":"Code"},"description":"Authorization code, absent when not authorized"},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OAuth2 error, e.g. access_denied","title":"Error"},"description":"OAuth2 error, e.g. access_denied"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"303":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"302":{"description":"Invalid, used or expired link: redirected to failed page"}}}},"/integrations/nmbrs/authorize":{"get":{"tags":["integrations"],"summary":"Redirect to Nmbrs to authorize an integration","description":"Validate the state of an onboarding link and redirect to the Nmbrs login.","operationId":"redirect_to_nmbrs_integrations_nmbrs_authorize_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"Integration state parameter","title":"State"},"description":"Integration state parameter"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"303":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"302":{"description":"Invalid, used or expired link: redirected to failed page"}}}},"/integrations/nmbrs/return":{"get":{"tags":["integrations"],"summary":"Return from Nmbrs after authorizing an integration","description":"Store the Nmbrs refresh token and redirect to the success or failed page.","operationId":"return_from_nmbrs_integrations_nmbrs_return_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"Integration state parameter","title":"State"},"description":"Integration state parameter"},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Authorization code, absent when not authorized","title":"Code"},"description":"Authorization code, absent when not authorized"},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OAuth2 error, e.g. access_denied","title":"Error"},"description":"OAuth2 error, e.g. access_denied"},{"name":"iss","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Issuer of the authorization response (RFC 9207)","title":"Iss"},"description":"Issuer of the authorization response (RFC 9207)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"303":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"302":{"description":"Invalid, used or expired link: redirected to failed page"}}}},"/admin/addresses":{"get":{"tags":["admin"],"summary":"List addresses by license or user","description":"List all addresses filtered by user's permissions.\n\nWhen only `user_id` is supplied (no `license_id`), access is verified by\nchecking that the admin has view_users access to the user's subscription\nlicense through a **tenant-level** permission; license-scoped admins get an\nempty page. The license filter is then omitted from the address query so that\npersonal addresses (no license_id) are also returned.\n\n**Required Capability**: view_users","operationId":"list_addresses_admin_addresses_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific license","title":"License Id"},"description":"Filter by specific license"},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}],"description":"Filter by address type","title":"Type"},"description":"Filter by address type"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user ID","title":"User Id"},"description":"Filter by user ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Page Size"},"description":"Items per page"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by license name or formatted address","title":"Search"},"description":"Search by license name or formatted address"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddressListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Create a license-bound address","description":"Create a license-bound address (e.g. an office location).\n\nThe address is linked to the specified license and has no `user_id` — it\nrepresents a shared location for all users under that license.\n\n**Required Capability**: manage_users","operationId":"create_address_admin_addresses_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateAddressRequest"}}}},"responses":{"201":{"description":"Address created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddressResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks manage_users capability or license access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"License not found"}}}},"/admin/addresses/by-ids":{"get":{"tags":["admin"],"summary":"Get addresses by a list of IDs","description":"Fetch multiple addresses by ID, restricted to those the admin can access.\n\nOnly addresses the admin has access to are returned: license-bound addresses\nvia the license, and personal (user-bound) addresses via the owner's\nsubscriptions. Inaccessible or unknown IDs are silently omitted, so the\ncaller never learns about addresses outside its scope.\n\n**Required Capability**: view_users","operationId":"get_addresses_by_ids_admin_addresses_by_ids_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"query","required":true,"schema":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"description":"Address IDs to fetch (repeat the param: ?address_id=1&address_id=2)","title":"Address Id"},"description":"Address IDs to fetch (repeat the param: ?address_id=1&address_id=2)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddressCollectionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/addresses/{address_id}":{"patch":{"tags":["admin"],"summary":"Update a license-bound address","description":"Change the name, type or radius of a license-bound address, or set it active\nor inactive. Fields left out stay as they are.\n\nAn inactive address no longer matches new trips and employees can't choose\nit; trips that already refer to it keep doing so.\n\n**Required Capability**: manage_users","operationId":"update_address_admin_addresses__address_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"path","required":true,"schema":{"type":"integer","description":"Address ID","title":"Address Id"},"description":"Address ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateAddressRequest"}}}},"responses":{"200":{"description":"Address updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAddressResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks manage_users capability or license access"},"422":{"description":"Invalid input (e.g. null on a required field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Address not found"}}},"delete":{"tags":["admin"],"summary":"Delete a license-bound address","description":"Delete a license-bound address.\n\nThe address is marked deleted rather than removed, because trips, journeys\nand distances keep referring to it. It no longer matches new trips and\nemployees can't choose it.\n\n**Required Capability**: manage_users","operationId":"delete_address_admin_addresses__address_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"path","required":true,"schema":{"type":"integer","description":"Address ID","title":"Address Id"},"description":"Address ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Address deleted"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks manage_users capability or license access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Address not found"}}}},"/admin/auth/session":{"post":{"tags":["admin"],"summary":"Admin login session","description":"Validate a Firebase ID token and return the authenticated admin user.\n\nThe client should call this endpoint after Firebase login to verify that\nthe user has admin permissions and to retrieve their permission scopes.\n\nReturns the admin user's ID, email, and list of accessible licenses/roles.","operationId":"admin_login_admin_auth_session_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSessionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/auth/permissions":{"get":{"tags":["admin"],"summary":"Check admin permission state","description":"Check whether the authenticated admin has usable license-scoped permissions.\n\nReturns different status codes to drive the dashboard routing flow:\n- **200**: User has at least one permission with a license → proceed to dashboard\n- **428**: User has admin role but no license assigned yet → redirect to\n  license creation\n- **412**: User has permissions but no license and no admin role → contact\n  administrator\n\nUsers with no permissions at all are rejected by authentication (403).","operationId":"check_permissions_admin_auth_permissions_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"User has valid license-scoped permissions","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"412":{"description":"No license access — contact your administrator"},"428":{"description":"Admin role present but no license configured yet"}}}},"/admin/cards-nsbc":{"get":{"tags":["admin"],"summary":"List NSBC cards","description":"List the NS Business Cards of the admin's accessible licenses.\n\nA card is derived from the NSBC transactions with its card number; it is linked\nwhen its most recent transaction is linked to a user. Admins limited to\ndepartments only see linked cards of users in those departments.\n\n**Required Capability**: view_expenses","operationId":"list_cards_nsbc_admin_cards_nsbc_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"linked","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by link state: true = the most recent transaction is linked to a user, false = it is not","title":"Linked"},"description":"Filter by link state: true = the most recent transaction is linked to a user, false = it is not"},{"name":"last_used_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only cards last used on or after this date","title":"Last Used Since"},"description":"Only cards last used on or after this date"},{"name":"last_used_until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only cards last used on or before this date","title":"Last Used Until"},"description":"Only cards last used on or before this date"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by card number, card holder, Pers.nummer, or the linked user's name or email (partial, case-insensitive)","title":"Search"},"description":"Search by card number, card holder, Pers.nummer, or the linked user's name or email (partial, case-insensitive)"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CardNSBCSortField","description":"Field to sort on (default: last_used)","default":"last_used"},"description":"Field to sort on (default: last_used)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates, counts and amounts, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates, counts and amounts, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCardNSBCListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/csv-samples":{"post":{"tags":["admin"],"summary":"Upload a sample CSV file to map an import profile with","description":"Upload a sample file, with how it was detected to be written and its\nfirst values per column, to map a new import profile with, or to change\nthe mapping of `integration_id`. That profile's mapping is carried over to\nthe sample's columns and checked against it. Check other mappings with\n`POST /csv-samples/{sample_id}/validations`. Samples are deleted after a\nday.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"create_csv_sample_admin_csv_samples_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCsvSampleResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"No access to the whole license"},"422":{"description":"The file is empty, unreadable or has too many rows"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"The file can't be stored"},"503":{"description":"CSV imports are not configured"},"404":{"description":"License or import profile not found"},"413":{"description":"The file is too large"},"415":{"description":"The file is not a CSV file"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","license_id","kind"],"properties":{"file":{"type":"string","format":"binary"},"license_id":{"type":"integer"},"kind":{"type":"string","enum":["addresses","manifests"]},"integration_id":{"type":"integer","description":"The import profile to change, if any"}}}}}}}},"/admin/csv-samples/{sample_id}/validations":{"post":{"tags":["admin"],"summary":"Check a mapping against a sample CSV file","description":"Check how a mapping reads and maps a sample, without importing anything:\nwhat the mapping lacks, or else what importing the sample would do.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"validate_csv_sample_admin_csv_samples__sample_id__validations_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"sample_id","in":"path","required":true,"schema":{"type":"string","title":"Sample Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCsvSampleValidationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCsvSampleValidationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"No access to the whole license"},"422":{"description":"E.g. too many rows once the first row is data too"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Not a sample id"},"410":{"description":"The sample expired, or is of another license"}}}},"/admin/dashboard":{"get":{"tags":["admin"],"summary":"Get the dashboard widgets for a license","description":"List the dashboard widgets that apply to the license and that the admin may see,\nin display order.\n\n**Required Capability**: view_expenses or view_users, depending on the widget","operationId":"get_dashboard_admin_dashboard_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardOverviewResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/dashboard/reimbursements":{"get":{"tags":["admin"],"summary":"Get the reimbursements dashboard widget","description":"Return the completed expenses of the month, per expense rule type.\n\n**Required Capability**: view_expenses","operationId":"get_dashboard_reimbursements_admin_dashboard_reimbursements_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{3}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Month (YYYY-MM), defaults to last month","title":"Month"},"description":"Month (YYYY-MM), defaults to last month"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardReimbursementsResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/dashboard/km":{"get":{"tags":["admin"],"summary":"Get the kilometres dashboard widget","description":"Return the kilometres from completed trip expenses of the month, per objective.\n\n**Required Capability**: view_expenses","operationId":"get_dashboard_km_admin_dashboard_km_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{3}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Month (YYYY-MM), defaults to last month","title":"Month"},"description":"Month (YYYY-MM), defaults to last month"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardKmResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/dashboard/wfh":{"get":{"tags":["admin"],"summary":"Get the work location dashboard widget","description":"Return the days worked from home and at the office in the month.\n\n**Required Capability**: view_expenses","operationId":"get_dashboard_wfh_admin_dashboard_wfh_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{3}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Month (YYYY-MM), defaults to last month","title":"Month"},"description":"Month (YYYY-MM), defaults to last month"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardWfhResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/dashboard/nsbc":{"get":{"tags":["admin"],"summary":"Get the NS Business Card dashboard widget","description":"Return the NS Business Card transactions of the month.\n\n**Required Capability**: view_expenses","operationId":"get_dashboard_nsbc_admin_dashboard_nsbc_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{3}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Month (YYYY-MM), defaults to last month","title":"Month"},"description":"Month (YYYY-MM), defaults to last month"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardNsbcResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/dashboard/co2":{"get":{"tags":["admin"],"summary":"Get the CO2 and modality dashboard widget","description":"Return the business and commute trips of the month, per modality group.\n\n**Required Capability**: view_users","operationId":"get_dashboard_co2_admin_dashboard_co2_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"The license to show the dashboard for","title":"License Id"},"description":"The license to show the dashboard for"},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{3}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"Month (YYYY-MM), defaults to last month","title":"Month"},"description":"Month (YYYY-MM), defaults to last month"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardCo2Response"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"List users accessible to the admin","description":"List all users the authenticated admin has access to.\n\nThis is the tenant-wide user list, so only tenant-level (or global) permissions\ngrant access; license-scoped admins get a 403 and use the license's\nsubscriptions instead. A user is visible when their tenant is covered by one of\nthose tenant-level permissions.\n\n**Required Capability**: view_users (tenant-level or global permission)","operationId":"list_users_admin_users_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email, user ID, or first/last name","title":"Search"},"description":"Search by email, user ID, or first/last name"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"Get user details","description":"Get full details for a single user including their primary subscription.\n\nAccess is restricted to users within the admin's scope.\n\n**Required Capability**: view_users (tenant-level or global permission)","operationId":"get_user_admin_users__user_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserDetailResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/users/{user_id}/firebase":{"get":{"tags":["admin"],"summary":"Get Firebase account info for a user","description":"Get Firebase account info for a user: sign-in providers, email verification\nstatus, and whether the account is disabled.\n\nAccess is restricted to users within the admin's scope.\n\n**Required Capability**: view_users (tenant-level or global permission)","operationId":"get_user_firebase_admin_users__user_id__firebase_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserFirebaseResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"Could not reach Firebase"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/users/{user_id}/firebase/verify-email":{"post":{"tags":["admin"],"summary":"Mark a user's email as verified in Firebase","description":"Mark the user's email address as verified in Firebase.\n\nAccess is restricted to users within the admin's scope.\n\n**Required Capability**: manage_users (tenant-level or global permission)","operationId":"verify_user_email_admin_users__user_id__firebase_verify_email_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserFirebaseResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks the manage_users capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"Could not reach Firebase"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/users/{user_id}/firebase/disable":{"post":{"tags":["admin"],"summary":"Disable a user's Firebase account","description":"Disable the user's Firebase account (prevents sign-in).\n\nAccess is restricted to users within the admin's scope.\n\n**Required Capability**: manage_users (tenant-level or global permission)","operationId":"disable_user_account_admin_users__user_id__firebase_disable_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserFirebaseResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks the manage_users capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"Could not reach Firebase"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/users/{user_id}/firebase/enable":{"post":{"tags":["admin"],"summary":"Enable a user's Firebase account","description":"Re-enable a previously disabled Firebase account.\n\nAccess is restricted to users within the admin's scope.\n\n**Required Capability**: manage_users (tenant-level or global permission)","operationId":"enable_user_account_admin_users__user_id__firebase_enable_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserFirebaseResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks the manage_users capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"Could not reach Firebase"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/users/{user_id}/days":{"get":{"tags":["admin"],"summary":"List a user's days","description":"List the days of a single user, ordered by date (newest first).\n\nAccess is restricted to users within the admin's scope — the same\nboundary as `GET /admin/users/{user_id}`. Supports filtering by the\nwork-from-home flag, completion state, and an inclusive date range.\n\n**Required Capability**: view_users (tenant-level or global permission)","operationId":"list_user_days_admin_users__user_id__days_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"wfh","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by the work-from-home flag","title":"Wfh"},"description":"Filter by the work-from-home flag"},{"name":"completed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by completion: true = state is 'completed', false = state is not 'completed'","title":"Completed"},"description":"Filter by completion: true = state is 'completed', false = state is not 'completed'"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include days on or after this date (inclusive)","title":"Start Date"},"description":"Include days on or after this date (inclusive)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include days on or before this date (inclusive)","title":"End Date"},"description":"Include days on or before this date (inclusive)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDayListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/distances/{address1_id}/{address2_id}":{"get":{"tags":["admin"],"summary":"Get the stored distances between two addresses","description":"Return every stored distance between two addresses.\n\nBoth directions are returned (``address1 -> address2`` and\n``address2 -> address1``) and, unless ``modality_id`` is given, every\nmodality. The admin must be able to access both addresses.\n\n**Required Capability**: view_users","operationId":"get_distance_pair_admin_distances__address1_id___address2_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address1_id","in":"path","required":true,"schema":{"type":"integer","title":"Address1 Id"}},{"name":"address2_id","in":"path","required":true,"schema":{"type":"integer","title":"Address2 Id"}},{"name":"modality_id","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ModalityEnum"},{"type":"null"}],"description":"Filter by modality","title":"Modality Id"},"description":"Filter by modality"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDistanceCollectionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"Forbidden - no access to one or both addresses"},"422":{"description":"address1_id and address2_id must be different"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"One or both addresses not found"}}},"put":{"tags":["admin"],"summary":"Create or update the distance between two addresses","description":"Create or update the distance for the direction ``address1 -> address2``\nand the given modality (default ``car``).\n\nReturns 201 when a new row is created and 200 when an existing row is\nupdated. To set the reverse direction, call again with the ids swapped.\n\n**Required Capability**: manage_users","operationId":"upsert_distance_admin_distances__address1_id___address2_id__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address1_id","in":"path","required":true,"schema":{"type":"integer","title":"Address1 Id"}},{"name":"address2_id","in":"path","required":true,"schema":{"type":"integer","title":"Address2 Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpsertDistanceRequest"}}}},"responses":{"200":{"description":"Distance updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDistanceResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"Forbidden - no access to one or both addresses"},"422":{"description":"Invalid input"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"201":{"description":"Distance created"},"404":{"description":"One or both addresses not found"}}}},"/admin/distances":{"get":{"tags":["admin"],"summary":"List distances touching any of the given addresses","description":"List every stored distance whose start OR stop address is one of\n``address_id``.\n\nEach stored row is returned at most once: a ``1 -> 2`` row and a ``2 -> 1``\nrow both come back (once each), but a single row that touches two requested\naddresses is not duplicated. Only distances where the admin can access BOTH\nendpoint addresses are returned, so inaccessible addresses are never\nrevealed. Unknown ids are ignored.\n\n**Required Capability**: view_users","operationId":"list_distances_admin_distances_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"address_id","in":"query","required":true,"schema":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"description":"Addresses to find distances for (repeat the param)","title":"Address Id"},"description":"Addresses to find distances for (repeat the param)"},{"name":"modality_id","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ModalityEnum"},{"type":"null"}],"description":"Filter by modality","title":"Modality Id"},"description":"Filter by modality"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Page Size"},"description":"Items per page"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDistanceListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-groups":{"get":{"tags":["admin"],"summary":"List expense groups with rules","description":"List all expense groups with their challenge and trip rules.\n\nAutomatically filters based on user's permissions and the view_expenses capability.\n\n**Required Capability**: view_expenses","operationId":"list_expense_groups_admin_expense_groups_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific license","title":"License Id"},"description":"Filter by specific license"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Page Size"},"description":"Items per page"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseGroupListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-groups/{group_id}":{"get":{"tags":["admin"],"summary":"Get expense group by ID","description":"Get a single expense group with all its rules (challenge, trip, and\ntransaction NSBC).\n\nAccess is restricted to expense groups belonging to licenses the authenticated\nadmin can access with the view_expenses capability.","operationId":"get_expense_group_admin_expense_groups__group_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseGroupResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Expense group not found or no access"}}}},"/admin/expense-rules":{"get":{"tags":["admin"],"summary":"List expense rules grouped by license and type","description":"Return all expense rules accessible to the authenticated admin,\ngrouped per license and per rule type (trip, challenge, transaction NSBC).\n\nAutomatically filters based on user's permissions and the view_expenses capability.\n\n**Required Capability**: view_expenses","operationId":"list_expense_rules_admin_expense_rules_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific license","title":"License Id"},"description":"Filter by specific license"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminExpenseRulesByLicenseResponse"},"title":"Response List Expense Rules Admin Expense Rules Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-trip-rules":{"post":{"tags":["admin"],"summary":"Create trip expense rules","description":"Create one or more trip expense rules for a license.\n\nAll rows share the same base configuration (distances, compensation rates,\nmodalities, etc.). Each entry in `rows` produces one DB row, with its own\n`wage_component`, `project_code_id`, `objectives`, and `group_id`.\n\n**Required Capability**: manage_license_settings","operationId":"create_trip_rules_admin_expense_trip_rules_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateTripRulesRequest"}}}},"responses":{"201":{"description":"Trip rules created","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminExpenseTripRuleResponse"},"title":"Response Create Trip Rules Admin Expense Trip Rules Post"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the specified license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-challenge-rules":{"post":{"tags":["admin"],"summary":"Create challenge expense rules","description":"Create one or more challenge expense rules for a license.\n\nAll rows share the same base configuration (compensation, status, etc.).\nEach entry in `rows` produces one DB row with its own `wage_component` and\n`group_id`.\n\n**Required Capability**: manage_license_settings","operationId":"create_challenge_rules_admin_expense_challenge_rules_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateChallengeRulesRequest"}}}},"responses":{"201":{"description":"Challenge rules created","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminExpenseChallengeRuleResponse"},"title":"Response Create Challenge Rules Admin Expense Challenge Rules Post"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the specified license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-transaction-nsbc-rules":{"post":{"tags":["admin"],"summary":"Create transaction NSBC expense rules","description":"Create one or more transaction NSBC expense rules for a license.\n\nAll rows share the same base configuration (priority, product codes, travel classes,\ncompensated percentage, etc.). Each entry in `rows` produces one DB row with its own\n`wage_component` and `group_id`.\n\n**Required Capability**: manage_license_settings","operationId":"create_transaction_nsbc_rules_admin_expense_transaction_nsbc_rules_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateTransactionNSBCRulesRequest"}}}},"responses":{"201":{"description":"NSBC rules created","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminExpenseTransactionNSBCRuleResponse"},"title":"Response Create Transaction Nsbc Rules Admin Expense Transaction Nsbc Rules Post"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the specified license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expense-trip-rules/{rule_id}":{"patch":{"tags":["admin"],"summary":"Update a trip expense rule","description":"Partially update a single trip expense rule.\n\nOnly the fields present in the request body are changed. `id` and `license_id`\nare immutable and rejected if supplied.\n\n**Required Capability**: manage_license_settings","operationId":"update_trip_rule_admin_expense_trip_rules__rule_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","description":"Trip rule ID","title":"Rule Id"},"description":"Trip rule ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateTripRuleRequest"}}}},"responses":{"200":{"description":"Trip rule updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseTripRuleResponse"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the rule's license"},"422":{"description":"Invalid input (e.g. null on a required field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Rule not found"}}}},"/admin/expense-challenge-rules/{rule_id}":{"patch":{"tags":["admin"],"summary":"Update a challenge expense rule","description":"Partially update a single challenge expense rule.\n\nOnly the fields present in the request body are changed. `id` and `license_id`\nare immutable and rejected if supplied.\n\n**Required Capability**: manage_license_settings","operationId":"update_challenge_rule_admin_expense_challenge_rules__rule_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","description":"Challenge rule ID","title":"Rule Id"},"description":"Challenge rule ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateChallengeRuleRequest"}}}},"responses":{"200":{"description":"Challenge rule updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseChallengeRuleResponse"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the rule's license"},"422":{"description":"Invalid input (e.g. null on a required field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Rule not found"}}}},"/admin/expense-transaction-nsbc-rules/{rule_id}":{"patch":{"tags":["admin"],"summary":"Update a transaction NSBC expense rule","description":"Partially update a single transaction NSBC expense rule.\n\nOnly the fields present in the request body are changed. `id` and `license_id`\nare immutable and rejected if supplied.\n\n**Required Capability**: manage_license_settings","operationId":"update_transaction_nsbc_rule_admin_expense_transaction_nsbc_rules__rule_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer","description":"Transaction NSBC rule ID","title":"Rule Id"},"description":"Transaction NSBC rule ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateTransactionNSBCRuleRequest"}}}},"responses":{"200":{"description":"NSBC rule updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseTransactionNSBCRuleResponse"}}}},"401":{"description":"Unauthorized – invalid or missing token"},"403":{"description":"Forbidden – no access to the rule's license"},"422":{"description":"Invalid input (e.g. null on a required field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Rule not found"}}}},"/admin/expenses":{"get":{"tags":["admin"],"summary":"List expenses","description":"List expenses filtered by the admin's accessible licenses.\n\nSupports filtering by license(s), expense rule(s) (trip/challenge/NSBC), user ID,\nuser email, date range (`expensed_on`), and title search, and sorting on the\nfields of `ExpenseSortField`.\n\n**Required Capability**: view_expenses","operationId":"list_expenses_admin_expenses_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"expense_trip_rule_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by trip rule IDs (repeatable)","default":[],"title":"Expense Trip Rule Ids"},"description":"Filter by trip rule IDs (repeatable)"},{"name":"expense_challenge_rule_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by challenge rule IDs (repeatable)","default":[],"title":"Expense Challenge Rule Ids"},"description":"Filter by challenge rule IDs (repeatable)"},{"name":"expense_transaction_nsbc_rule_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by NSBC rule IDs (repeatable)","default":[],"title":"Expense Transaction Nsbc Rule Ids"},"description":"Filter by NSBC rule IDs (repeatable)"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by exact user ID","title":"User Id"},"description":"Filter by exact user ID"},{"name":"user_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by user email (partial, case-insensitive)","title":"User Email"},"description":"Search by user email (partial, case-insensitive)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter expenses on or after this date (expensed_on)","title":"Start Date"},"description":"Filter expenses on or after this date (expensed_on)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter expenses on or before this date (expensed_on)","title":"End Date"},"description":"Filter expenses on or before this date (expensed_on)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by title (partial, case-insensitive)","title":"Search"},"description":"Search by title (partial, case-insensitive)"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ExpenseSortField","description":"Field to sort on (default: expensed_on)","default":"expensed_on"},"description":"Field to sort on (default: expensed_on)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates and amounts, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates and amounts, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/expenses/{expense_id}":{"patch":{"tags":["admin"],"summary":"Update the status of an expense","description":"Change the status of an expense. Setting `completed` also records the\ncompletion time if there is none yet, as completing a month does for the\nemployee; no other dates change.\n\n**Required Capability**: manage_expenses","operationId":"update_expense_admin_expenses__expense_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"integer","title":"Expense Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateExpenseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExpenseResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"The expense belongs to a license the admin cannot manage"},"422":{"description":"The status is not one of new, submitted, failed, completed"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Expense not found"}}},"delete":{"tags":["admin"],"summary":"Delete an expense","description":"Delete an expense that has not been processed yet (status `new`). The trips,\ndays, transactions and receipts it covered are kept and become unexpensed.\n\n**Required Capability**: manage_expenses","operationId":"delete_expense_admin_expenses__expense_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"expense_id","in":"path","required":true,"schema":{"type":"integer","title":"Expense Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"The expense belongs to a license the admin cannot manage"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Expense not found"},"409":{"description":"Only expenses with status new can be deleted"}}}},"/admin/subscriptions":{"get":{"tags":["admin"],"summary":"List all subscriptions","description":"Get all subscriptions filtered by user's permissions.\n\nAutomatically filters results based on the authenticated user's accessible\nlicenses and departments. Users can only see subscriptions for licenses/departments\nthey have permission to access.\n\nQuery Parameters:\n- license_id: Optional filter by specific license (must have access)\n- department_id: Optional filter by department\n- expense_group_id: Optional filter by expense group ID\n- page: Page number (1-indexed), default 1\n- page_size: Items per page (1-100), default 50\n- search: Search term to filter by email or user name\n- status: Filter by status, repeatable (active, inactive, deleted)\n- wpm: Filter on the WPM flag\n- expired: True for an expiry date today or earlier, False otherwise\n\nReturns:\n    Paginated list of subscriptions","operationId":"list_subscriptions_admin_subscriptions_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific license (must have access)","title":"License Id"},"description":"Filter by specific license (must have access)"},{"name":"department_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific department","title":"Department Id"},"description":"Filter by specific department"},{"name":"expense_group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by expense group ID","title":"Expense Group Id"},"description":"Filter by expense group ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term for email/user name","title":"Search"},"description":"Search term for email/user name"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["active","inactive","deleted"],"type":"string"}},{"type":"null"}],"description":"Filter by status (repeatable)","title":"Status"},"description":"Filter by status (repeatable)"},{"name":"wpm","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter on the subscription's WPM flag","title":"Wpm"},"description":"Filter on the subscription's WPM flag"},{"name":"expired","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True: expiry date today or earlier; False: not expired","title":"Expired"},"description":"True: expiry date today or earlier; False: not expired"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"List of subscriptions filtered by user's permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/subscription-manifests":{"get":{"tags":["admin"],"summary":"List all subscription manifests","description":"Get all subscription manifests filtered by user's permissions.\n\nSubscription manifests represent potential subscriptions that can be claimed\nby users with matching email addresses.\n\nAutomatically filters results based on the authenticated user's accessible licenses.\n\nQuery Parameters:\n- license_id: Optional filter by specific license (must have access)\n- page: Page number (1-indexed), default 1\n- page_size: Items per page (1-100), default 50\n- search: Search term to filter by email or external user ID\n- wpm: Filter on the WPM flag\n- active: True for manifests without an expiry or expiring in the future\n- claimed: Whether a subscription was created from the manifest\n- department_id: Filter by department\n- expense_group_id: Filter by expense group ID\n\nReturns:\n    Paginated list of subscription manifests","operationId":"list_subscription_manifests_admin_subscription_manifests_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by specific license (must have access)","title":"License Id"},"description":"Filter by specific license (must have access)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term for email or external user ID","title":"Search"},"description":"Search term for email or external user ID"},{"name":"wpm","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter on the manifest's WPM flag","title":"Wpm"},"description":"Filter on the manifest's WPM flag"},{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True: not expired (no or a future expiry); False: expired","title":"Active"},"description":"True: not expired (no or a future expiry); False: expired"},{"name":"claimed","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether an employee has turned it into a subscription","title":"Claimed"},"description":"Whether an employee has turned it into a subscription"},{"name":"department_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by department","title":"Department Id"},"description":"Filter by department"},{"name":"expense_group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by expense group ID","title":"Expense Group Id"},"description":"Filter by expense group ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"List of subscription manifests filtered by user's permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionManifestListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/subscriptions/{user_id}":{"get":{"tags":["admin"],"summary":"Get subscription details for a user","description":"Get subscription details for a specific user.\n\nReturns the user's subscription if the authenticated admin has permission\nto access the subscription's license. When the user holds several, returns\nthe most relevant one, in the order of ``list_user_subscriptions`` (deleted\nones last).\n\nPath Parameters:\n- user_id: Firebase UID of the user\n\nReturns:\n    Subscription details\n\nRaises:\n    404: If subscription not found or user doesn't have access","operationId":"get_user_subscription_admin_subscriptions__user_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Subscription details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found or no access"}}}},"/admin/users/{user_id}/subscriptions":{"get":{"tags":["admin"],"summary":"List all subscriptions held by a user","description":"List every subscription a user holds that the admin can access.\n\nA user normally has one subscription, but may hold several (today only when the\nextras are inactive). Subscriptions are ordered so the most relevant one comes\nfirst: active before inactive, then by expiry date descending (a subscription\nthat never expires sorts first), then by creation date descending.\n\nSubscriptions with status ``deleted`` are omitted. Subscriptions on licenses\noutside the admin's scope are omitted as well, so an accessible user with no\naccessible subscriptions yields an empty list rather than a 404.\n\n**Required Capability**: view_users","operationId":"list_user_subscriptions_admin_users__user_id__subscriptions_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserSubscriptionCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/subscriptions/{user_id}/{license_id}/rules":{"get":{"tags":["admin"],"summary":"Get expense rules applicable to a subscription","description":"Get all expense rules that apply to one of a user's subscriptions.\n\nRules are matched on the subscription's ``license_id`` and **expense group**\n(``subscriptions.group_id`` -> ``expense_groups.id``), never its department. A\nsubscription with no expense group matches only rules that themselves have\n``group_id=null``.\n\nTakes the license explicitly because a user may hold several subscriptions, each\nwith its own license and expense group — and therefore its own set of rules.\n\n**Required Capability**: view_users","operationId":"get_user_expense_rules_admin_subscriptions__user_id___license_id__rules_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserExpenseRulesResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found or no access"}}}},"/admin/subscriptions/{user_id}/{license_id}/status":{"patch":{"tags":["admin"],"summary":"Enable or disable a user's subscription","description":"Enable or disable a user's subscription.\n\n``enabled=true`` sets the status to ``active``; ``enabled=false`` sets it to\n``inactive`` (a reversible disable, distinct from the user-facing unsubscribe\nwhich marks the subscription ``deleted``). Only ``active`` counts as active\n(``is_active``).\n\n**Required Capability**: manage_users","operationId":"set_subscription_status_admin_subscriptions__user_id___license_id__status_patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetSubscriptionStatusRequest"}}}},"responses":{"200":{"description":"Subscription status updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"description":"Invalid input (e.g. missing 'enabled' flag)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found or no access"}}}},"/admin/subscriptions/{user_id}/{license_id}/expiry":{"patch":{"tags":["admin"],"summary":"Set or clear a subscription's expiry date","description":"Set or clear the expiry date on a user's subscription.\n\nSend a date in ``expires_on`` to set the expiry, or ``null`` to clear it (the\nsubscription no longer expires). Once past the expiry date the subscription is\nno longer active (``is_active`` accounts for ``expires_on``).\n\n**Required Capability**: manage_users","operationId":"set_subscription_expiry_admin_subscriptions__user_id___license_id__expiry_patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetSubscriptionExpiryRequest"}}}},"responses":{"200":{"description":"Expiry updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"description":"Invalid input (e.g. missing 'expires_on' field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found or no access"}}}},"/admin/features":{"get":{"tags":["admin"],"summary":"List all features","description":"Return all features available in the system, ordered by name.\n\n**Required Capability**: view_users","operationId":"list_features_admin_features_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminFeatureResponse"},"title":"Response List Features Admin Features Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/features":{"get":{"tags":["admin"],"summary":"List features for a license","description":"Return all features assigned to a specific license, including whether each is\nenabled and any per-license config.\n\n**Required Capability**: view_users","operationId":"list_license_features_admin_licenses__license_id__features_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminLicenseFeatureResponse"},"title":"Response List License Features Admin Licenses  License Id  Features Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Assign a feature to a license","description":"Assign a catalog feature to a license, enabled or not, with an optional config.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope for the\nlicense.","operationId":"create_license_feature_admin_licenses__license_id__features_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateLicenseFeatureRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseFeatureResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Feature not found in the catalog"},"409":{"description":"Feature already assigned to the license"}}}},"/admin/licenses/{license_id}/features/{feature_name}":{"put":{"tags":["admin"],"summary":"Update a license feature","description":"Replace whether a license feature is enabled and its config.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope for the\nlicense.","operationId":"update_license_feature_admin_licenses__license_id__features__feature_name__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"feature_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the feature","title":"Feature Name"},"description":"Name of the feature"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateLicenseFeatureRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseFeatureResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Feature not assigned to the license"}}},"delete":{"tags":["admin"],"summary":"Remove a feature from a license","description":"Remove a feature from a license.\n\nSubscription overrides of the feature stay and keep applying on their own.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope for the\nlicense.","operationId":"delete_license_feature_admin_licenses__license_id__features__feature_name__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"feature_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the feature","title":"Feature Name"},"description":"Name of the feature"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Feature removed"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Feature not assigned to the license"}}}},"/admin/subscriptions/{user_id}/{license_id}/features":{"get":{"tags":["admin"],"summary":"List effective feature flags for a subscription","description":"Return the effective feature flags for one subscription.\n\nRows from ``subscription_features`` are returned with ``source=\"subscription\"``;\nthey override the license. Features assigned to the license that have no such\noverride are returned with ``source=\"license\"`` so the full effective picture is\nvisible in one call.\n\n**Required Capability**: view_users","operationId":"list_subscription_features_admin_subscriptions__user_id___license_id__features_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionFeatureCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription not found or no access"}}}},"/admin/subscriptions/{user_id}/{license_id}/features/{feature_name}":{"put":{"tags":["admin"],"summary":"Create or update a subscription feature override","description":"Create or update the ``subscription_features`` row for one feature.\n\nUse this both to add a brand new override and to change an existing one — it is\nan upsert on (``user_id``, ``license_id``, ``feature_name``). Setting\n``enabled=false`` explicitly disables a feature the license enables; deleting the\nrow instead makes the subscription inherit the license again.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope for the\nsubscription's license.","operationId":"upsert_subscription_feature_admin_subscriptions__user_id___license_id__features__feature_name__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"feature_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the feature","title":"Feature Name"},"description":"Name of the feature"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpsertSubscriptionFeatureRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSubscriptionFeatureResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"description":"Invalid input (e.g. missing 'enabled' flag)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription, license or feature not found"}}},"delete":{"tags":["admin"],"summary":"Delete a subscription feature override","description":"Remove a subscription-level feature override.\n\nThe subscription falls back to whatever the license grants. Inherited\n(``source=\"license\"``) rows have nothing to delete and yield a 404.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope for the\nsubscription's license.","operationId":"delete_subscription_feature_admin_subscriptions__user_id___license_id__features__feature_name__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the user","title":"User Id"},"description":"Firebase UID of the user"},{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID of the subscription","title":"License Id"},"description":"License ID of the subscription"},{"name":"feature_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the feature","title":"Feature Name"},"description":"Name of the feature"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Override removed"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability or access"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Subscription or override not found"}}}},"/admin/integration-providers":{"get":{"tags":["admin"],"summary":"List the providers an integration can be created for","description":"List the providers the dashboard can connect, and whether Fynch has set\neach up in this environment yet.\n\nWith `license_id`, only the providers the license's integrations feature\nallows are listed, each with the `allowed_types` the license may create.\n\n**Required Capability**: manage_license_settings","operationId":"list_integration_providers_admin_integration_providers_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Only the providers this license may use, with the integration types it may create","title":"License Id"},"description":"Only the providers this license may use, with the integration types it may create"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationProviderListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/integrations":{"get":{"tags":["admin"],"summary":"List integrations by license","description":"List the integrations of the admin's accessible licenses, with the health\nof each and its last and next run. Deleted integrations are left out.\n\n**Required Capability**: manage_license_settings","operationId":"list_integrations_admin_integrations_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by a single license (deprecated)","title":"License Id"},"description":"Filter by a single license (deprecated)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","inactive"],"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IntegrationSortField","description":"Field to sort on (default: created_on)","default":"created_on"},"description":"Field to sort on (default: created_on)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Page Size"},"description":"Items per page"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Connect a license to a provider","description":"Create an integration awaiting authorization. For an oauth provider, also\nreturn the link the admin opens in a new tab to log in at the provider;\nthe provider's return leg sends that tab back to the dashboard. A\ncredentials provider (Personio) is connected next with\n`PUT /integrations/{id}/credentials`.\n\nCSV integrations are created as import profiles, with\n`POST /import-profiles`.\n\n**Required Capability**: manage_license_settings","operationId":"create_integration_admin_integrations_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateIntegrationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateIntegrationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"No access to the license"},"422":{"description":"Unknown provider"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The admin dashboard URL is not configured"},"409":{"description":"Fynch hasn't set up the provider yet"}}}},"/admin/integrations/{integration_id}":{"get":{"tags":["admin"],"summary":"Get an integration","description":"Get an integration with its health, its last and next run, and a run started\nfrom the dashboard that is still queued or running.\n\n**Required Capability**: manage_license_settings","operationId":"get_integration_admin_integrations__integration_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"}}},"patch":{"tags":["admin"],"summary":"Update an integration","description":"Pause or resume an integration, set or clear its schedule, choose the\nemployer (Loket) or company (Nmbrs) it imports, or map its custom\nfields onto the manifest (Personio). Fields left out stay as they\nare; `schedule: null` stops the scheduled runs. Import profiles are\nupdated under /import-profiles.\n\nA new schedule is planned within the hour.\n\n**Required Capability**: manage_license_settings","operationId":"update_integration_admin_integrations__integration_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateIntegrationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"Invalid schedule or field mapping"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Company already imported, or not manageable here"}}},"delete":{"tags":["admin"],"summary":"Delete an integration","description":"Delete an integration. Its planned runs are dropped; its run history stays.\nImport profiles are deleted under /import-profiles.\n\n**Required Capability**: manage_license_settings","operationId":"delete_integration_admin_integrations__integration_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not manageable here"}}}},"/admin/integrations/{integration_id}/authorizations":{"post":{"tags":["admin"],"summary":"Get a new link to authorize an integration","description":"Return a new authorization link, to retry a cancelled or expired one or to\nreauthorize. A working connection keeps working until the new\nauthorization completes.\n\n**Required Capability**: manage_license_settings","operationId":"create_integration_authorization_admin_integrations__integration_id__authorizations_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationAuthorizationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The admin dashboard URL is not configured"},"404":{"description":"Integration not found"},"409":{"description":"The integration can't be authorized from here"}}}},"/admin/integrations/{integration_id}/previews":{"post":{"tags":["admin"],"summary":"Preview the first records an integration imports","description":"Fetch the first 10 records from the provider without importing anything.\nPoll the job for the rows. An import profile has no preview: its mapping\nis checked against a sample file instead (`/csv-samples`).\n\n**Required Capability**: manage_license_settings","operationId":"create_integration_preview_admin_integrations__integration_id__previews_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationJobResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not authorized, paused, or already in progress"}}}},"/admin/integrations/{integration_id}/companies":{"get":{"tags":["admin"],"summary":"List the companies an integration can import","description":"Fetch the employers (Loket) or companies (Nmbrs) the connection can\naccess, straight from the provider. A failure the admin can act on has a\nproblem type ending in its error code, e.g.\n`/errors/application/integration/authorization_failed`.\n\n**Required Capability**: manage_license_settings","operationId":"list_integration_companies_admin_integrations__integration_id__companies_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationCompanyListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"The provider failed or can't be reached"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not authorized, rejected by the provider, or busy"}}}},"/admin/integrations/{integration_id}/credentials":{"put":{"tags":["admin"],"summary":"Connect an integration with the customer's API credentials","description":"Connect a Personio integration with the client ID and secret the customer\ncreated in Personio, or replace them. They are checked with Personio first\nand only stored when accepted, so a working connection keeps working until\nnew credentials are. Rejected credentials have the problem type\n`/errors/application/integration/authorization_failed`. The secret is\nnever returned.\n\n**Required Capability**: manage_license_settings","operationId":"set_integration_credentials_admin_integrations__integration_id__credentials_put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"The provider rejected the credentials"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"The provider failed or can't be reached"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not connected with credentials, credentials already used on the license, or shared with another license"}}}},"/admin/integrations/{integration_id}/attributes":{"get":{"tags":["admin"],"summary":"List the custom attributes an integration can map","description":"Fetch the fields the provider (Personio) has for the first employees:\nits own fields, then the custom attributes found on them, each with a\nsample value and, for custom attributes, what its name suggests it holds.\nAlso list the manifest fields they can be mapped onto. Set the mapping\nwith `PATCH /integrations/{id}`. Failures have the same problem types as\nthe companies.\n\n**Required Capability**: manage_license_settings","operationId":"list_integration_attributes_admin_integrations__integration_id__attributes_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationAttributeListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"The provider failed or can't be reached"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not authorized, rejected by the provider, or busy"}}}},"/admin/integrations/{integration_id}/runs":{"post":{"tags":["admin"],"summary":"Run an integration now","description":"Import from the provider now, outside the schedule. The run shows in the\nrun log like a scheduled one. Import profiles are run under\n/import-profiles.\n\n**Required Capability**: manage_license_settings","operationId":"create_integration_run_admin_integrations__integration_id__runs_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationJobResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration not found"},"409":{"description":"Not authorized, paused, or already in progress"}}}},"/admin/integrations/{integration_id}/jobs/{workflow_id}":{"get":{"tags":["admin"],"summary":"Get the status of an integration job","description":"Poll a preview or run of an integration. A failed job has\nan error_code the dashboard translates.\n\n**Required Capability**: manage_license_settings","operationId":"get_integration_job_admin_integrations__integration_id__jobs__workflow_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationJobStatusResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration or job not found"}}}},"/admin/import-runs":{"get":{"tags":["admin"],"summary":"List imported CSV files","description":"List the CSV files imported with the import profiles of the licenses the\nadmin can access as a whole, newest first. Dates are days in Amsterdam\ntime.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"list_import_runs_admin_import_runs_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable)"},{"name":"integration_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by import profile (repeatable)","default":[],"title":"Integration Ids"},"description":"Filter by import profile (repeatable)"},{"name":"parent_task_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Only the files of these folder runs","default":[],"title":"Parent Task Ids"},"description":"Only the files of these folder runs"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CsvImportKind"},{"type":"null"}],"description":"Only addresses or manifests","title":"Kind"},"description":"Only addresses or manifests"},{"name":"trigger","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/IntegrationTaskTrigger"},{"type":"null"}],"description":"Only uploads, or only files from a profile's folder","title":"Trigger"},"description":"Only uploads, or only files from a profile's folder"},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobStatus"},"description":"Filter by status (repeatable); drafts and cancelled uploads are left out unless asked for","default":[],"title":"Status"},"description":"Filter by status (repeatable); drafts and cancelled uploads are left out unless asked for"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only files uploaded on or after","title":"Start Date"},"description":"Only files uploaded on or after"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only files uploaded on or before","title":"End Date"},"description":"Only files uploaded on or before"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ImportRunSortField","description":"Field to sort on (default: created_on)","default":"created_on"},"description":"Field to sort on (default: created_on)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportRunListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/import-runs/{task_id}":{"get":{"tags":["admin"],"summary":"Get an imported CSV file","description":"Get an imported file. Poll this while it is processing.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"get_import_run_admin_import_runs__task_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportRunDetailResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import run not found"}}},"patch":{"tags":["admin"],"summary":"Change how an uploaded CSV file is read and mapped","description":"Change how a draft's file is read (header row, delimiter, encoding) or how\nits columns map onto fields, for this file only. Once the mapping is\nusable, the whole file is validated without importing anything; until\nthen `mapping_issues` says what it lacks.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"update_import_run_admin_import_runs__task_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateImportRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportRunDetailResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"E.g. too many rows once the first row is data too"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import run not found"},"409":{"description":"The import has already started"}}},"delete":{"tags":["admin"],"summary":"Discard an uploaded CSV file","description":"Discard a draft and delete its file. Files that were imported stay as\nhistory.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"delete_import_run_admin_import_runs__task_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import run not found"},"409":{"description":"The import has already started"}}}},"/admin/import-runs/{task_id}/start":{"post":{"tags":["admin"],"summary":"Start importing an uploaded CSV file","description":"Start importing a draft. The file is validated once more; the rows that\ncan't be imported are listed under the run's failures once it finishes.\nWith `save_to_profile`, the draft's mapping becomes its profile's. Poll\nthe run for its progress.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"start_import_run_admin_import_runs__task_id__start_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AdminStartImportRunRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportRunDetailResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"The mapping is invalid, or no row can be imported"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"Jobs can't be started right now"},"404":{"description":"Import run not found"},"409":{"description":"The import has started, or its profile is paused"}}}},"/admin/import-profiles":{"get":{"tags":["admin"],"summary":"List import profiles","description":"List the import profiles of the licenses the admin can access as a whole,\nwith the health of each and its last and next run. Deleted profiles are\nleft out.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"list_import_profiles_admin_import_profiles_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable)"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CsvImportKind"},{"type":"null"}],"description":"Only addresses or manifests","title":"Kind"},"description":"Only addresses or manifests"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","inactive"],"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ImportProfileSortField","description":"Field to sort on (default: name)","default":"name"},"description":"Field to sort on (default: name)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportProfileListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Create an import profile","description":"Save how a kind of CSV file is read and mapped, e.g. as checked against a\nsample file, under a name of its own. With a schedule, the files dropped\ninto the profile's `folder` are imported then.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"create_import_profile_admin_import_profiles_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateImportProfileRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportProfileResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"description":"No access to the whole license"},"422":{"description":"The mapping is incomplete or the schedule invalid"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"CSV imports are not configured"},"409":{"description":"The license has a profile of that name"}}}},"/admin/import-profiles/{integration_id}":{"get":{"tags":["admin"],"summary":"Get an import profile","description":"Get an import profile with its health and its last and next run.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"get_import_profile_admin_import_profiles__integration_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportProfileResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import profile not found"}}},"patch":{"tags":["admin"],"summary":"Update an import profile","description":"Rename an import profile, change its mapping or schedule, or pause or\nresume it. Fields left out stay as they are; `schedule: null` stops the\nscheduled runs. Pausing discards the uploads waiting to be started.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"update_import_profile_admin_import_profiles__integration_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateImportProfileRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportProfileResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"The mapping is incomplete or the schedule invalid"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import profile not found"},"409":{"description":"The license has a profile of that name"}}},"delete":{"tags":["admin"],"summary":"Delete an import profile","description":"Delete an import profile. Its planned runs and the uploads waiting to be\nstarted are dropped; its run history stays, and so do the files in its\nfolder.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"delete_import_profile_admin_import_profiles__integration_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import profile not found"}}}},"/admin/import-profiles/{integration_id}/runs":{"post":{"tags":["admin"],"summary":"Upload a CSV file to import with a profile","description":"Upload a CSV file as a draft run of an import profile, with how it was\ndetected to be written and its first values per column. The profile's\nmapping is carried over to the file's columns, by header where it can,\nand the whole file is validated with it. Check the draft, change its\nmapping if need be (`PATCH /import-runs/{id}`), and start it.\n\nManifests take at most 10,000 rows and 5 MB, addresses 500 rows and 1 MB;\nsee `limits` in the response.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"create_import_run_admin_import_profiles__integration_id__runs_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminImportRunDetailResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"description":"The file is empty, unreadable or has too many rows"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"description":"The file can't be stored"},"503":{"description":"CSV imports are not configured"},"404":{"description":"Import profile not found"},"409":{"description":"The profile is paused"},"413":{"description":"The file is too large"},"415":{"description":"The file is not a CSV file"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}}}},"/admin/import-profiles/{integration_id}/folder-runs":{"post":{"tags":["admin"],"summary":"Import the new files in a profile's folder now","description":"Import the files dropped into the profile's folder since its last run,\noutside its schedule. Each file becomes a run of its own under this one.\nPoll the job like an integration's (`GET /integrations/{id}/jobs/{workflow_id}`).\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"create_import_profile_folder_run_admin_import_profiles__integration_id__folder_runs_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"integer","title":"Integration Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationJobResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Import profile not found"},"409":{"description":"Paused, or already in progress"}}}},"/admin/integration-runs":{"get":{"tags":["admin"],"summary":"List integration runs","description":"List the runs of the integrations of the admin's accessible licenses that\nhave started or were due, newest first. Planned future runs are left out.\nDates are days in Amsterdam time.\n\n**Required Capability**: manage_license_settings","operationId":"list_integration_runs_admin_integration_runs_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"integration_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by integration IDs (repeatable)","default":[],"title":"Integration Ids"},"description":"Filter by integration IDs (repeatable)"},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobStatus"},"description":"Filter by run status (repeatable)","default":[],"title":"Status"},"description":"Filter by run status (repeatable)"},{"name":"trigger","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/IntegrationTaskTrigger"},{"type":"null"}],"description":"Only scheduled, manual or uploaded runs","title":"Trigger"},"description":"Only scheduled, manual or uploaded runs"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only runs scheduled on or after this date","title":"Start Date"},"description":"Only runs scheduled on or after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only runs scheduled on or before this date","title":"End Date"},"description":"Only runs scheduled on or before this date"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IntegrationRunSortField","description":"Field to sort on (default: scheduled_at)","default":"scheduled_at"},"description":"Field to sort on (default: scheduled_at)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationRunListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/integration-runs/{task_id}":{"get":{"tags":["admin"],"summary":"Get an integration run","description":"Get a run, with the files a folder run of an import profile picked up.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"get_integration_run_admin_integration_runs__task_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationRunResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration run not found"}}}},"/admin/integration-runs/{task_id}/failures":{"get":{"tags":["admin"],"summary":"List the records of an integration run that failed","description":"List the records a run could not import, with every problem of each: the\nrows of a CSV file by row number, or the records a provider returned.\nOnly the offending values are shown, cut off at 100 characters. A folder\nrun's files have failures of their own.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"list_integration_run_failures_admin_integration_runs__task_id__failures_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationTaskFailureListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration run not found"},"410":{"description":"Deleted after the retention period"}}}},"/admin/integration-runs/{task_id}/failures/report":{"get":{"tags":["admin"],"summary":"Download the records of an integration run that failed","description":"Download the records a run could not import as a CSV file, in the\nlanguage of the request: of a CSV file, the mapped columns as they were,\nin its delimiter, and why each row failed. Fix them and import the file\nagain.\n\n**Required Capability**: manage_license_settings, for the whole license","operationId":"download_integration_run_failures_admin_integration_runs__task_id__failures_report_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","title":"Task Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Integration run not found, or nothing failed"},"410":{"description":"Deleted after the retention period"}}}},"/admin/users/{user_id}/expense-jobs":{"post":{"tags":["admin"],"summary":"Start an expense-generation job for a user's month","description":"Enqueue a bulk day-expense workflow that (re)generates the user's expenses for\nthe given month. Days that are open, failed, or submitted-but-still-'new' are\nprocessed — for the latter, all 'new' expenses on those days are deleted and\nthe day is re-opened before regeneration. Days with expenses that are\nsubmitted, completed, or declined upstream are untouched.\n\nPoll `GET /admin/jobs/{workflow_id}` for completion.\n\n**Required Capability**: manage_expenses","operationId":"create_expense_job_admin_users__user_id__expense_jobs_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateExpenseJobRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminJobResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"},"409":{"description":"No subscription, expense reporting disabled, or no processable days"}}}},"/admin/users/{user_id}/expense-report-jobs":{"post":{"tags":["admin"],"summary":"Start an expense-report send job for a user's month","description":"Enqueue a workflow that emails the user's expense report (Excel) for the given\nmonth to exactly one recipient: the requesting admin, the user themselves, or a\ncustom email address.\n\nBy default only expenses with status 'new' are included; with\n`new_expenses_only: false` the month's already-sent expenses ('submitted' and\n'completed') are reported too. 'failed' expenses are never reported. Either way\nthe reported expenses keep their status, and a month with nothing to report\nsends an empty-report email.\n\nPoll `GET /admin/jobs/{workflow_id}` for completion.\n\n**Required Capability**: manage_expenses","operationId":"create_expense_report_job_admin_users__user_id__expense_report_jobs_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateExpenseReportJobRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminJobResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"},"409":{"description":"No subscription, expense reporting disabled, or admin token has no email while recipient is 'admin'"}}}},"/admin/jobs/{workflow_id}":{"get":{"tags":["admin"],"summary":"Get the status of a background job","description":"Query the status of a workflow enqueued via the admin expense-job endpoints.\n\nThe job's target user must be within the admin's scope; otherwise the\njob is reported as not found.\n\n**Required Capability**: manage_expenses","operationId":"get_job_status_admin_jobs__workflow_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminJobStatusResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Job not found or its user outside the admin's scope"}}}},"/admin/licenses":{"get":{"tags":["admin"],"summary":"List accessible licenses","description":"Return all licenses the authenticated admin has access to.\n\nResults are filtered automatically based on the user's permissions.","operationId":"list_licenses_admin_licenses_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminLicenseDetailResponse"},"title":"Response List Licenses Admin Licenses Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Create a new license","description":"Create a new license in this deployment's tenant.\n\nOnly users with the **admin** role on a **tenant-level** permission (for this\ntenant) or a **global** permission can create licenses; a license-scoped admin\nrole never does.\n\n- A tenant-level admin already covers the new license, so no permission is\n  added.\n- A global admin is in the initial setup flow (see `GET /auth/permissions` →\n  428): their global permission is bound to the new license, so they become\n  that license's admin and `GET /auth/permissions` returns 200. Being no longer\n  global, they cannot create another license.\n\n**Required role**: admin (tenant-level or global permission)","operationId":"create_license_admin_licenses_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateLicenseRequest"}}}},"responses":{"201":{"description":"License created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseDetailResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires the admin role at tenant or global scope"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}":{"get":{"tags":["admin"],"summary":"Get license details","description":"Get detailed information about a specific license.\n\nAutomatically filters based on user's permissions and the view_users capability.\n\n**Required Capability**: view_users","operationId":"get_license_details_admin_licenses__license_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"License details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseDetailResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks permission to access this license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"License not found"}}},"patch":{"tags":["admin"],"summary":"Update a license","description":"Partially update a license.\n\nOnly the fields present in the request body are changed; omitted fields are\nleft untouched. `id` and `tenant_id` are immutable and rejected if supplied.\n\n**Required Capability**: manage_license_settings","operationId":"update_license_admin_licenses__license_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateLicenseRequest"}}}},"responses":{"200":{"description":"License updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseDetailResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - no access to this license"},"422":{"description":"Invalid input (e.g. null on a required field)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"License not found"}}}},"/admin/licenses/{license_id}/modules":{"get":{"tags":["admin"],"summary":"Get the modules a license uses","description":"List the platform modules the license uses, so the admin dashboard can hide the\nsections of modules it doesn't. A feature counts when it's enabled on the\nlicense or on any of its subscriptions.\n\n**Required Capability**: any capability on the license","operationId":"get_license_modules_admin_licenses__license_id__modules_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseModulesResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/departments":{"get":{"tags":["admin"],"summary":"List the departments of a license","description":"List the departments of a license, ordered by name, for filters on employee\nlists. Department-scoped admins only get their own departments.\n\n**Required Capability**: view_users","operationId":"list_license_departments_admin_licenses__license_id__departments_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDepartmentCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - no access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/subscription-manifests":{"patch":{"tags":["admin"],"summary":"Change many subscription manifests of a license","description":"Set the expiry date and/or WPM flag of the selected manifests. The change\napplies to the subscriptions linked to them too, like an import.\n\n**Required Capability**: manage_users, held at *tenant* scope.","operationId":"bulk_update_manifests_admin_licenses__license_id__subscription_manifests_patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminManifestBulkUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminManifestBulkUpdateResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level manage_users"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/subscription-manifests/bulk-delete":{"post":{"tags":["admin"],"summary":"Delete many subscription manifests of a license","description":"Delete the selected manifests. The subscriptions linked to them are unlinked\nand otherwise keep running. `confirm_count` must equal the number of\nmanifests selected, so an admin never deletes more than they confirmed.\n\n**Required Capability**: manage_users, held at *tenant* scope.","operationId":"bulk_delete_manifests_admin_licenses__license_id__subscription_manifests_bulk_delete_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminManifestBulkDeleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminManifestBulkDeleteResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level manage_users"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"409":{"description":"The selection no longer holds confirm_count manifests"}}}},"/admin/rbac/admin-users":{"get":{"tags":["admin"],"summary":"List admin users with their role assignments","description":"List admin users (grouped by user and email) with all their role\nassignments, limited to the caller's tenants.","operationId":"list_admin_users_admin_rbac_admin_users_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term for the admin's email","title":"Search"},"description":"Search term for the admin's email"},{"name":"role_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by role","title":"Role Id"},"description":"Filter by role"},{"name":"license_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by license scope","title":"License Id"},"description":"Filter by license scope"},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by tenant scope","title":"Tenant Id"},"description":"Filter by tenant scope"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Admin users grouped by user and email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRbacUserListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level read_admins"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/roles":{"get":{"tags":["admin"],"summary":"List all assignable roles","description":"List every role, including the tenant-level roles.","operationId":"list_rbac_roles_admin_rbac_roles_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRoleCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level read_admins"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/capabilities":{"get":{"tags":["admin"],"summary":"List all capabilities","description":"List every capability, for showing roles and granting extra capabilities.","operationId":"list_rbac_capabilities_admin_rbac_capabilities_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCapabilityCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level read_admins"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/scopes":{"get":{"tags":["admin"],"summary":"List assignable tenants and licenses","description":"List the tenants and licenses the caller may use as assignment scope.","operationId":"list_rbac_scopes_admin_rbac_scopes_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRbacScopesResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level read_admins"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/licenses/{license_id}/departments":{"get":{"tags":["admin"],"summary":"List departments of a license","description":"List the departments of a license, for department-scoped assignments.","operationId":"list_rbac_license_departments_admin_rbac_licenses__license_id__departments_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDepartmentCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - license outside the caller's tenants"},"422":{"description":"Unknown license"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/user-search":{"get":{"tags":["admin"],"summary":"Search users by email to grant a first role","description":"Search existing users by email address, limited to the caller's tenants.\nOnly existing users can be granted a role.","operationId":"search_rbac_users_admin_rbac_user_search_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","minLength":3,"description":"Partial email address (min 3 chars)","title":"Email"},"description":"Partial email address (min 3 chars)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserSearchCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level manage_admins"},"422":{"description":"Search term too short"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/rbac/permissions":{"post":{"tags":["admin"],"summary":"Grant a role to a user","description":"Grant a role, optionally with extra capabilities, to an existing user at\ntenant or license scope. Everything granted must be held by the caller on\na tenant-level or global grant covering that scope.","operationId":"create_rbac_permission_admin_rbac_permissions_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreatePermissionRequest"}}}},"responses":{"201":{"description":"Role assignment created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPermissionAssignmentResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - scope outside the caller's tenants, or granting capabilities the caller doesn't hold at that scope"},"422":{"description":"Invalid assignment (scope/role/department/capability rules)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found"},"409":{"description":"The user already has this role at this scope"}}}},"/admin/rbac/permissions/{permission_id}":{"patch":{"tags":["admin"],"summary":"Update a role assignment","description":"Partially update a role assignment (role, status, scope and/or extra\ncapabilities). Whatever the update grants beyond what the assignment\nalready granted must be held by the caller at the (new) scope.","operationId":"update_rbac_permission_admin_rbac_permissions__permission_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"permission_id","in":"path","required":true,"schema":{"type":"integer","description":"Permission ID","title":"Permission Id"},"description":"Permission ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdatePermissionRequest"}}}},"responses":{"200":{"description":"Role assignment updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPermissionAssignmentResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignment, scope not allowed, or granting capabilities the caller doesn't hold at that scope"},"422":{"description":"Invalid assignment (scope/role/department/capability rules)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Assignment not found or no access"},"409":{"description":"The user already has this role at this scope"}}},"delete":{"tags":["admin"],"summary":"Delete a role assignment","description":"Delete a single role assignment.","operationId":"delete_rbac_permission_admin_rbac_permissions__permission_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"permission_id","in":"path","required":true,"schema":{"type":"integer","description":"Permission ID","title":"Permission Id"},"description":"Permission ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Role assignment deleted"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignment or missing capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Assignment not found or no access"}}}},"/admin/rbac/admin-users/{user_id}":{"delete":{"tags":["admin"],"summary":"Delete all role assignments of an admin user","description":"Delete every role assignment of a user that falls within the caller's\nscope. Assignments outside the caller's tenants are left untouched.","operationId":"delete_rbac_admin_user_admin_rbac_admin_users__user_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the admin user","title":"User Id"},"description":"Firebase UID of the admin user"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"All role assignments deleted"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignments or missing capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"No role assignments found for this user"}}}},"/admin/receipt-categories":{"get":{"tags":["admin"],"summary":"List receipt categories","description":"List the receipt categories of the admin's accessible licenses.\n\nFollows the same rule as the app: a license with active categories of its own\nuses those; any other license uses the global categories (license_id null).\nInactive categories are included, because existing receipts can still carry\nthem; deleted ones are not. Names are translated into the request language.\n\n**Required Capability**: view_expenses","operationId":"list_receipt_categories_admin_receipt_categories_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Limit to these license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Limit to these license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReceiptCategoryCollectionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/receipts":{"get":{"tags":["admin"],"summary":"List receipts","description":"List user-uploaded receipts filtered by the admin's accessible licenses.\n\nSupports filtering by license(s), user, processing state, date range (receipt\ndate), title search, category and amount range, and sorting on the fields of\n`ReceiptSortField`.\n\n**Required Capability**: view_expenses","operationId":"list_receipts_admin_receipts_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ReceiptSortField","description":"Field to sort on (default: date)","default":"date"},"description":"Field to sort on (default: date)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates and amounts, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates and amounts, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"user_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by user email (partial, case-insensitive)","title":"User Email"},"description":"Search by user email (partial, case-insensitive)"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user ID (exact match)","title":"User Id"},"description":"Filter by user ID (exact match)"},{"name":"has_expense","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet","title":"Has Expense"},"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter receipts on or after this date","title":"Start Date"},"description":"Filter receipts on or after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter receipts on or before this date","title":"End Date"},"description":"Filter receipts on or before this date"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by title/description (partial, case-insensitive)","title":"Search"},"description":"Search by title/description (partial, case-insensitive)"},{"name":"receipt_category_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by receipt category IDs (repeatable: ?receipt_category_ids=1&receipt_category_ids=2)","default":[],"title":"Receipt Category Ids"},"description":"Filter by receipt category IDs (repeatable: ?receipt_category_ids=1&receipt_category_ids=2)"},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only receipts with an amount of at least this value","title":"Min Amount"},"description":"Only receipts with an amount of at least this value"},{"name":"max_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only receipts with an amount of at most this value","title":"Max Amount"},"description":"Only receipts with an amount of at most this value"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReceiptListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/receipts/bulk-download":{"get":{"tags":["admin"],"summary":"Download all receipts matching filters as a ZIP","description":"Download all receipts matching the given filters as a single ZIP archive.\n\nAccepts the same filters as the receipt list, so the archive holds exactly the\nreceipts the list shows. Sorting and pagination parameters are ignored.\n\nLimited to a maximum of 500 receipts — narrow your filters if the limit is exceeded.\nFiles missing from GCS are silently skipped.\n\n**Required Capability**: view_expenses","operationId":"bulk_download_receipts_admin_receipts_bulk_download_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"user_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by user email (partial, case-insensitive)","title":"User Email"},"description":"Search by user email (partial, case-insensitive)"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user ID (exact match)","title":"User Id"},"description":"Filter by user ID (exact match)"},{"name":"has_expense","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet","title":"Has Expense"},"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter receipts on or after this date","title":"Start Date"},"description":"Filter receipts on or after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter receipts on or before this date","title":"End Date"},"description":"Filter receipts on or before this date"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by title/description (partial, case-insensitive)","title":"Search"},"description":"Search by title/description (partial, case-insensitive)"},{"name":"receipt_category_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by receipt category IDs (repeatable: ?receipt_category_ids=1&receipt_category_ids=2)","default":[],"title":"Receipt Category Ids"},"description":"Filter by receipt category IDs (repeatable: ?receipt_category_ids=1&receipt_category_ids=2)"},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only receipts with an amount of at least this value","title":"Min Amount"},"description":"Only receipts with an amount of at least this value"},{"name":"max_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only receipts with an amount of at most this value","title":"Max Amount"},"description":"Only receipts with an amount of at most this value"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/receipts/{receipt_id}/file":{"get":{"tags":["admin"],"summary":"View or download a single receipt file","description":"Stream a receipt image or PDF from GCS.\n\nBy default the file is served inline (suitable for in-browser preview).\nPass `?download=true` to force a file download (Content-Disposition: attachment).\n\n**Required Capability**: view_expenses","operationId":"get_receipt_file_admin_receipts__receipt_id__file_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Receipt Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Set to true to force a file download instead of inline display","default":false,"title":"Download"},"description":"Set to true to force a file download instead of inline display"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/reports":{"get":{"tags":["admin"],"summary":"List the report files of a license","description":"Return the WPM reports and the expense bundles of a license, most recently\nchanged first. Personal reports of employees in the license's folder are left\nout.\n\n**Required Capability**: view_reports","operationId":"list_report_files_admin_licenses__license_id__reports_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportKind"},{"type":"null"}],"description":"Only one kind","title":"Kind"},"description":"Only one kind"},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2100,"minimum":2000},{"type":"null"}],"description":"Only WPM reports or bundles of this year","title":"Year"},"description":"Only WPM reports or bundles of this year"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportFileCollectionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The reports bucket isn't configured"}}}},"/admin/licenses/{license_id}/reports/download":{"get":{"tags":["admin"],"summary":"Download a report file of a license","description":"Download a WPM report or an expense bundle of the license.\n\n**Required Capability**: view_reports","operationId":"download_report_file_admin_licenses__license_id__reports_download_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"path","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The path of the file in the list, relative to the license","title":"Path"},"description":"The path of the file in the list, relative to the license"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The reports bucket isn't configured"},"404":{"description":"Report not found"}}}},"/admin/licenses/{license_id}/bundle":{"get":{"tags":["admin"],"summary":"Get the expense bundle layout of a license","description":"Return how the license's expense bundle is put together: its expense report\ntype, the premium features in the bundle, and its bundle feature's config,\ne.g. the sheets and wage components of a Loket bundle.\n\n**Required Capability**: view_reports","operationId":"get_license_bundle_admin_licenses__license_id__bundle_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLicenseBundleResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/members":{"get":{"tags":["admin"],"summary":"List the license's team members with their role assignments","description":"List the admin users of this license (grouped by user and email) with\ntheir license-scoped role assignments. Tenant-level staff are not listed.","operationId":"list_team_members_admin_team__license_id__members_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search term for the member's email","title":"Search"},"description":"Search term for the member's email"},{"name":"role_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by role","title":"Role Id"},"description":"Filter by role"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Team members grouped by user and email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRbacUserListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires read_team for this license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/roles":{"get":{"tags":["admin"],"summary":"List roles assignable within the license","description":"List the roles that may be assigned within a license. The restricted\nroles (admin/support) and tenant-level roles are excluded.","operationId":"list_team_roles_admin_team__license_id__roles_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRoleCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires read_team for this license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/capabilities":{"get":{"tags":["admin"],"summary":"List the extra capabilities the caller may grant within the license","description":"List the capabilities the caller may grant as extras within the license.\nEmpty unless the caller holds manage_admins on a grant covering the license;\nadmin management itself is never grantable here.","operationId":"list_team_capabilities_admin_team__license_id__capabilities_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCapabilityCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires manage_team for this license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/departments":{"get":{"tags":["admin"],"summary":"List departments of the license","description":"List the departments of the license, for department-scoped assignments.","operationId":"list_team_departments_admin_team__license_id__departments_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDepartmentCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires read_team for this license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/user-search":{"get":{"tags":["admin"],"summary":"Search users by email to add a team member","description":"Search existing users by email address, limited to the license's tenant.\nOnly existing users can be added to the team.","operationId":"search_team_users_admin_team__license_id__user_search_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"email","in":"query","required":true,"schema":{"type":"string","minLength":3,"description":"Partial email address (min 3 chars)","title":"Email"},"description":"Partial email address (min 3 chars)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserSearchCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires manage_team for this license"},"422":{"description":"Search term too short"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/team/{license_id}/permissions":{"post":{"tags":["admin"],"summary":"Grant a role within the license","description":"Grant a role to an existing user, scoped to this license. The license\nscope always comes from the URL path; tenant-level scopes are impossible.","operationId":"create_team_permission_admin_team__license_id__permissions_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateTeamPermissionRequest"}}}},"responses":{"201":{"description":"Role assignment created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPermissionAssignmentResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires manage_team for this license; extra capabilities also require manage_admins and may not exceed the caller's own"},"422":{"description":"Invalid assignment (restricted role/department/capability rules)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found in the license's tenant"},"409":{"description":"The user already has this role at this scope"}}}},"/admin/team/{license_id}/permissions/{permission_id}":{"patch":{"tags":["admin"],"summary":"Update a team role assignment","description":"Partially update a license-scoped role assignment (role, status, department\nand/or extra capabilities). The license scope itself is immutable.","operationId":"update_team_permission_admin_team__license_id__permissions__permission_id__patch","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"permission_id","in":"path","required":true,"schema":{"type":"integer","description":"Permission ID","title":"Permission Id"},"description":"Permission ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateTeamPermissionRequest"}}}},"responses":{"200":{"description":"Role assignment updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPermissionAssignmentResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignment, missing capability, or granting capabilities beyond the caller's own"},"422":{"description":"Invalid assignment (restricted role/department/capability rules)"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Assignment not found within this license"},"409":{"description":"The user already has this role at this scope"}}},"delete":{"tags":["admin"],"summary":"Delete a team role assignment","description":"Delete a single license-scoped role assignment.","operationId":"delete_team_permission_admin_team__license_id__permissions__permission_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"permission_id","in":"path","required":true,"schema":{"type":"integer","description":"Permission ID","title":"Permission Id"},"description":"Permission ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Role assignment deleted"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignment or missing capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Assignment not found within this license"}}}},"/admin/team/{license_id}/members/{user_id}":{"delete":{"tags":["admin"],"summary":"Remove a member from the license's team","description":"Delete every role assignment of a user scoped to this license. Any\nassignments the user holds elsewhere are left untouched.","operationId":"delete_team_member_admin_team__license_id__members__user_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"Firebase UID of the team member","title":"User Id"},"description":"Firebase UID of the team member"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"All license-scoped role assignments deleted"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - own assignments or missing capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"No role assignments found within this license"}}}},"/admin/transactions-nsbc":{"get":{"tags":["admin"],"summary":"List NSBC transactions","description":"List NS Business Card transactions filtered by the admin's accessible licenses.\n\nSupports filtering by license(s), user, objective(s), processing state, date\nrange (transaction date), title/station search, and amount and distance ranges,\nand sorting on the fields of `TransactionNSBCSortField`.\n\n**Required Capability**: view_expenses","operationId":"list_transactions_nsbc_admin_transactions_nsbc_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TransactionNSBCSortField","description":"Field to sort on (default: date)","default":"date"},"description":"Field to sort on (default: date)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates and amounts, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates and amounts, asc for text"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"user_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by user email (partial, case-insensitive)","title":"User Email"},"description":"Search by user email (partial, case-insensitive)"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user ID (exact match)","title":"User Id"},"description":"Filter by user ID (exact match)"},{"name":"objective","in":"query","required":false,"schema":{"type":"array","items":{"enum":["business","commute","personal"],"type":"string"},"description":"Filter by objective (repeatable: ?objective=business&objective=commute)","default":[],"title":"Objective"},"description":"Filter by objective (repeatable: ?objective=business&objective=commute)"},{"name":"has_expense","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet","title":"Has Expense"},"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter transactions on or after this date","title":"Start Date"},"description":"Filter transactions on or after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter transactions on or before this date","title":"End Date"},"description":"Filter transactions on or before this date"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by title or check-in/check-out station (partial, case-insensitive)","title":"Search"},"description":"Search by title or check-in/check-out station (partial, case-insensitive)"},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only transactions with an amount of at least this value","title":"Min Amount"},"description":"Only transactions with an amount of at least this value"},{"name":"max_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only transactions with an amount of at most this value","title":"Max Amount"},"description":"Only transactions with an amount of at most this value"},{"name":"min_distance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Only transactions of at least this many metres","title":"Min Distance"},"description":"Only transactions of at least this many metres"},{"name":"max_distance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Only transactions of at most this many metres","title":"Max Distance"},"description":"Only transactions of at most this many metres"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTransactionNSBCListResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/transactions-nsbc/export":{"get":{"tags":["admin"],"summary":"Export NSBC transactions as CSV","description":"Download the NSBC transactions matching the list filters and sort as a CSV\nfile, with a header row, the requested columns in the requested order and the\nheaders in the language of the request. Not paginated: every match is exported.\n\n**Required Capability**: view_expenses","operationId":"export_transactions_nsbc_admin_transactions_nsbc_export_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"columns","in":"query","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionNSBCExportColumn"},"minItems":1,"description":"Columns to export, in order (repeatable: ?columns=date&columns=amount)","title":"Columns"},"description":"Columns to export, in order (repeatable: ?columns=date&columns=amount)"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TransactionNSBCSortField","description":"Field to sort on (default: date)","default":"date"},"description":"Field to sort on (default: date)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc for dates and amounts, asc for text","title":"Order"},"description":"Sort direction; defaults to desc for dates and amounts, asc for text"},{"name":"license_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)","default":[],"title":"License Ids"},"description":"Filter by license IDs (repeatable: ?license_ids=1&license_ids=2)"},{"name":"user_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by user email (partial, case-insensitive)","title":"User Email"},"description":"Search by user email (partial, case-insensitive)"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user ID (exact match)","title":"User Id"},"description":"Filter by user ID (exact match)"},{"name":"objective","in":"query","required":false,"schema":{"type":"array","items":{"enum":["business","commute","personal"],"type":"string"},"description":"Filter by objective (repeatable: ?objective=business&objective=commute)","default":[],"title":"Objective"},"description":"Filter by objective (repeatable: ?objective=business&objective=commute)"},{"name":"has_expense","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet","title":"Has Expense"},"description":"Filter by processing state: true = linked to an expense, false = not processed into an expense yet"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter transactions on or after this date","title":"Start Date"},"description":"Filter transactions on or after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter transactions on or before this date","title":"End Date"},"description":"Filter transactions on or before this date"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by title or check-in/check-out station (partial, case-insensitive)","title":"Search"},"description":"Search by title or check-in/check-out station (partial, case-insensitive)"},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only transactions with an amount of at least this value","title":"Min Amount"},"description":"Only transactions with an amount of at least this value"},{"name":"max_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"description":"Only transactions with an amount of at most this value","title":"Max Amount"},"description":"Only transactions with an amount of at most this value"},{"name":"min_distance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Only transactions of at least this many metres","title":"Min Distance"},"description":"Only transactions of at least this many metres"},{"name":"max_distance","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Only transactions of at most this many metres","title":"Max Distance"},"description":"Only transactions of at most this many metres"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/users/{user_id}/trips":{"get":{"tags":["admin"],"summary":"List a user's trips","description":"List the trips of a single user, by default ordered by trip start time (newest\nfirst).\n\nAccess is restricted to users within the admin's scope — the same\nboundary as `GET /admin/users/{user_id}`. Supports multiselect filtering by\nobjective and modality, plus a range on the trip's local start date, and sorting\non the fields of `TripSortField`.\n\n**Required Capability**: view_users (tenant-level or global permission)","operationId":"list_user_trips_admin_users__user_id__trips_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"objective","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/TripObjective"},"description":"Filter by TripObjective (repeatable): 1=business, 2=commute, 3=personal","default":[],"title":"Objective"},"description":"Filter by TripObjective (repeatable): 1=business, 2=commute, 3=personal"},{"name":"modality","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer"},"description":"Filter by modality IDs (repeatable: ?modality=2&modality=3)","default":[],"title":"Modality"},"description":"Filter by modality IDs (repeatable: ?modality=2&modality=3)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include trips starting on or after this local date","title":"Start Date"},"description":"Include trips starting on or after this local date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Include trips starting on or before this local date","title":"End Date"},"description":"Include trips starting on or before this local date"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TripSortField","description":"Field to sort on (default: start_time)","default":"start_time"},"description":"Field to sort on (default: start_time)"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SortOrder"},{"type":"null"}],"description":"Sort direction; defaults to desc, asc for objective","title":"Order"},"description":"Sort direction; defaults to desc, asc for objective"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page (max 100)","default":50,"title":"Page Size"},"description":"Items per page (max 100)"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTripListResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - user lacks required capability"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"User not found or outside the admin's scope"}}}},"/admin/licenses/{license_id}/wpm/reports":{"get":{"tags":["admin"],"summary":"List the WPM reports of a license","description":"Return the WPM report bundles of a license, generated or added by hand,\nnewest year first and then most recently changed.\n\n**Required Capability**: view_reports","operationId":"list_wpm_reports_admin_licenses__license_id__wpm_reports_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2100,"minimum":2000},{"type":"null"}],"description":"Only reports of this year","title":"Year"},"description":"Only reports of this year"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmReportCollectionResponse"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The reports bucket isn't configured"}}},"post":{"tags":["admin"],"summary":"Generate a WPM report of a license","description":"Start generating a WPM report bundle of the license for a year in\nfynch-runners. The report replaces an earlier one of the same type and year;\nthe bucket keeps the old version. Poll the job at the `Location` header.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"create_wpm_report_admin_licenses__license_id__wpm_reports_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateWpmReportRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmJobResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"Background jobs aren't configured"},"409":{"description":"A report of the year is already being generated"}}}},"/admin/licenses/{license_id}/wpm/reports/{year}/{file_name}":{"get":{"tags":["admin"],"summary":"Download a WPM report of a license","description":"Download one of the license's WPM report bundles.\n\n**Required Capability**: view_reports","operationId":"download_wpm_report_admin_licenses__license_id__wpm_reports__year___file_name__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"year","in":"path","required":true,"schema":{"type":"integer","maximum":2100,"minimum":2000,"title":"Year"}},{"name":"file_name","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"title":"File Name"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientError"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"description":"The reports bucket isn't configured"},"404":{"description":"Report not found"}}}},"/admin/licenses/{license_id}/wpm/report-defaults":{"get":{"tags":["admin"],"summary":"Get the default WPM report type of a year","description":"Return the report type that fits the license's WPM data of a year: a survey\nreport when WPM invites were planned for that year, otherwise a regular one.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"get_wpm_report_defaults_admin_licenses__license_id__wpm_report_defaults_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"year","in":"query","required":true,"schema":{"type":"integer","maximum":2100,"minimum":2000,"title":"Year"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmReportDefaultsResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/wpm/jobs/{workflow_id}":{"get":{"tags":["admin"],"summary":"Get the status of a WPM report job","description":"Poll a WPM report job. A failed job has an error_code the dashboard\ntranslates.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"get_wpm_report_job_admin_licenses__license_id__wpm_jobs__workflow_id__get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmJobStatusResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Job not found"}}}},"/admin/licenses/{license_id}/wpm/invites":{"get":{"tags":["admin"],"summary":"List the WPM survey invites of a license","description":"Return the license's WPM survey invites that weren't cancelled, newest first,\nwith the number of employees an invite is emailed to.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"list_wpm_invites_admin_licenses__license_id__wpm_invites_get","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmInviteCollectionResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}},"post":{"tags":["admin"],"summary":"Plan a WPM survey invite","description":"Plan a WPM survey invite. The runners email it on or after the send date to\nevery employee of the license flagged for WPM.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"create_wpm_invite_admin_licenses__license_id__wpm_invites_post","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmInviteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmInviteResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"}}}},"/admin/licenses/{license_id}/wpm/invites/{invite_id}":{"put":{"tags":["admin"],"summary":"Replace a pending WPM survey invite","description":"Replace the send date and period of an invite that wasn't sent yet.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"replace_wpm_invite_admin_licenses__license_id__wpm_invites__invite_id__put","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWpmInviteResponse"}}}},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Invite not found"},"409":{"description":"The invite was already sent"},"412":{"description":"The invite changed since If-Unmodified-Since"}}},"delete":{"tags":["admin"],"summary":"Cancel a pending WPM survey invite","description":"Cancel an invite that wasn't sent yet.\n\n**Required Capability**: manage_license_settings, held at *tenant* scope.","operationId":"delete_wpm_invite_admin_licenses__license_id__wpm_invites__invite_id__delete","security":[{"OpenIdConnect":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"integer","description":"License ID","title":"License Id"},"description":"License ID"},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}},{"name":"X-Platform","in":"header","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Platform"},{"type":"null"}],"title":"X-Platform"}},{"name":"X-App-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-App-Version"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Unauthorized - invalid or missing token"},"403":{"description":"Forbidden - requires tenant-level access to the license"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Unprocessable Content"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitedError"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Internal Server Error"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Bad Gateway"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}},"description":"Service Unavailable"},"404":{"description":"Invite not found"},"409":{"description":"The invite was already sent"}}}}},"components":{"schemas":{"AccountStatus":{"type":"integer","enum":[1,2,3,4,5],"title":"AccountStatus","description":"The status of a user account."},"ActionUrlRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"The user's email address"},"language":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Language"}},"type":"object","required":["email"],"title":"ActionUrlRequest","description":"Request parameters for Firebase email action link handlers."},"AddressRequestSchema":{"properties":{"place_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Id"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"place_name":{"type":"string","title":"Place Name"},"street_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Name"},"street_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Number"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"country":{"type":"string","maxLength":2,"minLength":2,"title":"Country"},"formatted":{"type":"string","title":"Formatted"},"location":{"$ref":"#/components/schemas/Coordinate"},"radius":{"type":"integer","title":"Radius"}},"additionalProperties":false,"type":"object","required":["place_name","country","formatted","location"],"title":"AddressRequestSchema","description":"Address resource request body."},"AddressResponseSchema":{"properties":{"place_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Id"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"place_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Name"},"street_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Name"},"street_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Number"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formatted"},"location":{"$ref":"#/components/schemas/Coordinate"},"radius":{"type":"integer","title":"Radius"},"id":{"type":"integer","title":"Id"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"}},"additionalProperties":false,"type":"object","required":["country","location","radius","id"],"title":"AddressResponseSchema","description":"Address resource response body."},"AddressType":{"type":"string","enum":["generic","home","station","office","busstop"],"title":"AddressType","description":"Types of addresses, primarily used for different type of commute locations."},"AdminAddressCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminAddressResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminAddressCollectionResponse","description":"Addresses returned for a set of requested IDs (access-filtered)."},"AdminAddressListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminAddressResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminAddressListResponse","description":"Paginated list of addresses."},"AdminAddressResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"place_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Id"},"place_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Name"},"street_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Name"},"street_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Number"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formatted"},"location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"radius":{"type":"integer","title":"Radius"},"status":{"$ref":"#/components/schemas/GenericStatus"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]}},"type":"object","required":["id","radius","status","created_on","updated_on"],"title":"AdminAddressResponse","description":"Address information for admin dashboard."},"AdminCapabilityCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminCapabilityResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminCapabilityCollectionResponse","description":"Capabilities available to the caller."},"AdminCapabilityResponse":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description"},"sensitive":{"type":"boolean","title":"Sensitive"},"requires":{"items":{"type":"string"},"type":"array","title":"Requires","default":[]}},"type":"object","required":["name","display_name","description","sensitive"],"title":"AdminCapabilityResponse","description":"An admin capability, granted through roles or as an extra capability."},"AdminCardNSBCListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminCardNSBCResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminCardNSBCListResponse","description":"Paginated list of NS Business Cards."},"AdminCardNSBCResponse":{"properties":{"card_id":{"type":"string","title":"Card Id"},"license_id":{"type":"integer","title":"License Id"},"holder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Holder Name"},"ns_subscription_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ns Subscription Type"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"linked":{"type":"boolean","title":"Linked"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"first_used_on":{"type":"string","format":"date","title":"First Used On"},"last_used_on":{"type":"string","format":"date","title":"Last Used On"},"transaction_count":{"type":"integer","title":"Transaction Count"},"unlinked_transaction_count":{"type":"integer","title":"Unlinked Transaction Count"},"total_amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Total Amount"},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]}},"type":"object","required":["card_id","license_id","linked","first_used_on","last_used_on","transaction_count","unlinked_transaction_count","total_amount"],"title":"AdminCardNSBCResponse","description":"NS Business Card of a license, as seen in its NSBC transactions.\n\nThe current state (holder, Pers.nummer, linked user) comes from the card's most\nrecent transaction."},"AdminChallengeRuleRowRequest":{"properties":{"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"type":"object","title":"AdminChallengeRuleRowRequest","description":"Variable fields for one challenge rule row."},"AdminCreateAddressRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"formatted":{"type":"string","title":"Formatted"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"place_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Id"},"place_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Name"},"street_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Name"},"street_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street Number"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"radius":{"type":"integer","title":"Radius","default":300}},"type":"object","required":["license_id","formatted"],"title":"AdminCreateAddressRequest","description":"Request body for creating a license-bound address."},"AdminCreateChallengeRulesRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"name":{"type":"string","title":"Name"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"rows":{"items":{"$ref":"#/components/schemas/AdminChallengeRuleRowRequest"},"type":"array","title":"Rows"},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"}},"type":"object","required":["license_id","name","valid_from","rows"],"title":"AdminCreateChallengeRulesRequest","description":"Create one or more ExpenseChallengeRule rows sharing the same base\nconfiguration."},"AdminCreateExpenseJobRequest":{"properties":{"year":{"type":"integer","maximum":9999.0,"minimum":2000.0,"title":"Year"},"month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Month"}},"type":"object","required":["year","month"],"title":"AdminCreateExpenseJobRequest","description":"Request to start an expense-generation job for a user's month."},"AdminCreateExpenseReportJobRequest":{"properties":{"year":{"type":"integer","maximum":9999.0,"minimum":2000.0,"title":"Year"},"month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Month"},"recipient":{"type":"string","enum":["admin","user","other"],"title":"Recipient"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"new_expenses_only":{"type":"boolean","title":"New Expenses Only","default":true}},"type":"object","required":["year","month","recipient"],"title":"AdminCreateExpenseReportJobRequest","description":"Request to start an expense-report send job for a user's month.\n\nExactly one recipient is targeted: the requesting admin (``\"admin\"``), the\nuser the report is about (``\"user\"``), or a custom address (``\"other\"`` +\n``email``)."},"AdminCreateImportProfileRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationScheduleSchema"},{"type":"null"}],"description":"When to import the files dropped into the profile's folder"}},"type":"object","required":["license_id","kind","name","config"],"title":"AdminCreateImportProfileRequest","description":"Request to create an import profile."},"AdminCreateIntegrationRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"provider":{"type":"string","title":"Provider","description":"Provider key: loket, nmbrs or personio; create csv ones as import profiles"}},"type":"object","required":["license_id","provider"],"title":"AdminCreateIntegrationRequest","description":"Request to connect a license to a provider."},"AdminCreateIntegrationResponse":{"properties":{"integration":{"$ref":"#/components/schemas/AdminIntegrationResponse"},"authorization":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationAuthorizationResponse"},{"type":"null"}],"description":"The login link of an oauth provider; a credentials provider is connected with PUT /integrations/{id}/credentials"}},"type":"object","required":["integration"],"title":"AdminCreateIntegrationResponse","description":"A new integration and the link to authorize it."},"AdminCreateLicenseFeatureRequest":{"properties":{"feature_name":{"type":"string","minLength":1,"title":"Feature Name"},"enabled":{"type":"boolean","title":"Enabled","default":true},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"additionalProperties":false,"type":"object","required":["feature_name"],"title":"AdminCreateLicenseFeatureRequest","description":"Assign a catalog feature to a license."},"AdminCreateLicenseRequest":{"properties":{"name":{"type":"string","title":"Name"},"currency_code":{"type":"string","title":"Currency Code"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains","default":[]},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"commute_distances_enabled":{"type":"boolean","title":"Commute Distances Enabled","default":false},"enforce_manifests":{"type":"boolean","title":"Enforce Manifests","default":true},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"expense_report":{"$ref":"#/components/schemas/ExpenseReportType","default":"none"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"oidc_provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oidc Provider Id"},"trip_sources":{"items":{"$ref":"#/components/schemas/TripSource"},"type":"array","title":"Trip Sources","default":[]}},"type":"object","required":["name","currency_code"],"title":"AdminCreateLicenseRequest","description":"Request body for creating a new license."},"AdminCreatePermissionRequest":{"properties":{"user_id":{"type":"string","title":"User Id"},"role_id":{"type":"integer","title":"Role Id"},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"extra_capabilities":{"items":{"$ref":"#/components/schemas/Capability"},"type":"array","title":"Extra Capabilities","default":[]}},"type":"object","required":["user_id","role_id"],"title":"AdminCreatePermissionRequest","description":"Request to grant a role to a user (tenant-level RBAC management)."},"AdminCreateTeamPermissionRequest":{"properties":{"user_id":{"type":"string","title":"User Id"},"role_id":{"type":"integer","title":"Role Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"extra_capabilities":{"items":{"$ref":"#/components/schemas/Capability"},"type":"array","title":"Extra Capabilities","default":[]}},"type":"object","required":["user_id","role_id"],"title":"AdminCreateTeamPermissionRequest","description":"Request to grant a role within a license (team management).\n\nThe license scope comes from the URL path; tenant-level scopes cannot be\ngranted through team management."},"AdminCreateTransactionNSBCRulesRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"priority":{"type":"integer","title":"Priority"},"name":{"type":"string","title":"Name"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"rows":{"items":{"$ref":"#/components/schemas/AdminNSBCRuleRowRequest"},"type":"array","title":"Rows"},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"compensated_percentage":{"type":"number","title":"Compensated Percentage","default":100.0},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"product_codes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Product Codes"},"travel_classes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Travel Classes"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"}},"type":"object","required":["license_id","priority","name","valid_from","rows"],"title":"AdminCreateTransactionNSBCRulesRequest","description":"Create one or more ExpenseTransactionNSBCRule rows sharing the same base\nconfiguration."},"AdminCreateTripRulesRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"name":{"type":"string","title":"Name"},"valid_from":{"type":"string","format":"date","title":"Valid From"},"rows":{"items":{"$ref":"#/components/schemas/AdminTripRuleRowRequest"},"type":"array","title":"Rows"},"status":{"$ref":"#/components/schemas/GenericStatus","default":1},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"modality_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Modality Ids"},"passenger":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passenger"},"min_passengers":{"type":"integer","title":"Min Passengers","default":1},"shared_modality":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared Modality"},"min_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Meters"},"max_trip_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Trip Distance Meters"},"max_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Distance Meters"},"min_distance_subtract_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Subtract Meters"},"compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation Per Km"},"taxable_compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Taxable Compensation Per Km"},"max_daily_expenses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Expenses"},"max_daily_compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Max Daily Compensation"},"max_daily_distance_km":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Distance Km"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"threshold_deduction_priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold Deduction Priority"}},"type":"object","required":["license_id","name","valid_from","rows"],"title":"AdminCreateTripRulesRequest","description":"Create one or more ExpenseTripRule rows sharing the same base configuration."},"AdminCreateWpmReportRequest":{"properties":{"year":{"type":"integer","minimum":2020.0,"title":"Year","description":"The year the report covers"},"report_type":{"$ref":"#/components/schemas/WpmReportType"}},"type":"object","required":["year","report_type"],"title":"AdminCreateWpmReportRequest","description":"Request to generate a WPM report bundle of a license for a year."},"AdminCsvColumnRefSchema":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index","description":"0-based position of the column"},"header":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Header","description":"The column's name; set by the API. A CSV integration finds the column by this name in later files"}},"type":"object","required":["index"],"title":"AdminCsvColumnRefSchema","description":"A column of a CSV file."},"AdminCsvColumnResponse":{"properties":{"index":{"type":"integer","title":"Index"},"header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header"},"samples":{"items":{"type":"string"},"type":"array","title":"Samples","default":[]}},"type":"object","required":["index"],"title":"AdminCsvColumnResponse","description":"A column of an uploaded CSV file, with its first values."},"AdminCsvDetectedResponse":{"properties":{"encoding":{"type":"string","title":"Encoding"},"delimiter":{"type":"string","title":"Delimiter"},"has_header":{"type":"boolean","title":"Has Header"},"column_count":{"type":"integer","title":"Column Count"},"record_count":{"type":"integer","title":"Record Count"}},"type":"object","required":["encoding","delimiter","has_header","column_count","record_count"],"title":"AdminCsvDetectedResponse","description":"How an uploaded CSV file looked."},"AdminCsvFieldMappingSchema":{"properties":{"field":{"type":"string","maxLength":64,"title":"Field","description":"Manifests: external_user_id, email, expires_on, commute_distance_km, wpm or attribute. Addresses: name, street_name, street_number, house_number_addition, postal_code, locality, country, full_address, latitude, longitude or radius"},"column":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvColumnRefSchema"},{"type":"null"}],"description":"The column to read; null for a fixed value"},"value":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Value","description":"A value for every row instead of a column, read as if it were each row's cell. Only for the manifest fields attribute, expires_on and wpm"},"attribute":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Attribute","description":"The key of an attribute field"},"value_type":{"type":"string","enum":["text","number","boolean","date"],"title":"Value Type","description":"How an attribute's values are read","default":"text"}},"type":"object","required":["field"],"title":"AdminCsvFieldMappingSchema","description":"Fills a field from a column of a CSV file, or with one fixed value."},"AdminCsvImportConfigSchema":{"properties":{"read":{"$ref":"#/components/schemas/AdminCsvReadOptionsSchema","default":{"has_header":true}},"fields":{"items":{"$ref":"#/components/schemas/AdminCsvFieldMappingSchema"},"type":"array","maxItems":100,"title":"Fields","default":[]},"date_order":{"type":"string","enum":["dmy","ymd","mdy"],"title":"Date Order","description":"Order of day, month and year in non-ISO dates","default":"dmy"},"default_country":{"type":"string","pattern":"^[A-Za-z]{2}$","title":"Default Country","description":"Country of address rows without one","default":"NL"},"default_radius":{"type":"integer","maximum":5000.0,"minimum":25.0,"title":"Default Radius","description":"Radius of new addresses in meters","default":300},"address_names":{"additionalProperties":{"type":"string"},"type":"object","title":"Address Names","description":"Addresses: names given in the wizard by row number, e.g. {\"2\": \"Hoofdkantoor\"}; they win over the name column","default":{}}},"type":"object","title":"AdminCsvImportConfigSchema","description":"How a CSV file is read and which columns map to which fields."},"AdminCsvImportLimitsResponse":{"properties":{"max_rows":{"type":"integer","title":"Max Rows","description":"Data rows, the header row not included"},"max_file_size":{"type":"integer","title":"Max File Size","description":"In bytes"}},"type":"object","required":["max_rows","max_file_size"],"title":"AdminCsvImportLimitsResponse","description":"The largest file an import of this kind accepts."},"AdminCsvMappingIssueResponse":{"properties":{"code":{"type":"string","title":"Code"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attribute"},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"fixed_value_invalid: value_type, the type it didn't parse as","default":{}}},"type":"object","required":["code"],"title":"AdminCsvMappingIssueResponse","description":"Why a mapping can't be used yet."},"AdminCsvReadOptionsSchema":{"properties":{"has_header":{"type":"boolean","title":"Has Header","description":"Whether the first row holds the column names","default":true},"delimiter":{"anyOf":[{"type":"string","enum":[",",";","\t","|"]},{"type":"null"}],"title":"Delimiter"},"encoding":{"anyOf":[{"type":"string","enum":["utf-8","utf-16","cp1252","latin-1"]},{"type":"null"}],"title":"Encoding"}},"type":"object","title":"AdminCsvReadOptionsSchema","description":"How a CSV file is read. Null means as detected on upload."},"AdminCsvRowErrorResponse":{"properties":{"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"column_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Column Index"},"column_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Name"},"code":{"type":"string","title":"Code","description":"A CsvRowErrorCode"},"params":{"additionalProperties":true,"type":"object","title":"Params","default":{}},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value","description":"The offending value, cut off at 100 characters"}},"type":"object","required":["code"],"title":"AdminCsvRowErrorResponse","description":"A problem with a value of a row, or with the whole row."},"AdminCsvRowFailureResponse":{"properties":{"row_number":{"type":"integer","title":"Row Number","description":"As a spreadsheet shows it; the header is 1"},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identifier"},"errors":{"items":{"$ref":"#/components/schemas/AdminCsvRowErrorResponse"},"type":"array","title":"Errors"}},"type":"object","required":["row_number","errors"],"title":"AdminCsvRowFailureResponse","description":"A row of a CSV file that can't be imported."},"AdminCsvSampleResponse":{"properties":{"detected":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvDetectedResponse"},{"type":"null"}]},"columns":{"items":{"$ref":"#/components/schemas/AdminCsvColumnResponse"},"type":"array","title":"Columns","description":"The file's columns; empty once the import has started"},"limits":{"$ref":"#/components/schemas/AdminCsvImportLimitsResponse"},"mapping_issues":{"items":{"$ref":"#/components/schemas/AdminCsvMappingIssueResponse"},"type":"array","title":"Mapping Issues","description":"What the mapping lacks before it can be validated","default":[]},"validation":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvValidationResponse"},{"type":"null"}],"description":"Set when the mapping is usable: what importing would do"},"sample_id":{"type":"string","title":"Sample Id"},"license_id":{"type":"integer","title":"License Id"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"file_name":{"type":"string","title":"File Name"},"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema","description":"A mapping to start from: the given profile's, if any"}},"type":"object","required":["columns","limits","sample_id","license_id","kind","file_name","config"],"title":"AdminCsvSampleResponse","description":"A sample file, uploaded to set up or change an import profile's mapping.\nIt is deleted after a day."},"AdminCsvSampleValidationRequest":{"properties":{"license_id":{"type":"integer","title":"License Id"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema"}},"type":"object","required":["license_id","kind","config"],"title":"AdminCsvSampleValidationRequest","description":"A mapping to check against a sample file."},"AdminCsvSampleValidationResponse":{"properties":{"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema","description":"The mapping as checked, with each column's header filled in"},"columns":{"items":{"$ref":"#/components/schemas/AdminCsvColumnResponse"},"type":"array","title":"Columns","description":"The sample's columns, as read with the mapping's options"},"mapping_issues":{"items":{"$ref":"#/components/schemas/AdminCsvMappingIssueResponse"},"type":"array","title":"Mapping Issues","default":[]},"validation":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvValidationResponse"},{"type":"null"}]}},"type":"object","required":["config","columns"],"title":"AdminCsvSampleValidationResponse","description":"What a mapping lacks, or what importing the sample with it would do."},"AdminCsvValidationResponse":{"properties":{"total_rows":{"type":"integer","title":"Total Rows"},"valid_rows":{"type":"integer","title":"Valid Rows"},"failed_rows":{"type":"integer","title":"Failed Rows"},"to_create":{"type":"integer","title":"To Create"},"to_update":{"type":"integer","title":"To Update"},"to_geocode":{"type":"integer","title":"To Geocode","description":"New addresses that need geocoding"},"failures":{"items":{"$ref":"#/components/schemas/AdminCsvRowFailureResponse"},"type":"array","title":"Failures","description":"The first 50 rows that can't be imported"},"preview":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Preview","description":"The first 10 mapped rows"}},"type":"object","required":["total_rows","valid_rows","failed_rows","to_create","to_update","to_geocode","failures","preview"],"title":"AdminCsvValidationResponse","description":"What importing a CSV file would do, without doing it."},"AdminDashboardCo2Response":{"properties":{"license_id":{"type":"integer","title":"License Id"},"month":{"type":"string","title":"Month","description":"The month the numbers cover (YYYY-MM)."},"department_scoped":{"type":"boolean","title":"Department Scoped","description":"Whether the numbers only cover the admin's departments and employees without a department."},"trips":{"type":"integer","title":"Trips"},"distance_km":{"type":"number","title":"Distance Km"},"co2_kg":{"type":"number","title":"Co2 Kg","description":"CO2 emissions per passenger."},"modality_groups":{"items":{"$ref":"#/components/schemas/AdminDashboardModalityGroupResponse"},"type":"array","title":"Modality Groups","description":"Sorted by distance, largest first."}},"type":"object","required":["license_id","month","department_scoped","trips","distance_km","co2_kg","modality_groups"],"title":"AdminDashboardCo2Response","description":"Business and commute trips of the month, per modality group."},"AdminDashboardKmResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"month":{"type":"string","title":"Month","description":"The month the numbers cover (YYYY-MM)."},"department_scoped":{"type":"boolean","title":"Department Scoped","description":"Whether the numbers only cover the admin's departments and employees without a department."},"business_km":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Business Km"},"commute_km":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Commute Km"},"other_km":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Other Km","description":"Kilometres without a business or commute objective."},"deducted_km":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Deducted Km","description":"Commute threshold deductions, zero or negative."},"total_km":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Total Km","description":"Kilometres travelled, without the deductions."},"employees":{"type":"integer","title":"Employees","description":"Employees with trip expenses."},"average_km_per_employee":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Average Km Per Employee"}},"type":"object","required":["license_id","month","department_scoped","business_km","commute_km","other_km","deducted_km","total_km","employees","average_km_per_employee"],"title":"AdminDashboardKmResponse","description":"Kilometres from completed trip expenses of the month, per objective."},"AdminDashboardModalityGroupResponse":{"properties":{"modality_group":{"$ref":"#/components/schemas/ModalityGroupName"},"trips":{"type":"integer","title":"Trips"},"distance_km":{"type":"number","title":"Distance Km"},"distance_share":{"type":"number","title":"Distance Share","description":"Share of the total distance, 0-1."},"co2_kg":{"type":"number","title":"Co2 Kg"}},"type":"object","required":["modality_group","trips","distance_km","distance_share","co2_kg"],"title":"AdminDashboardModalityGroupResponse","description":"Trip totals for one modality group."},"AdminDashboardNsbcResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"month":{"type":"string","title":"Month","description":"The month the numbers cover (YYYY-MM)."},"department_scoped":{"type":"boolean","title":"Department Scoped","description":"Whether the numbers only cover the admin's departments and employees without a department."},"total_amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Total Amount"},"transaction_count":{"type":"integer","title":"Transaction Count"},"unprocessed_count":{"type":"integer","title":"Unprocessed Count","description":"Transactions without an expense yet."},"unmatched_count":{"type":"integer","title":"Unmatched Count","description":"Transactions not linked to an employee."}},"type":"object","required":["license_id","month","department_scoped","total_amount","transaction_count","unprocessed_count","unmatched_count"],"title":"AdminDashboardNsbcResponse","description":"NS Business Card transactions of the month."},"AdminDashboardOverviewResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"default_month":{"type":"string","title":"Default Month","description":"Month the dashboard shows by default (YYYY-MM): last month."},"widgets":{"items":{"$ref":"#/components/schemas/DashboardWidget"},"type":"array","title":"Widgets","description":"Widgets to show, in display order."}},"type":"object","required":["license_id","default_month","widgets"],"title":"AdminDashboardOverviewResponse","description":"The dashboard widgets that apply to a license and the admin may see."},"AdminDashboardReimbursementsResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"month":{"type":"string","title":"Month","description":"The month the numbers cover (YYYY-MM)."},"department_scoped":{"type":"boolean","title":"Department Scoped","description":"Whether the numbers only cover the admin's departments and employees without a department."},"total_amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Total Amount"},"count":{"type":"integer","title":"Count"},"by_type":{"items":{"$ref":"#/components/schemas/AdminDashboardRuleTypeTotalResponse"},"type":"array","title":"By Type"}},"type":"object","required":["license_id","month","department_scoped","total_amount","count","by_type"],"title":"AdminDashboardReimbursementsResponse","description":"Completed expenses of the month, per expense rule type."},"AdminDashboardRuleTypeTotalResponse":{"properties":{"rule_type":{"$ref":"#/components/schemas/ExpenseRuleType"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["rule_type","amount","count"],"title":"AdminDashboardRuleTypeTotalResponse","description":"Completed expense totals for one expense rule type."},"AdminDashboardWfhResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"month":{"type":"string","title":"Month","description":"The month the numbers cover (YYYY-MM)."},"department_scoped":{"type":"boolean","title":"Department Scoped","description":"Whether the numbers only cover the admin's departments and employees without a department."},"wfh_days":{"type":"integer","title":"Wfh Days"},"office_days":{"type":"integer","title":"Office Days","description":"Days with at least one commute trip."},"employees":{"type":"integer","title":"Employees","description":"Employees with WFH or office days."}},"type":"object","required":["license_id","month","department_scoped","wfh_days","office_days","employees"],"title":"AdminDashboardWfhResponse","description":"Days worked from home and at the office in the month."},"AdminDayListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminDayResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminDayListResponse","description":"Paginated list of a user's days."},"AdminDayResponse":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"wfh":{"type":"boolean","title":"Wfh"},"state":{"$ref":"#/components/schemas/DayState"},"wpm":{"type":"boolean","title":"Wpm"},"job_status":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}]},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"expense_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["date","wfh","state","wpm","created_on","updated_on"],"title":"AdminDayResponse","description":"A single day for the admin dashboard.\n\nValidated straight from the Day ORM object (``from_attributes``) since no\nfields are renamed or transformed. ``state`` reflects completion:\n``\"completed\"`` means the day is done."},"AdminDepartmentCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminDepartmentResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminDepartmentCollectionResponse","description":"Departments of a license."},"AdminDepartmentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AdminDepartmentResponse","description":"Department information."},"AdminDistanceCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminDistanceResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminDistanceCollectionResponse","description":"All stored distances for a single address pair (both directions)."},"AdminDistanceListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminDistanceResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminDistanceListResponse","description":"Paginated distances touching a set of addresses."},"AdminDistanceResponse":{"properties":{"address1_id":{"type":"integer","title":"Address1 Id"},"address2_id":{"type":"integer","title":"Address2 Id"},"modality_id":{"$ref":"#/components/schemas/ModalityEnum"},"distance":{"type":"integer","title":"Distance"},"duration":{"type":"integer","title":"Duration"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["address1_id","address2_id","modality_id","distance","duration","created_on","updated_on"],"title":"AdminDistanceResponse","description":"A stored distance between two addresses for a given modality."},"AdminExpenseChallengeRuleResponse":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"type":"integer","title":"License Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","license_id","name","created_on","updated_on"],"title":"AdminExpenseChallengeRuleResponse","description":"Expense challenge rule information."},"AdminExpenseGroupListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminExpenseGroupResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminExpenseGroupListResponse","description":"Paginated list of expense groups."},"AdminExpenseGroupResponse":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"type":"string","title":"Code"},"challenge_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseChallengeRuleResponse"},"type":"array","title":"Challenge Rules","default":[]},"trip_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTripRuleResponse"},"type":"array","title":"Trip Rules","default":[]},"transaction_nsbc_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTransactionNSBCRuleResponse"},"type":"array","title":"Transaction Nsbc Rules","default":[]},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"}},"type":"object","required":["id","code","license"],"title":"AdminExpenseGroupResponse","description":"Expense group with challenge and trip rules."},"AdminExpenseGroupSummaryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"type":"object","required":["id"],"title":"AdminExpenseGroupSummaryResponse","description":"Brief expense group information embedded in subscription responses."},"AdminExpenseListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminExpenseResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminExpenseListResponse","description":"Paginated list of expenses."},"AdminExpenseResponse":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"status":{"$ref":"#/components/schemas/ExpenseStatus"},"expensed_on":{"type":"string","format":"date","title":"Expensed On"},"submitted_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted On"},"completed_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed On"},"number_of_units":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Number Of Units"},"amount_per_unit":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount Per Unit"},"amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"license_id":{"type":"integer","title":"License Id"},"user_id":{"type":"string","title":"User Id"},"expense_trip_rule_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Trip Rule Id"},"expense_challenge_rule_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Challenge Rule Id"},"expense_transaction_nsbc_rule_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Transaction Nsbc Rule Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]},"expense_trip_rule":{"anyOf":[{"$ref":"#/components/schemas/AdminExpenseRuleRefResponse"},{"type":"null"}]},"expense_challenge_rule":{"anyOf":[{"$ref":"#/components/schemas/AdminExpenseRuleRefResponse"},{"type":"null"}]},"expense_transaction_nsbc_rule":{"anyOf":[{"$ref":"#/components/schemas/AdminExpenseRuleRefResponse"},{"type":"null"}]}},"type":"object","required":["id","title","status","expensed_on","number_of_units","license_id","user_id","created_on","updated_on"],"title":"AdminExpenseResponse","description":"Expense entry for the admin expense list."},"AdminExpenseRuleRefResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AdminExpenseRuleRefResponse","description":"Lightweight expense rule reference — reused for trip, challenge, and NSBC\nrules."},"AdminExpenseRulesByLicenseResponse":{"properties":{"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"trip_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTripRuleResponse"},"type":"array","title":"Trip Rules","default":[]},"challenge_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseChallengeRuleResponse"},"type":"array","title":"Challenge Rules","default":[]},"transaction_nsbc_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTransactionNSBCRuleResponse"},"type":"array","title":"Transaction Nsbc Rules","default":[]}},"type":"object","required":["license"],"title":"AdminExpenseRulesByLicenseResponse","description":"Expense rules grouped by license and type."},"AdminExpenseTransactionNSBCRuleResponse":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"type":"integer","title":"License Id"},"priority":{"type":"integer","title":"Priority"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"product_codes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Product Codes"},"travel_classes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Travel Classes"},"compensated_percentage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Compensated Percentage"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","license_id","priority","name","created_on","updated_on"],"title":"AdminExpenseTransactionNSBCRuleResponse","description":"Expense transaction NSBC rule information."},"AdminExpenseTripRuleResponse":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"type":"integer","title":"License Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"modality_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Modality Ids"},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"passenger":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passenger"},"min_passengers":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Passengers"},"shared_modality":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared Modality"},"min_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Meters"},"max_trip_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Trip Distance Meters"},"max_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Distance Meters"},"min_distance_subtract_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Subtract Meters"},"compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation Per Km"},"taxable_compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Taxable Compensation Per Km"},"max_daily_expenses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Expenses"},"max_daily_compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Max Daily Compensation"},"max_daily_distance_km":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Distance Km"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"threshold_deduction_priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold Deduction Priority"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","license_id","name","created_on","updated_on"],"title":"AdminExpenseTripRuleResponse","description":"Expense trip rule information."},"AdminFeatureResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"AdminFeatureResponse","description":"A feature available in the system."},"AdminFirebaseProviderResponse":{"properties":{"provider_id":{"type":"string","title":"Provider Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid"}},"type":"object","required":["provider_id"],"title":"AdminFirebaseProviderResponse","description":"A single sign-in provider linked to a Firebase account."},"AdminImportProfileListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminImportProfileResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminImportProfileListResponse","description":"Paginated list of import profiles."},"AdminImportProfileResponse":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"type":"integer","title":"License Id"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"status":{"$ref":"#/components/schemas/GenericStatus"},"health":{"type":"string","title":"Health","description":"Summary of the profile's state"},"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema"},"folder":{"type":"string","title":"Folder","description":"The bucket folder whose files the profile's runs import"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationScheduleSchema"},{"type":"null"}]},"last_run":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationRunSummaryResponse"},{"type":"null"}]},"next_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run At"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","license_id","license","name","kind","status","health","config","folder","created_on","updated_on"],"title":"AdminImportProfileResponse","description":"An import profile: how a kind of CSV file is read and mapped, and when the\nfiles dropped into its folder are imported. An integration of type\ncsv-attributes or csv-addresses."},"AdminImportRunDetailResponse":{"properties":{"detected":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvDetectedResponse"},{"type":"null"}]},"columns":{"items":{"$ref":"#/components/schemas/AdminCsvColumnResponse"},"type":"array","title":"Columns","description":"The file's columns; empty once the import has started"},"limits":{"$ref":"#/components/schemas/AdminCsvImportLimitsResponse"},"mapping_issues":{"items":{"$ref":"#/components/schemas/AdminCsvMappingIssueResponse"},"type":"array","title":"Mapping Issues","description":"What the mapping lacks before it can be validated","default":[]},"validation":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvValidationResponse"},{"type":"null"}],"description":"Set when the mapping is usable: what importing would do"},"id":{"type":"integer","title":"Id","description":"The integration task of the file"},"license_id":{"type":"integer","title":"License Id"},"integration_id":{"type":"integer","title":"Integration Id","description":"The import profile"},"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"trigger":{"type":"string","enum":["upload","folder"],"title":"Trigger","description":"Uploaded by an admin, or picked up from the profile's folder"},"status":{"$ref":"#/components/schemas/JobStatus","description":"draft until started; processing, completed, failed or cancelled after"},"file_name":{"type":"string","title":"File Name"},"parent_task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Task Id","description":"The run that picked up a folder file"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"},"processed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Count","description":"Rows read"},"created_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Count"},"updated_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated Count"},"failed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Count"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"A CsvImportErrorCode when the whole file failed"},"purged":{"type":"boolean","title":"Purged","description":"Whether the file and its failed rows were deleted after the retention period"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"started_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started On"},"finished_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished On"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"config":{"$ref":"#/components/schemas/AdminCsvImportConfigSchema","description":"How this file is read and mapped"}},"type":"object","required":["columns","limits","id","license_id","integration_id","kind","trigger","status","file_name","purged","created_on","license","config"],"title":"AdminImportRunDetailResponse","description":"An imported CSV file with what the dashboard's import wizard needs."},"AdminImportRunListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminImportRunResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminImportRunListResponse","description":"Paginated list of imported CSV files."},"AdminImportRunResponse":{"properties":{"id":{"type":"integer","title":"Id","description":"The integration task of the file"},"license_id":{"type":"integer","title":"License Id"},"integration_id":{"type":"integer","title":"Integration Id","description":"The import profile"},"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"kind":{"type":"string","enum":["addresses","manifests"],"title":"Kind"},"trigger":{"type":"string","enum":["upload","folder"],"title":"Trigger","description":"Uploaded by an admin, or picked up from the profile's folder"},"status":{"$ref":"#/components/schemas/JobStatus","description":"draft until started; processing, completed, failed or cancelled after"},"file_name":{"type":"string","title":"File Name"},"parent_task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Task Id","description":"The run that picked up a folder file"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"},"processed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Count","description":"Rows read"},"created_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Count"},"updated_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated Count"},"failed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Count"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"A CsvImportErrorCode when the whole file failed"},"purged":{"type":"boolean","title":"Purged","description":"Whether the file and its failed rows were deleted after the retention period"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"started_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started On"},"finished_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished On"}},"type":"object","required":["id","license_id","integration_id","kind","trigger","status","file_name","purged","created_on"],"title":"AdminImportRunResponse","description":"A CSV file imported with an import profile: uploaded by an admin, or\npicked up from the profile's folder by a scheduled or manual run."},"AdminIntegrationActiveRunResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"type":"string","enum":["queued","running"],"title":"Status","description":"queued while it waits for earlier imports to finish"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["workflow_id","status","created_at"],"title":"AdminIntegrationActiveRunResponse","description":"A run started from the dashboard that hasn't finished yet."},"AdminIntegrationAttributeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationAttributeSchema"},"type":"array","title":"Items"},"fields":{"items":{"$ref":"#/components/schemas/AdminPersonioFieldResponse"},"type":"array","title":"Fields"}},"type":"object","required":["items","fields"],"title":"AdminIntegrationAttributeListResponse","description":"The provider's fields to map, and the manifest fields to map them onto."},"AdminIntegrationAttributeSchema":{"properties":{"id":{"type":"string","title":"Id","description":"The source id to map, e.g. person.first_name"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Its name in the provider, if known"},"group":{"type":"string","enum":["standard","custom"],"title":"Group","description":"standard: the provider's own field; custom: the customer's"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"sample_value":{"title":"Sample Value","description":"The value of one of the employees"},"suggested_field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Field","description":"What its label suggests it holds: a field, or a name for an attribute"}},"type":"object","required":["id","group"],"title":"AdminIntegrationAttributeSchema","description":"A field of the provider an admin can map onto a manifest field."},"AdminIntegrationAuthorizationResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url","description":"Open this in a new browser tab"},"token_id":{"type":"integer","title":"Token Id","description":"The integration is authorized once its token has this id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["authorization_url","token_id","expires_at"],"title":"AdminIntegrationAuthorizationResponse","description":"A link for the admin to authorize Fynch at the provider."},"AdminIntegrationAuthorizationStatusResponse":{"properties":{"token_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Id"},"authorized":{"type":"boolean","title":"Authorized","description":"Whether the connection is authorized and usable"},"valid_to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid To","description":"When the authorization expires if unused"}},"type":"object","required":["authorized"],"title":"AdminIntegrationAuthorizationStatusResponse","description":"The state of an integration's connection with its provider."},"AdminIntegrationCompanyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationCompanySchema"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminIntegrationCompanyListResponse","description":"The employers (Loket) or companies (Nmbrs) an integration can import."},"AdminIntegrationCompanySchema":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"number":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Number"}},"type":"object","required":["id"],"title":"AdminIntegrationCompanySchema","description":"The employer (Loket) or company (Nmbrs) an integration imports."},"AdminIntegrationCredentialsRequest":{"properties":{"client_id":{"type":"string","maxLength":255,"minLength":1,"title":"Client Id"},"client_secret":{"type":"string","maxLength":255,"minLength":1,"format":"password","title":"Client Secret","writeOnly":true}},"type":"object","required":["client_id","client_secret"],"title":"AdminIntegrationCredentialsRequest","description":"The customer's own API credentials for a provider (Personio)."},"AdminIntegrationJobResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"}},"type":"object","required":["workflow_id"],"title":"AdminIntegrationJobResponse","description":"A job started for an integration."},"AdminIntegrationJobResultResponse":{"properties":{"rows":{"anyOf":[{"items":{"$ref":"#/components/schemas/AdminIntegrationPreviewRowResponse"},"type":"array"},{"type":"null"}],"title":"Rows"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"processed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Count"}},"type":"object","title":"AdminIntegrationJobResultResponse","description":"The result of an integration job, depending on its kind."},"AdminIntegrationJobStatusResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"result":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationJobResultResponse"},{"type":"null"}]}},"type":"object","required":["workflow_id","status"],"title":"AdminIntegrationJobStatusResponse","description":"The state of an integration job."},"AdminIntegrationListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminIntegrationListResponse","description":"Paginated list of integrations."},"AdminIntegrationPreviewRowResponse":{"properties":{"external_user_id":{"type":"string","title":"External User Id"},"email":{"type":"string","title":"Email"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"details":{"additionalProperties":true,"type":"object","title":"Details","default":{}}},"type":"object","required":["external_user_id","email"],"title":"AdminIntegrationPreviewRowResponse","description":"A record the integration would import."},"AdminIntegrationProviderListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationProviderResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminIntegrationProviderListResponse","description":"The providers an admin can connect."},"AdminIntegrationProviderResponse":{"properties":{"key":{"type":"string","title":"Key","description":"Provider key: loket, nmbrs, personio or csv"},"direction":{"type":"string","enum":["in","out"],"title":"Direction","description":"Whether the integration brings data in or sends it out"},"configured":{"type":"boolean","title":"Configured","description":"Whether Fynch has set up the provider in this environment"},"requires_authorization":{"type":"boolean","title":"Requires Authorization","description":"Whether the provider has a connection to authorize"},"authorization":{"type":"string","enum":["oauth","credentials","none"],"title":"Authorization","description":"How an admin connects it: oauth logs in at the provider, credentials enters the customer's API credentials"},"company_selection":{"type":"boolean","title":"Company Selection","description":"Whether the admin chooses the employer or company to import"},"attribute_mapping":{"type":"boolean","title":"Attribute Mapping","description":"Whether the admin maps the provider's custom attributes"},"allowed_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Types","description":"With license_id: the provider's integration types the license may create"}},"type":"object","required":["key","direction","configured","requires_authorization","authorization","company_selection","attribute_mapping"],"title":"AdminIntegrationProviderResponse","description":"A provider an admin can connect from the dashboard."},"AdminIntegrationResponse":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"type":"integer","title":"License Id"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"integration_type":{"$ref":"#/components/schemas/AdminIntegrationTypeResponse"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider","description":"loket, nmbrs, personio or csv; null for integrations only Fynch manages"},"requires_authorization":{"type":"boolean","title":"Requires Authorization","description":"False for an import profile, which has no token","default":true},"status":{"$ref":"#/components/schemas/GenericStatus"},"health":{"type":"string","title":"Health","description":"Summary of the integration's state"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"The name of an import profile"},"csv_kind":{"anyOf":[{"type":"string","enum":["addresses","manifests"]},{"type":"null"}],"title":"Csv Kind","description":"What an import profile imports; manage it under import-profiles"},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder","description":"The bucket folder an import profile imports the files from"},"company":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationCompanySchema"},{"type":"null"}]},"field_mapping":{"anyOf":[{"items":{"$ref":"#/components/schemas/AdminPersonioFieldMappingSchema"},"type":"array"},{"type":"null"}],"title":"Field Mapping","description":"How a provider whose fields the admin maps (Personio) fills the manifest; null for other providers"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationScheduleSchema"},{"type":"null"}]},"schedule_cron":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Cron","description":"The raw crontab; set without schedule for a custom schedule"},"authorization":{"$ref":"#/components/schemas/AdminIntegrationAuthorizationStatusResponse"},"last_run":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationRunSummaryResponse"},{"type":"null"}]},"active_run":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationActiveRunResponse"},{"type":"null"}],"description":"A run started from the dashboard that is queued or running"},"next_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run At"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","license_id","license","integration_type","provider","status","health","authorization","created_on","updated_on"],"title":"AdminIntegrationResponse","description":"An integration as shown in the admin dashboard."},"AdminIntegrationRunIntegrationResponse":{"properties":{"id":{"type":"integer","title":"Id"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"An import profile's name"},"integration_type":{"$ref":"#/components/schemas/AdminIntegrationTypeResponse"},"company":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationCompanySchema"},{"type":"null"}]}},"type":"object","required":["id","integration_type"],"title":"AdminIntegrationRunIntegrationResponse","description":"The integration a run belongs to."},"AdminIntegrationRunListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationRunResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminIntegrationRunListResponse","description":"Paginated integration run log."},"AdminIntegrationRunResponse":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"trigger":{"type":"string","title":"Trigger"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"started_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started On"},"finished_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished On"},"processed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Count"},"created_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Count"},"updated_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated Count"},"failed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Count","description":"Records that failed; list them under the run's failures"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"integration_id":{"type":"integer","title":"Integration Id"},"license_id":{"type":"integer","title":"License Id"},"integration":{"$ref":"#/components/schemas/AdminIntegrationRunIntegrationResponse"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"The file an admin uploaded to an import profile"},"purged":{"type":"boolean","title":"Purged","description":"Whether its file and failures were deleted after the retention period","default":false},"files":{"items":{"$ref":"#/components/schemas/AdminImportRunResponse"},"type":"array","title":"Files","description":"The files an import profile's folder run imported","default":[]}},"type":"object","required":["id","status","trigger","scheduled_at","integration_id","license_id","integration"],"title":"AdminIntegrationRunResponse","description":"A run in the integration run log."},"AdminIntegrationRunSummaryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"trigger":{"type":"string","title":"Trigger"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"started_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started On"},"finished_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished On"},"processed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processed Count"},"created_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Count"},"updated_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated Count"},"failed_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Count","description":"Records that failed; list them under the run's failures"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"}},"type":"object","required":["id","status","trigger","scheduled_at"],"title":"AdminIntegrationRunSummaryResponse","description":"A single run of an integration."},"AdminIntegrationScheduleSchema":{"properties":{"hours":{"items":{"type":"integer","maximum":23.0,"minimum":0.0},"type":"array","maxItems":3,"minItems":1,"title":"Hours","description":"Hours of the day (Europe/Amsterdam), at most 3"},"weekdays":{"items":{"type":"integer","maximum":7.0,"minimum":1.0},"type":"array","maxItems":7,"minItems":1,"title":"Weekdays","description":"ISO weekdays, 1 is Monday"}},"type":"object","required":["hours","weekdays"],"title":"AdminIntegrationScheduleSchema","description":"When an integration runs: at whole hours on ISO weekdays."},"AdminIntegrationTaskFailureErrorResponse":{"properties":{"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"column_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Column Index"},"column_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Name"},"code":{"type":"string","title":"Code","description":"A CsvRowErrorCode for a CSV row, a provider's code otherwise"},"params":{"additionalProperties":true,"type":"object","title":"Params","default":{}},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value","description":"The offending value, cut off at 100 characters"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"A provider's own explanation, not translated"}},"type":"object","required":["code"],"title":"AdminIntegrationTaskFailureErrorResponse","description":"A problem with a failed record."},"AdminIntegrationTaskFailureListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminIntegrationTaskFailureResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminIntegrationTaskFailureListResponse","description":"Paginated list of the failed records of an integration run."},"AdminIntegrationTaskFailureResponse":{"properties":{"id":{"type":"integer","title":"Id"},"row_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Number","description":"As a spreadsheet shows it, the header being 1; null for an API record"},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identifier"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Where an API record came from"},"errors":{"items":{"$ref":"#/components/schemas/AdminIntegrationTaskFailureErrorResponse"},"type":"array","title":"Errors"}},"type":"object","required":["id","errors"],"title":"AdminIntegrationTaskFailureResponse","description":"A record of an integration run that failed: a CSV row or an API record."},"AdminIntegrationTypeResponse":{"properties":{"id":{"type":"integer","title":"Id"},"key":{"type":"string","title":"Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","key"],"title":"AdminIntegrationTypeResponse","description":"Integration type (scheduled job) information."},"AdminJobResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"$ref":"#/components/schemas/JobStatus"}},"type":"object","required":["workflow_id","status"],"title":"AdminJobResponse","description":"Response for a newly enqueued background job (202 Accepted)."},"AdminJobStatusResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["workflow_id","status"],"title":"AdminJobStatusResponse","description":"Response for a background job status query."},"AdminLicenseBundleFeatureResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","required":["enabled"],"title":"AdminLicenseBundleFeatureResponse","description":"The license's bundle feature."},"AdminLicenseBundleResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"expense_report":{"anyOf":[{"$ref":"#/components/schemas/ExpenseReportType"},{"type":"null"}]},"bundle_features":{"items":{"type":"string"},"type":"array","title":"Bundle Features","description":"Premium features included in the bundle spreadsheet"},"feature":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseBundleFeatureResponse"},{"type":"null"}]}},"type":"object","required":["license_id","bundle_features"],"title":"AdminLicenseBundleResponse","description":"The layout of a license's expense bundle."},"AdminLicenseDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"tenant_id":{"type":"integer","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"},"trip_sources":{"items":{"type":"string"},"type":"array","title":"Trip Sources"},"communication_flags":{"items":{"type":"string"},"type":"array","title":"Communication Flags"},"feature_flags":{"items":{"type":"string"},"type":"array","title":"Feature Flags"},"bundle_features":{"items":{"type":"string"},"type":"array","title":"Bundle Features"},"status":{"$ref":"#/components/schemas/GenericStatus"},"commute_distances_enabled":{"type":"boolean","title":"Commute Distances Enabled"},"expense_report":{"type":"string","title":"Expense Report"},"user_expiry_days":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"User Expiry Days"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"enforce_manifests":{"type":"boolean","title":"Enforce Manifests"},"oidc_provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oidc Provider Id"},"group_code_func":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Code Func"},"department_code_func":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Code Func"},"nsbc_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nsbc Name"},"currency_code":{"type":"string","title":"Currency Code"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"tenant":{"$ref":"#/components/schemas/AdminTenantResponse"}},"type":"object","required":["id","tenant_id","name","domains","trip_sources","communication_flags","feature_flags","bundle_features","status","commute_distances_enabled","expense_report","enforce_manifests","currency_code","created_on","updated_on","tenant"],"title":"AdminLicenseDetailResponse","description":"Detailed license information for admin dashboard."},"AdminLicenseFeatureResponse":{"properties":{"feature_name":{"type":"string","title":"Feature Name"},"license_id":{"type":"integer","title":"License Id"},"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"feature":{"$ref":"#/components/schemas/AdminFeatureResponse"}},"type":"object","required":["feature_name","license_id","enabled","created_on","updated_on","feature"],"title":"AdminLicenseFeatureResponse","description":"A feature assigned to a license, including its enabled state and config."},"AdminLicenseModulesResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"modules":{"items":{"$ref":"#/components/schemas/LicenseModule"},"type":"array","title":"Modules","description":"Modules the license uses, in sidebar order."}},"type":"object","required":["license_id","modules"],"title":"AdminLicenseModulesResponse","description":"The platform modules a license uses."},"AdminLicenseResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"tenant_id":{"type":"integer","title":"Tenant Id"}},"type":"object","required":["id","name","tenant_id"],"title":"AdminLicenseResponse","description":"License information."},"AdminManifestBulkDeleteRequest":{"properties":{"selection":{"$ref":"#/components/schemas/AdminManifestSelectionSchema"},"confirm_count":{"type":"integer","minimum":1.0,"title":"Confirm Count"}},"additionalProperties":false,"type":"object","required":["selection","confirm_count"],"title":"AdminManifestBulkDeleteRequest","description":"Delete many manifests. The number confirmed must equal the number the\nselection holds when the request arrives."},"AdminManifestBulkDeleteResponse":{"properties":{"manifests":{"type":"integer","title":"Manifests"},"subscriptions_unlinked":{"type":"integer","title":"Subscriptions Unlinked"}},"type":"object","required":["manifests","subscriptions_unlinked"],"title":"AdminManifestBulkDeleteResponse","description":"How many manifests a bulk delete removed and subscriptions it unlinked."},"AdminManifestBulkUpdateRequest":{"properties":{"selection":{"$ref":"#/components/schemas/AdminManifestSelectionSchema"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"wpm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wpm"}},"additionalProperties":false,"type":"object","required":["selection"],"title":"AdminManifestBulkUpdateRequest","description":"Set the expiry date and/or WPM flag of many manifests and their linked\nsubscriptions. Leave a field out to keep it; send ``expires_on: null`` to\nclear the expiry date."},"AdminManifestBulkUpdateResponse":{"properties":{"manifests":{"type":"integer","title":"Manifests"},"subscriptions":{"type":"integer","title":"Subscriptions"}},"type":"object","required":["manifests","subscriptions"],"title":"AdminManifestBulkUpdateResponse","description":"How many manifests and linked subscriptions a bulk update changed."},"AdminManifestSelectionSchema":{"properties":{"external_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1},{"type":"null"}],"title":"External User Ids"},"all_matching":{"type":"boolean","title":"All Matching","default":false},"search":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search","description":"The search of the list, with all_matching"},"wpm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wpm"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"claimed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Claimed"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"expense_group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Group Id"}},"additionalProperties":false,"type":"object","title":"AdminManifestSelectionSchema","description":"The manifests of a license a bulk action applies to: the given external user\nids, or all manifests matching the search of the manifests page."},"AdminNSBCRuleRowRequest":{"properties":{"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"type":"object","title":"AdminNSBCRuleRowRequest","description":"Variable fields for one transaction NSBC rule row."},"AdminPermissionAssignmentResponse":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"status":{"$ref":"#/components/schemas/GenericStatus"},"role":{"$ref":"#/components/schemas/AdminRoleResponse"},"tenant":{"anyOf":[{"$ref":"#/components/schemas/AdminTenantResponse"},{"type":"null"}]},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]},"department":{"anyOf":[{"$ref":"#/components/schemas/AdminDepartmentResponse"},{"type":"null"}]},"extra_capabilities":{"items":{"type":"string"},"type":"array","title":"Extra Capabilities","default":[]},"created_by":{"type":"string","title":"Created By"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","user_id","email","status","role","created_by","created_on","updated_on"],"title":"AdminPermissionAssignmentResponse","description":"A single role assignment (permission row) of an admin user."},"AdminPersonioFieldMappingSchema":{"properties":{"field":{"type":"string","maxLength":64,"title":"Field","description":"external_user_id, email, expires_on, commute_distance_km, wpm, street_address, house_number, postal_code, locality, country or attribute"},"source":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Source","description":"The Personio field to read (an attribute id); null for a value"},"value":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Value","description":"A value for every employee instead of a source. Only for expires_on, commute_distance_km, wpm, country and attribute"},"attribute":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Attribute","description":"The key of an attribute field"},"value_type":{"type":"string","enum":["text","number","boolean","date"],"title":"Value Type","description":"How an attribute's values are read","default":"text"}},"type":"object","required":["field"],"title":"AdminPersonioFieldMappingSchema","description":"Fills a manifest field from a Personio field, or with one fixed value."},"AdminPersonioFieldResponse":{"properties":{"field":{"type":"string","title":"Field"},"fixed_allowed":{"type":"boolean","title":"Fixed Allowed","description":"Whether it can take a fixed value"},"value_type":{"anyOf":[{"type":"string","enum":["text","number","boolean","date"]},{"type":"null"}],"title":"Value Type","description":"How its values are read; null for attribute, which says itself"}},"type":"object","required":["field","fixed_allowed"],"title":"AdminPersonioFieldResponse","description":"A manifest field a Personio integration can fill."},"AdminRbacScopesResponse":{"properties":{"tenants":{"items":{"$ref":"#/components/schemas/AdminTenantResponse"},"type":"array","title":"Tenants"},"licenses":{"items":{"$ref":"#/components/schemas/AdminLicenseResponse"},"type":"array","title":"Licenses"}},"type":"object","required":["tenants","licenses"],"title":"AdminRbacScopesResponse","description":"Tenants and licenses available as assignment scopes for the caller."},"AdminRbacUserListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminRbacUserResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminRbacUserListResponse","description":"Paginated list of admin users."},"AdminRbacUserResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"assignments":{"items":{"$ref":"#/components/schemas/AdminPermissionAssignmentResponse"},"type":"array","title":"Assignments"}},"type":"object","required":["user_id","email","assignments"],"title":"AdminRbacUserResponse","description":"An admin user (grouped by user_id and email) with all assignments."},"AdminReceiptCategoryCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminReceiptCategoryListItemResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminReceiptCategoryCollectionResponse","description":"Receipt categories of the requested licenses."},"AdminReceiptCategoryListItemResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","name","is_active"],"title":"AdminReceiptCategoryListItemResponse","description":"Receipt category offered as a receipt filter option."},"AdminReceiptCategoryResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AdminReceiptCategoryResponse","description":"Receipt category information."},"AdminReceiptListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminReceiptResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminReceiptListResponse","description":"Paginated list of receipts."},"AdminReceiptResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","title":"User Id"},"license_id":{"type":"integer","title":"License Id"},"date":{"type":"string","format":"date","title":"Date"},"descr":{"type":"string","title":"Descr"},"file_name":{"type":"string","title":"File Name"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"currency_code":{"type":"string","title":"Currency Code"},"receipt_category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receipt Category Id"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"_expense_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]},"receipt_category":{"anyOf":[{"$ref":"#/components/schemas/AdminReceiptCategoryResponse"},{"type":"null"}]}},"type":"object","required":["id","user_id","license_id","date","descr","file_name","amount","vat","currency_code","created_on","updated_on"],"title":"AdminReceiptResponse","description":"Receipt entry for the admin receipts list."},"AdminReportFileCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminReportFileResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminReportFileCollectionResponse","description":"The report files of a license, most recently changed first."},"AdminReportFileResponse":{"properties":{"kind":{"$ref":"#/components/schemas/ReportKind"},"path":{"type":"string","title":"Path","description":"The path relative to the license folder, for the download"},"file_name":{"type":"string","title":"File Name"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start","description":"The first day a bundle covers"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End","description":"The last day a bundle covers, inclusive"},"recipient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Email","description":"The manager a bundle was addressed to, if known"},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder","description":"The folder of a bundle: bundled, or bundled-{customer} for a customer-specific layout"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On"}},"type":"object","required":["kind","path","file_name"],"title":"AdminReportFileResponse","description":"A report file of a license in the reports bucket."},"AdminRoleCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminRoleResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminRoleCollectionResponse","description":"Roles available to the caller."},"AdminRoleResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"license_level":{"type":"boolean","title":"License Level"},"department_level":{"type":"boolean","title":"Department Level"},"tenant_level":{"type":"boolean","title":"Tenant Level"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities","default":[]}},"type":"object","required":["id","name","display_name","license_level","department_level","tenant_level"],"title":"AdminRoleResponse","description":"Admin role definition with its scope levels and capabilities."},"AdminSessionPermissionResponse":{"properties":{"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id"},"role":{"type":"string","title":"Role"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities","default":[]}},"type":"object","required":["role"],"title":"AdminSessionPermissionResponse","description":"A single permission entry for the admin session response."},"AdminSessionResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"permissions":{"items":{"$ref":"#/components/schemas/AdminSessionPermissionResponse"},"type":"array","title":"Permissions"}},"type":"object","required":["user_id","email","permissions"],"title":"AdminSessionResponse","description":"Admin user session response returned after login."},"AdminSetSubscriptionExpiryRequest":{"properties":{"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"}},"additionalProperties":false,"type":"object","required":["expires_on"],"title":"AdminSetSubscriptionExpiryRequest","description":"Set or clear the expiry date on a subscription."},"AdminSetSubscriptionStatusRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"AdminSetSubscriptionStatusRequest","description":"Enable or disable a subscription."},"AdminStartImportRunRequest":{"properties":{"save_to_profile":{"type":"boolean","title":"Save To Profile","description":"Make this file's mapping the import profile's, e.g. after mapping a new column","default":false}},"type":"object","title":"AdminStartImportRunRequest","description":"Request to start importing an uploaded file."},"AdminSubscriptionFeatureCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminSubscriptionFeatureResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminSubscriptionFeatureCollectionResponse","description":"Effective feature flags for a subscription, ordered by feature name."},"AdminSubscriptionFeatureResponse":{"properties":{"feature_name":{"type":"string","title":"Feature Name"},"user_id":{"type":"string","title":"User Id"},"license_id":{"type":"integer","title":"License Id"},"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"source":{"type":"string","enum":["subscription","license"],"title":"Source"},"feature":{"$ref":"#/components/schemas/AdminFeatureResponse"}},"type":"object","required":["feature_name","user_id","license_id","enabled","created_on","updated_on","source","feature"],"title":"AdminSubscriptionFeatureResponse","description":"An effective feature flag for one subscription.\n\n``source=\"subscription\"`` rows come from ``subscription_features`` and can be\nedited or removed. ``source=\"license\"`` rows are inherited from the license and\nhave no override yet — they are read-only until one is created."},"AdminSubscriptionListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminSubscriptionResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminSubscriptionListResponse","description":"Paginated list of subscriptions."},"AdminSubscriptionManifestListItemResponse":{"properties":{"email":{"type":"string","title":"Email"},"license_id":{"type":"integer","title":"License Id"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"wpm":{"type":"boolean","title":"Wpm"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attributes"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"is_active":{"type":"boolean","title":"Is Active"},"claimed":{"type":"boolean","title":"Claimed","default":false},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]},"department":{"anyOf":[{"$ref":"#/components/schemas/AdminDepartmentResponse"},{"type":"null"}]},"group":{"anyOf":[{"$ref":"#/components/schemas/AdminExpenseGroupSummaryResponse"},{"type":"null"}]}},"type":"object","required":["email","license_id","wpm","created_on","updated_on","license","is_active"],"title":"AdminSubscriptionManifestListItemResponse","description":"A subscription manifest row on the manifests page.\n\nKept separate from ``AdminSubscriptionManifestResponse`` because that one is also\nembedded in ``AdminSubscriptionResponse.manifest``, where the claiming user and\nsubscription would be redundant (and circular)."},"AdminSubscriptionManifestListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminSubscriptionManifestListItemResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminSubscriptionManifestListResponse","description":"Paginated list of subscription manifests."},"AdminSubscriptionManifestResponse":{"properties":{"email":{"type":"string","title":"Email"},"license_id":{"type":"integer","title":"License Id"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"wpm":{"type":"boolean","title":"Wpm"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attributes"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"}},"type":"object","required":["email","license_id","wpm","created_on","updated_on","license"],"title":"AdminSubscriptionManifestResponse","description":"Subscription manifest information for admin dashboard."},"AdminSubscriptionResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"license_id":{"type":"integer","title":"License Id"},"status":{"$ref":"#/components/schemas/GenericStatus"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"mobility_budget":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Mobility Budget"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"wpm":{"type":"boolean","title":"Wpm"},"purchase_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purchase Id"},"type":{"$ref":"#/components/schemas/SubscriptionType"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"is_active":{"type":"boolean","title":"Is Active"},"department":{"anyOf":[{"$ref":"#/components/schemas/AdminDepartmentResponse"},{"type":"null"}]},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]},"group":{"anyOf":[{"$ref":"#/components/schemas/AdminExpenseGroupSummaryResponse"},{"type":"null"}]},"manifest":{"anyOf":[{"$ref":"#/components/schemas/AdminSubscriptionManifestResponse"},{"type":"null"}]}},"type":"object","required":["user_id","license_id","status","wpm","type","created_on","updated_on","is_active","license"],"title":"AdminSubscriptionResponse","description":"Detailed subscription information for admin dashboard."},"AdminTenantResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AdminTenantResponse","description":"Tenant information."},"AdminTransactionNSBCListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminTransactionNSBCResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminTransactionNSBCListResponse","description":"Paginated list of NSBC transactions."},"AdminTransactionNSBCResponse":{"properties":{"id":{"type":"integer","title":"Id"},"number":{"type":"string","title":"Number"},"license_id":{"type":"integer","title":"License Id"},"title":{"type":"string","title":"Title"},"descr":{"type":"string","title":"Descr"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"card_id":{"type":"string","title":"Card Id"},"date":{"type":"string","format":"date","title":"Date"},"product_code":{"type":"integer","title":"Product Code"},"travel_class":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Travel Class"},"check_in_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check In Location"},"check_out_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Out Location"},"distance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Distance"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"upstream_closed":{"type":"boolean","title":"Upstream Closed"},"_expense_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Id"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"license":{"anyOf":[{"$ref":"#/components/schemas/AdminLicenseResponse"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/AdminUserResponse"},{"type":"null"}]}},"type":"object","required":["id","number","license_id","title","descr","card_id","date","product_code","amount","vat","upstream_closed","created_on","updated_on"],"title":"AdminTransactionNSBCResponse","description":"NS Business Card transaction for admin dashboard."},"AdminTripListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminTripResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminTripListResponse","description":"Paginated list of a user's trips."},"AdminTripResponse":{"properties":{"trip_id":{"type":"integer","title":"Trip Id"},"trip_start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trip Start Time"},"trip_stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trip Stop Time"},"distance":{"type":"integer","title":"Distance"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"objective":{"type":"string","title":"Objective"},"modality":{"type":"integer","title":"Modality"},"vehicle_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vehicle Id"},"vehicle_class_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vehicle Class Id"},"start_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Location Name"},"start_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"start_address_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Address Id"},"start_address_type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"stop_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stop Location Name"},"stop_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"stop_address_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Address Id"},"stop_address_type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"upstream_co2":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Upstream Co2"},"downstream_co2":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Downstream Co2"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"source":{"type":"string","title":"Source"},"passenger":{"type":"boolean","title":"Passenger"},"passengers":{"type":"integer","title":"Passengers"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"expense_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expense Id"}},"type":"object","required":["trip_id","distance","objective","modality","created_on","updated_on","source","passenger","passengers"],"title":"AdminTripResponse","description":"A single trip for the admin dashboard.\n\nBuilt explicitly from a Trip ORM object (see the endpoint's mapper) rather than\nvia ``model_validate``, because several fields are renamed or transformed:\nduration is exposed in seconds, the CO2 columns are renamed, the address types are\npulled from the joined addresses, and the objective/source enums are emitted as\ntheir string names."},"AdminTripRuleRowRequest":{"properties":{"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"type":"object","title":"AdminTripRuleRowRequest","description":"Variable fields for one trip rule row (the fields that differ between DB\nrows)."},"AdminUpdateAddressRequest":{"properties":{"place_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Name"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]},"radius":{"anyOf":[{"type":"integer","maximum":32767.0,"minimum":1.0},{"type":"null"}],"title":"Radius"},"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"AdminUpdateAddressRequest","description":"Partial update of a license-bound address. Only its name, type, radius and\nstatus can change; to delete it, use DELETE instead of a status."},"AdminUpdateChallengeRuleRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"additionalProperties":false,"type":"object","title":"AdminUpdateChallengeRuleRequest","description":"Partial update for one challenge rule (``id``/``license_id`` immutable)."},"AdminUpdateExpenseRequest":{"properties":{"status":{"type":"string","enum":["new","submitted","failed","completed"],"title":"Status"}},"type":"object","required":["status"],"title":"AdminUpdateExpenseRequest","description":"Request body for changing the status of an expense.\n\n``declined`` is left out on purpose: the database enum does not have it."},"AdminUpdateImportProfileRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"config":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvImportConfigSchema"},{"type":"null"}]},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationScheduleSchema"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"AdminUpdateImportProfileRequest","description":"Partial update of an import profile. Send ``schedule: null`` to stop the\nscheduled runs. Its kind can't change."},"AdminUpdateImportRunRequest":{"properties":{"read":{"anyOf":[{"$ref":"#/components/schemas/AdminCsvReadOptionsSchema"},{"type":"null"}]},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/AdminCsvFieldMappingSchema"},"type":"array","maxItems":100},{"type":"null"}],"title":"Fields"},"date_order":{"anyOf":[{"type":"string","enum":["dmy","ymd","mdy"]},{"type":"null"}],"title":"Date Order"},"default_country":{"anyOf":[{"type":"string","pattern":"^[A-Za-z]{2}$"},{"type":"null"}],"title":"Default Country"},"default_radius":{"anyOf":[{"type":"integer","maximum":5000.0,"minimum":25.0},{"type":"null"}],"title":"Default Radius"},"address_names":{"anyOf":[{"patternProperties":{"^[0-9]{1,6}$":{"type":"string","maxLength":255}},"type":"object","maxProperties":501},{"type":"null"}],"title":"Address Names","description":"Addresses: a name per row number, replacing the names given before. An empty name falls back to the file's"}},"additionalProperties":false,"type":"object","title":"AdminUpdateImportRunRequest","description":"Partial update of an uploaded file's reading options and mapping, while it\nis a draft. Fields left out stay as they are."},"AdminUpdateIntegrationRequest":{"properties":{"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationScheduleSchema"},{"type":"null"}]},"company":{"anyOf":[{"$ref":"#/components/schemas/AdminIntegrationCompanySchema"},{"type":"null"}]},"field_mapping":{"anyOf":[{"items":{"$ref":"#/components/schemas/AdminPersonioFieldMappingSchema"},"type":"array","maxItems":100},{"type":"null"}],"title":"Field Mapping","description":"Personio: how it fills the manifest; replaces the mapping"}},"additionalProperties":false,"type":"object","title":"AdminUpdateIntegrationRequest","description":"Partial update of an integration. Send ``schedule: null`` to stop the\nscheduled runs."},"AdminUpdateLicenseFeatureRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"AdminUpdateLicenseFeatureRequest","description":"Replace the enabled state and config of a license feature."},"AdminUpdateLicenseRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Domains"},"trip_sources":{"anyOf":[{"items":{"$ref":"#/components/schemas/TripSource"},"type":"array"},{"type":"null"}],"title":"Trip Sources"},"communication_flags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Communication Flags"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"commute_distances_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Commute Distances Enabled"},"expense_report":{"anyOf":[{"$ref":"#/components/schemas/ExpenseReportType"},{"type":"null"}]},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"enforce_manifests":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enforce Manifests"},"oidc_provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oidc Provider Id"},"group_code_func":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Code Func"},"department_code_func":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Code Func"},"nsbc_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nsbc Name"},"currency_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Code"},"bundle_features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Bundle Features"}},"additionalProperties":false,"type":"object","title":"AdminUpdateLicenseRequest","description":"Partial update for a license. ``id`` and ``tenant_id`` are immutable."},"AdminUpdatePermissionRequest":{"properties":{"role_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Id"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"tenant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"extra_capabilities":{"anyOf":[{"items":{"$ref":"#/components/schemas/Capability"},"type":"array"},{"type":"null"}],"title":"Extra Capabilities"}},"additionalProperties":false,"type":"object","title":"AdminUpdatePermissionRequest","description":"Partial update of a role assignment (``user_id``/``email`` immutable).\n\n``extra_capabilities`` replaces the whole set when sent; omit it to keep the\ncurrent extras and send ``[]`` to remove them all."},"AdminUpdateTeamPermissionRequest":{"properties":{"role_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Role Id"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"extra_capabilities":{"anyOf":[{"items":{"$ref":"#/components/schemas/Capability"},"type":"array"},{"type":"null"}],"title":"Extra Capabilities"}},"additionalProperties":false,"type":"object","title":"AdminUpdateTeamPermissionRequest","description":"Partial update of a team role assignment (scope license immutable).\n\n``extra_capabilities`` replaces the whole set when sent; omit it to keep the\ncurrent extras and send ``[]`` to remove them all."},"AdminUpdateTransactionNSBCRuleRequest":{"properties":{"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"product_codes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Product Codes"},"travel_classes":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Travel Classes"},"compensated_percentage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Compensated Percentage"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"additionalProperties":false,"type":"object","title":"AdminUpdateTransactionNSBCRuleRequest","description":"Partial update for one NSBC rule (``id``/``license_id`` immutable)."},"AdminUpdateTripRuleRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"wage_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wage Component"},"status":{"anyOf":[{"$ref":"#/components/schemas/GenericStatus"},{"type":"null"}]},"modality_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Modality Ids"},"objectives":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objectives"},"passenger":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passenger"},"min_passengers":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Passengers"},"shared_modality":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared Modality"},"min_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Meters"},"max_trip_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Trip Distance Meters"},"max_distance_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Distance Meters"},"min_distance_subtract_meters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Distance Subtract Meters"},"compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Compensation Per Km"},"taxable_compensation_per_km":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Taxable Compensation Per Km"},"max_daily_expenses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Expenses"},"max_daily_compensation":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Max Daily Compensation"},"max_daily_distance_km":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Distance Km"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"threshold_deduction_priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold Deduction Priority"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},"additionalProperties":false,"type":"object","title":"AdminUpdateTripRuleRequest","description":"Partial update for one trip rule (``id``/``license_id`` immutable)."},"AdminUpsertDistanceRequest":{"properties":{"distance":{"type":"integer","exclusiveMinimum":0.0,"title":"Distance","description":"Distance in metres"},"duration":{"type":"integer","exclusiveMinimum":0.0,"title":"Duration","description":"Duration in seconds"},"modality_id":{"$ref":"#/components/schemas/ModalityEnum","default":3}},"type":"object","required":["distance","duration"],"title":"AdminUpsertDistanceRequest","description":"Request body for upserting a distance between two addresses."},"AdminUpsertSubscriptionFeatureRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"AdminUpsertSubscriptionFeatureRequest","description":"Create or update a subscription-level feature override."},"AdminUserDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"status":{"$ref":"#/components/schemas/AccountStatus"},"tenant_id":{"type":"integer","title":"Tenant Id"},"mobidot_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mobidot User Id"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"expiry_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expiry Date"},"external_campaign_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Campaign Code"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"last_login_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login Provider"},"last_login_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login Platform"},"primary_subscription":{"anyOf":[{"$ref":"#/components/schemas/AdminSubscriptionResponse"},{"type":"null"}]}},"type":"object","required":["id","status","tenant_id","created_on","updated_on"],"title":"AdminUserDetailResponse","description":"Full user detail for admin view."},"AdminUserExpenseRulesResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"},"trip_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTripRuleResponse"},"type":"array","title":"Trip Rules","default":[]},"challenge_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseChallengeRuleResponse"},"type":"array","title":"Challenge Rules","default":[]},"transaction_nsbc_rules":{"items":{"$ref":"#/components/schemas/AdminExpenseTransactionNSBCRuleResponse"},"type":"array","title":"Transaction Nsbc Rules","default":[]}},"type":"object","required":["license_id","group_id"],"title":"AdminUserExpenseRulesResponse","description":"All expense rules applicable to a user, scoped to their subscription's\nlicense and group."},"AdminUserFirebaseResponse":{"properties":{"uid":{"type":"string","title":"Uid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"disabled":{"type":"boolean","title":"Disabled"},"providers":{"items":{"$ref":"#/components/schemas/AdminFirebaseProviderResponse"},"type":"array","title":"Providers"}},"type":"object","required":["uid","email","email_verified","disabled","providers"],"title":"AdminUserFirebaseResponse","description":"Firebase account info for a user."},"AdminUserListItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"status":{"$ref":"#/components/schemas/AccountStatus"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"},"primary_subscription":{"anyOf":[{"$ref":"#/components/schemas/AdminUserSubscriptionSummaryResponse"},{"type":"null"}]}},"type":"object","required":["id","status","created_on","updated_on"],"title":"AdminUserListItemResponse","description":"User record returned in the admin users list."},"AdminUserListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"},"items":{"items":{"$ref":"#/components/schemas/AdminUserListItemResponse"},"type":"array","title":"Items"}},"type":"object","required":["total","page","page_size","has_next","has_previous","items"],"title":"AdminUserListResponse","description":"Paginated list of users."},"AdminUserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"}},"type":"object","required":["id"],"title":"AdminUserResponse","description":"User information."},"AdminUserSearchCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminUserResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminUserSearchCollectionResponse","description":"Users matching an email search (for granting a first role)."},"AdminUserSubscriptionCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminSubscriptionResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminUserSubscriptionCollectionResponse","description":"All subscriptions held by a single user, ordered most-relevant first."},"AdminUserSubscriptionSummaryResponse":{"properties":{"license_id":{"type":"integer","title":"License Id"},"status":{"$ref":"#/components/schemas/GenericStatus"},"type":{"$ref":"#/components/schemas/SubscriptionType"},"license":{"$ref":"#/components/schemas/AdminLicenseResponse"}},"type":"object","required":["license_id","status","type","license"],"title":"AdminUserSubscriptionSummaryResponse","description":"Compact subscription info embedded in user list responses."},"AdminWpmInviteCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminWpmInviteResponse"},"type":"array","title":"Items"},"recipient_count":{"type":"integer","title":"Recipient Count","description":"The number of employees flagged for WPM an invite is sent to"}},"type":"object","required":["items","recipient_count"],"title":"AdminWpmInviteCollectionResponse","description":"The WPM survey invites of a license, newest first."},"AdminWpmInviteRequest":{"properties":{"send_date":{"type":"string","format":"date","title":"Send Date","description":"The invite is emailed on or after this date"},"year":{"type":"integer","maximum":2100.0,"minimum":2020.0,"title":"Year","description":"The year the survey asks about"},"month":{"anyOf":[{"type":"integer","maximum":12.0,"minimum":1.0},{"type":"null"}],"title":"Month","description":"The month the survey asks about, or null for the whole year"}},"type":"object","required":["send_date","year"],"title":"AdminWpmInviteRequest","description":"Request to plan or replace a WPM survey invite."},"AdminWpmInviteResponse":{"properties":{"id":{"type":"integer","title":"Id"},"send_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Send Date"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"},"status":{"$ref":"#/components/schemas/OneoffJobStatus"},"created_on":{"type":"string","format":"date-time","title":"Created On"},"updated_on":{"type":"string","format":"date-time","title":"Updated On"}},"type":"object","required":["id","status","created_on","updated_on"],"title":"AdminWpmInviteResponse","description":"A WPM survey invite of a license."},"AdminWpmJobResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"}},"type":"object","required":["workflow_id"],"title":"AdminWpmJobResponse","description":"A WPM report job started in the runners."},"AdminWpmJobResultResponse":{"properties":{"year":{"type":"integer","title":"Year"},"file_name":{"type":"string","title":"File Name"}},"type":"object","required":["year","file_name"],"title":"AdminWpmJobResultResponse","description":"The report a completed WPM report job wrote."},"AdminWpmJobStatusResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Why the job failed: no_data, license_not_found or unexpected"},"result":{"anyOf":[{"$ref":"#/components/schemas/AdminWpmJobResultResponse"},{"type":"null"}]}},"type":"object","required":["workflow_id","status"],"title":"AdminWpmJobStatusResponse","description":"The state of a WPM report job."},"AdminWpmReportCollectionResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminWpmReportResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AdminWpmReportCollectionResponse","description":"The WPM report bundles of a license, newest first."},"AdminWpmReportDefaultsResponse":{"properties":{"year":{"type":"integer","title":"Year"},"report_type":{"$ref":"#/components/schemas/WpmReportType"}},"type":"object","required":["year","report_type"],"title":"AdminWpmReportDefaultsResponse","description":"The report type that fits a license's WPM data of a year."},"AdminWpmReportResponse":{"properties":{"year":{"type":"integer","title":"Year"},"file_name":{"type":"string","title":"File Name"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On"}},"type":"object","required":["year","file_name"],"title":"AdminWpmReportResponse","description":"A WPM report bundle in the reports bucket."},"AuthSessionSchema":{"properties":{"user_id":{"type":"string","title":"User Id"},"id_token":{"type":"string","title":"Id Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"expires_in":{"type":"integer","title":"Expires In","description":"Seconds until the ID token expires"},"is_new_user":{"type":"boolean","title":"Is New User","description":"Whether this request created the account"}},"type":"object","required":["user_id","id_token","refresh_token","expires_in","is_new_user"],"title":"AuthSessionSchema","description":"Tokens for a signed-in user. Send the ID token as a bearer token; get a new\none from the refresh endpoint before it expires."},"Capability":{"type":"string","enum":["view_users","manage_users","view_addresses","view_expenses","manage_expenses","view_reports","manage_license_settings","read_team","manage_team","read_admins","manage_admins","view_private_address","view_payroll_data","view_reimbursement_details"],"title":"Capability","description":"Admin capabilities granted through roles and per-permission extras.\n\nMust match the rows of the `capabilities` table exactly; a test enforces\nthis, so adding a member also requires a migration seeding the row."},"CardNSBCSortField":{"type":"string","enum":["last_used","first_used","card_id","holder","user","transaction_count","total_amount"],"title":"CardNSBCSortField","description":"Fields the NSBC card list can be sorted on."},"ClientError":{"properties":{"type":{"type":"string","title":"Type","description":"A URI reference that identifies the problem type.","default":"about:blank"},"title":{"type":"string","title":"Title","description":"A human-readable summary of the problem type."},"status":{"type":"integer","maximum":599.0,"minimum":100.0,"title":"Status","description":"The HTTP status code."},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Instance","description":"A URI reference that identifies the specific occurrence of the problem."}},"type":"object","required":["title","status","detail"],"title":"ClientError","description":"Problem Detail report for a client side problem."},"CollectionEnvelope_AddressResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AddressResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[AddressResponseSchema]"},"CollectionEnvelope_DaySchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DaySchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[DaySchema]"},"CollectionEnvelope_ExpenseResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExpenseResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[ExpenseResponseSchema]"},"CollectionEnvelope_JourneyResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JourneyResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[JourneyResponseSchema]"},"CollectionEnvelope_JourneySegmentResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JourneySegmentResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[JourneySegmentResponseSchema]"},"CollectionEnvelope_ListItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListItemResponse"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[ListItemResponse]"},"CollectionEnvelope_ModalitySchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ModalitySchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[ModalitySchema]"},"CollectionEnvelope_ProjectCodeResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[ProjectCodeResponseSchema]"},"CollectionEnvelope_ReceiptCategorySchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReceiptCategorySchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[ReceiptCategorySchema]"},"CollectionEnvelope_SubscriptionSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SubscriptionSchema-Input"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[SubscriptionSchema]"},"CollectionEnvelope_TripSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TripSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[TripSchema]"},"CollectionEnvelope_VehicleResponseSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VehicleResponseSchema"},"type":"array","title":"Items"},"links":{"anyOf":[{"$ref":"#/components/schemas/LinksSchema"},{"type":"null"}]}},"type":"object","required":["items"],"title":"CollectionEnvelope[VehicleResponseSchema]"},"Coordinate":{"properties":{"lat":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Lat"},"lng":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Lng"}},"type":"object","required":["lat","lng"],"title":"Coordinate","description":"Container to hold a geolocation."},"CsvImportKind":{"type":"string","enum":["addresses","manifests"],"title":"CsvImportKind","description":"What a CSV import creates or updates."},"CurrencyResponse":{"properties":{"code":{"type":"string","maxLength":3,"minLength":3,"title":"Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"}},"type":"object","required":["code"],"title":"CurrencyResponse"},"CursorPage_TypeVar_Customized_ListItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ListItemResponse"},"type":"array","title":"Items"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"current_page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Page","description":"Cursor to refetch the current page"},"current_page_backwards":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Page Backwards","description":"Cursor to refetch the current page starting from the last item"},"previous_page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Page","description":"Cursor for the previous page"},"next_page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Page","description":"Cursor for the next page"}},"type":"object","required":["items","total"],"title":"CursorPage[TypeVar]Customized[ListItemResponse]"},"DashboardWidget":{"type":"string","enum":["reimbursements","km","wfh","nsbc","co2"],"title":"DashboardWidget","description":"A widget on the license admin dashboard. Members are declared in display order."},"DayExpenseState":{"type":"string","enum":["open","calculating","submitted","failed","expensed","reimbursed","declined","lapsed"],"title":"DayExpenseState"},"DayRequest":{"properties":{"wfh":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wfh"},"state":{"anyOf":[{"$ref":"#/components/schemas/DayState"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"DayRequest","description":"Request body for the days endpoint.","example":{"state":"modified","wfh":true}},"DaySchema":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"wfh":{"type":"boolean","title":"Wfh"},"wfo":{"type":"boolean","title":"Wfo"},"business_trips":{"type":"boolean","title":"Business Trips"},"expense_state":{"$ref":"#/components/schemas/DayExpenseState"},"state":{"anyOf":[{"$ref":"#/components/schemas/DayState"},{"type":"null"}]},"wpm":{"type":"boolean","title":"Wpm"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"job_status":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["date","wfh","wfo","business_trips","expense_state","wpm"],"title":"DaySchema","description":"Public schema for the Day database model.","example":{"date":"2023-12-31","state":"completed","wfh":true,"wfo":false,"wpm":false}},"DayState":{"type":"string","enum":["new","modified","completed"],"title":"DayState","description":"State a day may have."},"DaySubmitError":{"properties":{"code":{"type":"integer","title":"Code"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"additionalProperties":false,"type":"object","required":["code"],"title":"DaySubmitError"},"DaySubmitResult":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"job_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Url"},"status":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/DaySubmitError"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["date"],"title":"DaySubmitResult"},"DaysBulkSubmitRequest":{"properties":{"dates":{"items":{"type":"string","format":"date"},"type":"array","maxItems":31,"title":"Dates"}},"additionalProperties":false,"type":"object","required":["dates"],"title":"DaysBulkSubmitRequest"},"DaysBulkSubmitResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/DaySubmitResult"},"type":"array","title":"Results"}},"additionalProperties":false,"type":"object","required":["results"],"title":"DaysBulkSubmitResponse"},"DistanceResponseSchema":{"properties":{"address1_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Address1 Id"},"address2_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Address2 Id"},"distance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Distance"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"modality_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Modality Id"}},"type":"object","title":"DistanceResponseSchema","description":"Distance resource response body."},"EffectiveFeatureResponse":{"properties":{"feature_name":{"type":"string","title":"Feature Name"},"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","required":["feature_name","enabled"],"title":"EffectiveFeatureResponse"},"EmailSignInRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"The user's email address"},"language":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Language"},"wpm_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wpm Month"},"wpm_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wpm Year"},"wpm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wpm"},"campaign_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Code"}},"type":"object","required":["email"],"title":"EmailSignInRequest","description":"Request parameters for Firebase email sign in link."},"ExpenseReportRequest":{"properties":{"year":{"type":"integer","minimum":2000.0,"title":"Year"},"month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Month"}},"type":"object","required":["year","month"],"title":"ExpenseReportRequest","description":"Request model for an expense report."},"ExpenseReportType":{"type":"string","enum":["none","manual","bundle","api"],"title":"ExpenseReportType","description":"Type of expense report."},"ExpenseResponseSchema":{"properties":{"id":{"type":"integer","exclusiveMinimum":0.0,"title":"Id"},"title":{"type":"string","title":"Title"},"amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"number_of_units":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Number Of Units"},"amount_per_unit":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount Per Unit"},"status":{"$ref":"#/components/schemas/ExpenseStatus"},"rule_type":{"$ref":"#/components/schemas/ExpenseRuleType"},"rule":{"$ref":"#/components/schemas/ExpenseRuleResponseSchema"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"expensed_on":{"type":"string","format":"date","title":"Expensed On"}},"type":"object","required":["id","title","number_of_units","status","rule_type","rule","expensed_on"],"title":"ExpenseResponseSchema","description":"Expense resource response body."},"ExpenseRuleResponseSchema":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/GenericStatus"}},"type":"object","required":["name","status"],"title":"ExpenseRuleResponseSchema","description":"The rule an expense originated from (trip, challenge or NSBC rule)."},"ExpenseRuleType":{"type":"string","enum":["day","trip","nsbc","receipt"],"title":"ExpenseRuleType","description":"The originating rule type of an expense record."},"ExpenseSortField":{"type":"string","enum":["expensed_on","title","user","rule","status","number_of_units","amount","objective","subtype","created_on"],"title":"ExpenseSortField","description":"Fields the expense list can be sorted on."},"ExpenseStatus":{"type":"integer","enum":[0,1,2,3,4],"title":"ExpenseStatus","description":"The status of an expense record. Members are declared in ascending priority order."},"FederatedSignInRequest":{"properties":{"method":{"type":"string","enum":["google.com","apple.com"],"title":"Method"},"id_token":{"type":"string","format":"password","title":"Id Token","description":"The ID token issued by Google or Apple","writeOnly":true},"nonce":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Nonce","description":"The unhashed nonce used in the sign-in request; required for Apple, not used for Google"}},"type":"object","required":["method","id_token"],"title":"FederatedSignInRequest","description":"Sign in with the ID token the app got from signing in natively with Google or\nApple. The account is created on first sign-in."},"FuelType":{"type":"string","enum":["petrol","diesel","electric","lpg","cng","lng","alcohol","hydrogen"],"title":"FuelType","description":"Types of fuel a vehicle can have."},"GenericStatus":{"type":"integer","enum":[1,2,3],"title":"GenericStatus","description":"Multi-purpose status field used throughout the database."},"ImportProfileSortField":{"type":"string","enum":["name","created_on","kind"],"title":"ImportProfileSortField","description":"Fields the import profile list can be sorted on."},"ImportRunSortField":{"type":"string","enum":["created_on","finished_on","status","file_name"],"title":"ImportRunSortField","description":"Fields the import run list can be sorted on."},"IntegrationRunSortField":{"type":"string","enum":["scheduled_at","started_on","finished_on","status","integration"],"title":"IntegrationRunSortField","description":"Fields the integration run log can be sorted on."},"IntegrationSortField":{"type":"string","enum":["created_on","type","license"],"title":"IntegrationSortField","description":"Fields the integration list can be sorted on."},"IntegrationTaskTrigger":{"type":"string","enum":["schedule","manual","upload","folder"],"title":"IntegrationTaskTrigger","description":"Why an integration task ran."},"JobStatus":{"type":"string","enum":["pending","draft","processing","completed","failed","cancelled"],"title":"JobStatus","description":"Status of a background job."},"JobStatusSchema":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["workflow_id","status"],"title":"JobStatusSchema","description":"Response schema for a background job status query."},"JourneyRequestSchema":{"properties":{"name":{"type":"string","title":"Name"},"objective":{"$ref":"#/components/schemas/TripObjective"},"different_return":{"type":"boolean","title":"Different Return"},"priority":{"type":"integer","title":"Priority"},"original_journey_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Journey Id"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"segments":{"items":{"$ref":"#/components/schemas/JourneySegmentRequestSchema"},"type":"array","title":"Segments","default":[]}},"additionalProperties":false,"type":"object","required":["name","objective","different_return","priority"],"title":"JourneyRequestSchema","description":"Journey request schema."},"JourneyResponseSchema":{"properties":{"id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"objective":{"$ref":"#/components/schemas/TripObjective"},"different_return":{"type":"boolean","title":"Different Return"},"priority":{"type":"integer","title":"Priority"},"return_journey":{"anyOf":[{"$ref":"#/components/schemas/JourneyResponseSchema"},{"type":"null"}]},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"segments":{"anyOf":[{"items":{"$ref":"#/components/schemas/JourneySegmentBaseSchema"},"type":"array"},{"type":"null"}],"title":"Segments"}},"additionalProperties":false,"type":"object","required":["name","objective","different_return","priority"],"title":"JourneyResponseSchema","description":"Journey resource response body."},"JourneySegmentBaseSchema":{"properties":{"id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Id"},"start_address":{"anyOf":[{"$ref":"#/components/schemas/AddressResponseSchema"},{"type":"null"}]},"stop_address":{"anyOf":[{"$ref":"#/components/schemas/AddressResponseSchema"},{"type":"null"}]},"distance":{"anyOf":[{"$ref":"#/components/schemas/DistanceResponseSchema"},{"type":"null"}]},"return_distance":{"anyOf":[{"$ref":"#/components/schemas/DistanceResponseSchema"},{"type":"null"}]},"vehicle_class":{"anyOf":[{"$ref":"#/components/schemas/VehicleClassSchema"},{"type":"null"}]},"vehicle":{"anyOf":[{"$ref":"#/components/schemas/VehicleResponseSchema"},{"type":"null"}]},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"additionalProperties":false,"type":"object","title":"JourneySegmentBaseSchema","description":"Journey Segment base schema."},"JourneySegmentRequestSchema":{"properties":{"id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Id"},"start_address_id":{"type":"integer","title":"Start Address Id"},"stop_address_id":{"type":"integer","title":"Stop Address Id"},"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"vehicle_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vehicle Id"},"priority":{"type":"integer","title":"Priority"}},"additionalProperties":false,"type":"object","required":["start_address_id","stop_address_id","vehicle_class_id","priority"],"title":"JourneySegmentRequestSchema","description":"Journey Segment request schema"},"JourneySegmentResponseSchema":{"properties":{"id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Id"},"start_address":{"anyOf":[{"$ref":"#/components/schemas/AddressResponseSchema"},{"type":"null"}]},"stop_address":{"anyOf":[{"$ref":"#/components/schemas/AddressResponseSchema"},{"type":"null"}]},"distance":{"anyOf":[{"$ref":"#/components/schemas/DistanceResponseSchema"},{"type":"null"}]},"return_distance":{"anyOf":[{"$ref":"#/components/schemas/DistanceResponseSchema"},{"type":"null"}]},"vehicle_class":{"anyOf":[{"$ref":"#/components/schemas/VehicleClassSchema"},{"type":"null"}]},"vehicle":{"anyOf":[{"$ref":"#/components/schemas/VehicleResponseSchema"},{"type":"null"}]},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"additionalProperties":false,"type":"object","title":"JourneySegmentResponseSchema","description":"Journey Segment resource response body."},"JourneySegmentUpdateSchema":{"properties":{"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"vehicle_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vehicle Id"}},"additionalProperties":false,"type":"object","required":["vehicle_class_id"],"title":"JourneySegmentUpdateSchema","description":"Journey Segment update schema"},"JourneyTripsCreate":{"properties":{"source":{"$ref":"#/components/schemas/TripSource","default":"manual"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stop Time"},"utcoffset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Utcoffset"},"passenger":{"type":"boolean","title":"Passenger","default":false},"passengers":{"type":"integer","minimum":1.0,"title":"Passengers","default":1},"shared_modality":{"type":"boolean","title":"Shared Modality","default":false},"transformed_modality":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transformed Modality"},"objective_id":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"vehicle_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Id"},"vehicle_class_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Class Id"},"start_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Location Name"},"stop_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stop Location Name"},"start_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"stop_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"distance":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Distance"},"duration":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin","deprecated":true},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination","deprecated":true},"project_code_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Project Code Id"},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"create_return_journey_trips":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Create Return Journey Trips"}},"additionalProperties":false,"type":"object","required":["start_time"],"title":"JourneyTripsCreate","description":"Request body for the POST trip/journey endpoint."},"JourneyUpdateSchema":{"properties":{"name":{"type":"string","title":"Name"},"objective":{"$ref":"#/components/schemas/TripObjective"},"different_return":{"type":"boolean","title":"Different Return"},"priority":{"type":"integer","title":"Priority"},"original_journey_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Journey Id"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"},"segments":{"items":{"$ref":"#/components/schemas/JourneySegmentRequestSchema"},"type":"array","title":"Segments"}},"additionalProperties":false,"type":"object","title":"JourneyUpdateSchema"},"LicenseModule":{"type":"string","enum":["expenses","nsbc_transactions","receipts","addresses","wpm","bundle","integrations"],"title":"LicenseModule","description":"A platform module a license may or may not use. Members are declared in the\norder of the admin dashboard sidebar."},"LicenseSchema-Input":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"commute_distances_enabled":{"type":"boolean","title":"Commute Distances Enabled"},"expense_report":{"$ref":"#/components/schemas/ExpenseReportType"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"oidc_provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oidc Provider Id","description":"Forced provider ID (e.g. microsoft.com, google.com)"},"trip_sources":{"items":{"$ref":"#/components/schemas/TripSource"},"type":"array","title":"Trip Sources"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyResponse"},{"type":"null"}]},"feature_flags":{"items":{"$ref":"#/components/schemas/EffectiveFeatureResponse"},"type":"array","title":"Feature Flags"}},"additionalProperties":false,"type":"object","required":["id","name","commute_distances_enabled","expense_report","config","trip_sources"],"title":"LicenseSchema","description":"Public schema for the License database model."},"LicenseSchema-Output":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"commute_distances_enabled":{"type":"boolean","title":"Commute Distances Enabled"},"expense_report":{"$ref":"#/components/schemas/ExpenseReportType"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"oidc_provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oidc Provider Id","description":"Forced provider ID (e.g. microsoft.com, google.com)"},"trip_sources":{"items":{"$ref":"#/components/schemas/TripSource"},"type":"array","title":"Trip Sources"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyResponse"},{"type":"null"}]},"features":{"items":{"type":"string"},"type":"array","title":"Features","description":"Backward-compatible list of enabled feature names.","readOnly":true}},"additionalProperties":false,"type":"object","required":["id","name","commute_distances_enabled","expense_report","config","trip_sources","features"],"title":"LicenseSchema","description":"Public schema for the License database model."},"LinksSchema":{"properties":{"next":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Next"},"prev":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Prev"}},"type":"object","title":"LinksSchema","description":"Links section of response envelopes."},"ListItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"date":{"type":"string","format":"date","title":"Date"},"title":{"type":"string","title":"Title"},"descr":{"type":"string","title":"Descr"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"check_in_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check In Location"},"check_out_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Out Location"},"objective_auto":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"definitive_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Definitive Date"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"receipt_category":{"anyOf":[{"$ref":"#/components/schemas/ReceiptCategorySchema"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"null"}]},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"typ":{"type":"string","title":"Typ"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyResponse"},{"type":"null"}]},"read_only":{"type":"boolean","title":"Read Only"}},"type":"object","required":["id","date","title","descr","amount","vat","objective","check_in_location","check_out_location","objective_auto","definitive_date","typ","currency","read_only"],"title":"ListItemResponse"},"ModalityEnum":{"type":"integer","enum":[0,1,2,3,4,5,6,7,8,9,10,11,12,19,21,22,23,24],"title":"ModalityEnum","description":"Moin modalities."},"ModalityGroupName":{"type":"string","enum":["walking","bikes","cars","motorbikes","public_transport","mopeds","planes","boats","scooters","fun","other"],"title":"ModalityGroupName","description":"Group name of which a modality belongs to."},"ModalitySchema":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"translate_fields__":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Translate Fields","default":["name"]}},"type":"object","required":["id","name"],"title":"ModalitySchema","description":"Public schema for the Modality database model."},"NSBCResponse":{"properties":{"id":{"type":"integer","title":"Id"},"date":{"type":"string","format":"date","title":"Date"},"title":{"type":"string","title":"Title"},"descr":{"type":"string","title":"Descr"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"check_in_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check In Location"},"check_out_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Check Out Location"},"objective_auto":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"definitive_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Definitive Date"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"receipt_category":{"anyOf":[{"$ref":"#/components/schemas/ReceiptCategorySchema"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"null"}]},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"card_id":{"type":"string","title":"Card Id"},"distance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Distance"}},"type":"object","required":["id","date","title","descr","amount","vat","objective","check_in_location","check_out_location","objective_auto","definitive_date","note","card_id","distance"],"title":"NSBCResponse"},"ObjectiveUpdate":{"properties":{"objective":{"type":"string","title":"Objective"}},"type":"object","required":["objective"],"title":"ObjectiveUpdate"},"OneoffJobStatus":{"type":"string","enum":["pending","sent","new","deleted","failed"],"title":"OneoffJobStatus"},"Page_TypeVar_Customized_VehicleClassSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VehicleClassSchema"},"type":"array","title":"Items"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"page":{"type":"integer","minimum":1.0,"title":"Page"},"size":{"type":"integer","minimum":1.0,"title":"Size"},"pages":{"type":"integer","minimum":0.0,"title":"Pages"}},"type":"object","required":["items","total","page","size","pages"],"title":"Page[TypeVar]Customized[VehicleClassSchema]"},"PasswordSignInRequest":{"properties":{"method":{"type":"string","const":"password","title":"Method"},"email":{"type":"string","format":"email","title":"Email","description":"The user's email address"},"password":{"type":"string","format":"password","title":"Password","description":"The user's password","writeOnly":true}},"type":"object","required":["method","email","password"],"title":"PasswordSignInRequest","description":"Sign in with an email address and password."},"PaymentType":{"type":"string","enum":["private"],"title":"PaymentType"},"Platform":{"type":"string","enum":["ios","android","web"],"title":"Platform"},"ProblemDetail":{"properties":{"type":{"type":"string","title":"Type","description":"A URI reference that identifies the problem type.","default":"about:blank"},"title":{"type":"string","title":"Title","description":"A human-readable summary of the problem type."},"status":{"type":"integer","maximum":599.0,"minimum":100.0,"title":"Status","description":"The HTTP status code."},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Instance","description":"A URI reference that identifies the specific occurrence of the problem."}},"type":"object","required":["title","status","detail"],"title":"ProblemDetail","description":"A generic Problem Detail error response."},"ProjectCodeResponseSchema":{"properties":{"id":{"type":"integer","title":"Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_default":{"type":"boolean","title":"Is Default"},"priority":{"type":"integer","title":"Priority"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"status":{"$ref":"#/components/schemas/GenericStatus"}},"type":"object","required":["id","name","is_default","priority","status"],"title":"ProjectCodeResponseSchema","description":"Project code resource response body."},"ProviderSchema":{"properties":{"license_name":{"type":"string","title":"License Name","description":"Customer license name"},"provider_id":{"type":"string","title":"Provider Id","description":"OIDC provider to use"}},"additionalProperties":false,"type":"object","required":["license_name","provider_id"],"title":"ProviderSchema","description":"Alternative view of a license model, showing just information about a\nfederated identity provider."},"QonversionPlatform":{"type":"string","enum":["iOS","Android"],"title":"QonversionPlatform","description":"Possible platforms that Qonversion supports."},"QonversionSubscribeRequest":{"properties":{"platform":{"anyOf":[{"$ref":"#/components/schemas/QonversionPlatform"},{"type":"null"}]},"affiliate_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Affiliate Data","description":"Affiliate data e.g. campaign name"}},"type":"object","title":"QonversionSubscribeRequest","description":"Request body for the Qonversion subscribe endpoint.","example":{"affiliate_data":{"foo":"bar"}}},"RateLimitedError":{"properties":{"type":{"type":"string","title":"Type","default":"/errors/rate-limited"},"title":{"type":"string","title":"Title","description":"A human-readable summary of the problem type."},"status":{"type":"integer","title":"Status","default":429},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Instance","description":"A URI reference that identifies the specific occurrence of the problem."}},"type":"object","required":["title","detail"],"title":"RateLimitedError","description":"Problem Detail report when client is being rate-limited."},"ReceiptCategorySchema":{"properties":{"id":{"type":"integer","title":"Id"},"license_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"License Id"},"name":{"type":"string","title":"Name"},"priority":{"type":"integer","title":"Priority"}},"type":"object","required":["id","name","priority"],"title":"ReceiptCategorySchema","description":"Public schema for the Receipt Category database model."},"ReceiptRequest":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"descr":{"type":"string","title":"Descr"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"file_name":{"type":"string","title":"File Name"},"receipt_category_id":{"type":"integer","title":"Receipt Category Id"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"currency_code":{"type":"string","maxLength":3,"minLength":3,"title":"Currency Code"},"payment_method":{"$ref":"#/components/schemas/PaymentType"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"}},"additionalProperties":false,"type":"object","required":["date","descr","amount","file_name","receipt_category_id","vat","currency_code","payment_method"],"title":"ReceiptRequest"},"ReceiptResponse":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date"},"descr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Descr"},"amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Amount"},"vat":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Vat"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyResponse"},{"type":"null"}]},"receipt_category":{"anyOf":[{"$ref":"#/components/schemas/ReceiptCategorySchema"},{"type":"null"}]},"payment_method":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]}},"type":"object","title":"ReceiptResponse"},"ReceiptSortField":{"type":"string","enum":["date","descr","user","category","amount","vat","objective","created_on"],"title":"ReceiptSortField","description":"Fields the receipt list can be sorted on."},"ReceiptUpdateSchema":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"descr":{"type":"string","title":"Descr"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"file_name":{"type":"string","title":"File Name"},"receipt_category_id":{"type":"integer","title":"Receipt Category Id"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"vat":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Vat"},"currency_code":{"type":"string","maxLength":3,"minLength":3,"title":"Currency Code"},"payment_method":{"$ref":"#/components/schemas/PaymentType"},"project_code_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Code Id"}},"additionalProperties":false,"type":"object","title":"ReceiptUpdateSchema"},"RefreshSessionRequest":{"properties":{"refresh_token":{"type":"string","format":"password","title":"Refresh Token","writeOnly":true}},"type":"object","required":["refresh_token"],"title":"RefreshSessionRequest","description":"Exchange a refresh token for a new ID token."},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"The user's email address"},"password":{"type":"string","format":"password","title":"Password","description":"The new password","writeOnly":true},"display_name":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["email","password"],"title":"RegisterRequest","description":"Create an account with an email address and password."},"RegistrationSchema":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"}},"type":"object","required":["user_id","email"],"title":"RegistrationSchema","description":"The account that was registered. Signing in works once its email address is\nverified."},"ReportKind":{"type":"string","enum":["wpm","bundled"],"title":"ReportKind","description":"A subfolder of a license's folder holding reports for its admins."},"RequestCollectionEnvelope_JourneySegmentRequestSchema_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JourneySegmentRequestSchema"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"RequestCollectionEnvelope[JourneySegmentRequestSchema]"},"ReturnTrip":{"properties":{"start_time":{"type":"string","format":"date-time","title":"Start Time"},"stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stop Time"},"utcoffset":{"type":"integer","title":"Utcoffset"},"vehicle_class_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Class Id"},"vehicle_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Id"},"passenger":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passenger"},"passengers":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Passengers"}},"additionalProperties":false,"type":"object","required":["start_time","utcoffset"],"title":"ReturnTrip","description":"Request body for the POST return trip endpoint."},"ServerError":{"properties":{"type":{"type":"string","title":"Type","description":"A URI reference that identifies the problem type.","default":"about:blank"},"title":{"type":"string","title":"Title","description":"A human-readable summary of the problem type."},"status":{"type":"integer","maximum":599.0,"minimum":100.0,"title":"Status","description":"The HTTP status code."},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Instance","description":"A URI reference that identifies the specific occurrence of the problem."}},"type":"object","required":["title","status","detail"],"title":"ServerError","description":"Problem Detail report for a server side problem."},"SortOrder":{"type":"string","enum":["asc","desc"],"title":"SortOrder","description":"Sort direction of a list."},"SubscribeRequest":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"The user's email address"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"Invitation code"},"affiliate_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Affiliate Data","description":"Affiliate data e.g. campaign name"}},"type":"object","title":"SubscribeRequest","description":"Request body for the subscribe endpoint.","example":{"code":"1234","email":"someone@sustainable.example"}},"SubscriptionSchema-Input":{"properties":{"created_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created On","description":"Creation timestamp"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On","description":"Last update timestamp"},"license":{"$ref":"#/components/schemas/LicenseSchema-Input"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"mobility_budget":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Mobility Budget"},"type":{"$ref":"#/components/schemas/SubscriptionType"},"purchase_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purchase Id"},"feature_flags":{"items":{"$ref":"#/components/schemas/EffectiveFeatureResponse"},"type":"array","title":"Feature Flags","default":[]}},"additionalProperties":false,"type":"object","required":["license","type"],"title":"SubscriptionSchema","description":"Public schema for the Subscription database model."},"SubscriptionSchema-Output":{"properties":{"created_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created On","description":"Creation timestamp"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On","description":"Last update timestamp"},"license":{"$ref":"#/components/schemas/LicenseSchema-Output"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"expires_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expires On"},"mobility_budget":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobility Budget"},"type":{"$ref":"#/components/schemas/SubscriptionType"},"purchase_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purchase Id"},"feature_flags":{"items":{"$ref":"#/components/schemas/EffectiveFeatureResponse"},"type":"array","title":"Feature Flags","default":[]},"features":{"items":{"type":"string"},"type":"array","title":"Features","description":"Backward-compatible list of enabled feature names.","readOnly":true}},"additionalProperties":false,"type":"object","required":["license","type","features"],"title":"SubscriptionSchema","description":"Public schema for the Subscription database model."},"SubscriptionType":{"type":"string","enum":["internal","qonversion"],"title":"SubscriptionType","description":"Type of a subscription."},"TransactionNSBCExportColumn":{"type":"string","enum":["date","title","user","externalUserId","license","route","checkIn","checkOut","distance","amount","vat","objective","processed","productCode","travelClass","number","cardId","descr","note","upstreamClosed","expenseId","createdOn","updatedOn"],"title":"TransactionNSBCExportColumn","description":"Columns of the NSBC transaction CSV export, named like the dashboard's columns."},"TransactionNSBCSortField":{"type":"string","enum":["date","title","user","route","distance","amount","vat","objective","product_code","travel_class","created_on"],"title":"TransactionNSBCSortField","description":"Fields the NSBC transaction list can be sorted on."},"TripBase":{"properties":{"source":{"$ref":"#/components/schemas/TripSource","default":"manual"},"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stop Time"},"utcoffset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Utcoffset"},"passenger":{"type":"boolean","title":"Passenger","default":false},"passengers":{"type":"integer","minimum":1.0,"title":"Passengers","default":1},"shared_modality":{"type":"boolean","title":"Shared Modality","default":false},"transformed_modality":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transformed Modality"},"objective_id":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"vehicle_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Id"},"vehicle_class_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Class Id"},"start_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Location Name"},"stop_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stop Location Name"},"start_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"stop_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"distance":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Distance"},"duration":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin","deprecated":true},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination","deprecated":true},"project_code_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Project Code Id"},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"TripBase","description":"Base model for Trips model"},"TripCreate":{"properties":{"source":{"$ref":"#/components/schemas/TripSource","default":"manual"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stop Time"},"utcoffset":{"type":"integer","title":"Utcoffset"},"passenger":{"type":"boolean","title":"Passenger","default":false},"passengers":{"type":"integer","minimum":1.0,"title":"Passengers","default":1},"shared_modality":{"type":"boolean","title":"Shared Modality","default":false},"transformed_modality":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transformed Modality"},"objective_id":{"$ref":"#/components/schemas/TripObjective"},"vehicle_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Id"},"vehicle_class_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Vehicle Class Id"},"start_location_name":{"type":"string","title":"Start Location Name"},"stop_location_name":{"type":"string","title":"Stop Location Name"},"start_location":{"$ref":"#/components/schemas/Coordinate"},"stop_location":{"$ref":"#/components/schemas/Coordinate"},"distance":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Distance"},"duration":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin","deprecated":true},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination","deprecated":true},"project_code_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Project Code Id"},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"start_address_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Start Address Id"},"stop_address_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Stop Address Id"}},"additionalProperties":false,"type":"object","required":["start_time","utcoffset","objective_id","vehicle_class_id","start_location_name","stop_location_name","start_location","stop_location"],"title":"TripCreate","description":"Request body for the POST trip endpoint."},"TripObjective":{"type":"integer","enum":[1,2,3],"title":"TripObjective","description":"New style trip objectives with values that map onto the old integer type,\nwhich is still used in the database as well."},"TripReportRequest":{"properties":{"year":{"type":"integer","minimum":2000.0,"title":"Year"},"month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Month"}},"type":"object","required":["year","month"],"title":"TripReportRequest","description":"Request model for a trip report."},"TripSchema":{"properties":{"id":{"type":"integer","exclusiveMinimum":0.0,"title":"Id"},"modality_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Modality Id"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TripObjective"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/TripSource"},{"type":"null"}]},"passenger":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passenger"},"passengers":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Passengers"},"shared_modality":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared Modality"},"vehicle_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Vehicle Id"},"vehicle_class_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vehicle Class Id"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"local_start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Local Start Time"},"stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stop Time"},"local_stop_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Local Stop Time"},"start_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"stop_location":{"anyOf":[{"$ref":"#/components/schemas/Coordinate"},{"type":"null"}]},"start_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Location Name"},"stop_location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stop Location Name"},"preferred_distance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Preferred Distance"},"project_code":{"anyOf":[{"$ref":"#/components/schemas/ProjectCodeResponseSchema"},{"type":"null"}]},"expense":{"anyOf":[{"$ref":"#/components/schemas/ExpenseResponseSchema"},{"type":"null"}]},"co2_g_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Tailpipe"},"co2_g_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Upstream"},"encoded_polyline":{"type":"string","title":"Encoded Polyline","default":""},"expense_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Expense Id"},"start_address_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Start Address Id"},"stop_address_id":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Stop Address Id"}},"additionalProperties":false,"type":"object","required":["id"],"title":"TripSchema","description":"Public schema for the Trip database model."},"TripSortField":{"type":"string","enum":["start_time","stop_time","distance","duration","objective","upstream_co2","downstream_co2","passengers","created_on"],"title":"TripSortField","description":"Fields the trip list can be sorted on.\n\nModality and vehicle class are left out on purpose: their display names are\nlocalized, so sorting by ID would look random."},"TripSource":{"type":"string","enum":["manual","mobidot","startstop","wfo","geofenced","journey"],"title":"TripSource","description":"Source of a trip record."},"TripWFO":{"properties":{"office_address_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Office Address Id"},"utcoffset":{"type":"integer","title":"Utcoffset"},"modality_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Modality Id"},"country":{"type":"string","maxLength":2,"minLength":2,"title":"Country"}},"additionalProperties":false,"type":"object","required":["office_address_id","utcoffset","modality_id","country"],"title":"TripWFO","description":"Request body for the POST wfo endpoint."},"UpdateAddressSchema":{"properties":{"place_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place Name"},"type":{"anyOf":[{"$ref":"#/components/schemas/AddressType"},{"type":"null"}]}},"type":"object","title":"UpdateAddressSchema","description":"Request body for updating an address."},"UserAccountResponseSchema":{"properties":{"created_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created On","description":"Creation timestamp"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On","description":"Last update timestamp"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name"},"picture":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Picture","description":"Profile picture URL"},"language":{"type":"string","title":"Language","description":"The user's preferred language (RFC 5646)","default":"nl_NL"},"retention_period":{"anyOf":[{"type":"string","format":"duration"},{"type":"null"}],"title":"Retention Period","description":"Trip data retention period (interval)"},"id":{"type":"string","title":"Id"},"email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Id"},"mobidot_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mobidot User Id"}},"additionalProperties":false,"type":"object","required":["id"],"title":"UserAccountResponseSchema","description":"Read-only user account details, compatible with OIDC UserInfo."},"UserProfileRequestSchema":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name"},"picture":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Picture","description":"Profile picture URL"},"language":{"type":"string","title":"Language","description":"The user's preferred language (RFC 5646)","default":"nl_NL"},"retention_period":{"anyOf":[{"type":"string","format":"duration"},{"type":"null"}],"title":"Retention Period","description":"Trip data retention period (interval)"}},"additionalProperties":false,"type":"object","title":"UserProfileRequestSchema","description":"The editable parts of a user's profile, compatible with OIDC UserInfo."},"UserProfileResponseSchema":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name"},"picture":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Picture","description":"Profile picture URL"},"language":{"type":"string","title":"Language","description":"The user's preferred language (RFC 5646)","default":"nl_NL"},"retention_period":{"anyOf":[{"type":"string","format":"duration"},{"type":"null"}],"title":"Retention Period","description":"Trip data retention period (interval)"}},"additionalProperties":false,"type":"object","title":"UserProfileResponseSchema"},"UserProfileUpdateSchema":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"First name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Last name"},"picture":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Picture","description":"Profile picture URL"},"language":{"type":"string","title":"Language","description":"The user's preferred language (RFC 5646)"},"retention_period":{"anyOf":[{"type":"string","format":"duration"},{"type":"null"}],"title":"Retention Period","description":"Trip data retention period (interval)"}},"additionalProperties":false,"type":"object","title":"UserProfileUpdateSchema"},"ValidationError":{"properties":{"type":{"type":"string","title":"Type","default":"/errors/validation-problem"},"title":{"type":"string","title":"Title","description":"A human-readable summary of the problem type."},"status":{"type":"integer","title":"Status","default":422},"detail":{"type":"string","title":"Detail","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Instance","description":"A URI reference that identifies the specific occurrence of the problem."},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors"}},"type":"object","required":["title","detail","errors"],"title":"ValidationError","description":"Problem Detail extension describing FastAPI request validation errors.","example":{"detail":"1 validation error(s)","errors":[{"loc":["query","number"],"msg":"value is not a valid integer","type":"type_error.integer"}],"status":422,"title":"Unprocessable Entity","type":"/errors/validation-problem"}},"VehicleClassSchema":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"modality_id":{"type":"integer","title":"Modality Id"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"fuel_types":{"anyOf":[{"items":{"$ref":"#/components/schemas/FuelType"},"type":"array"},{"type":"null"}],"title":"Fuel Types"},"engine_class":{"anyOf":[{"$ref":"#/components/schemas/VehicleEngineClass"},{"type":"null"}]},"co2_g_km_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Tailpipe"},"co2_g_km_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Upstream"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"},"modality_group":{"type":"string","title":"Modality Group"},"modality_group_localized":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modality Group Localized"},"can_carpool":{"type":"boolean","title":"Can Carpool"},"is_shared_modality":{"type":"boolean","title":"Is Shared Modality"},"translate_fields__":{"items":{"type":"string"},"type":"array","uniqueItems":true,"title":"Translate Fields","default":["modality_group_localized"]}},"type":"object","required":["id","name","modality_id","modality_group","can_carpool","is_shared_modality"],"title":"VehicleClassSchema","description":"Public schema for the VehicleClass database model."},"VehicleEngineClass":{"type":"string","enum":["ice","electric","ovc-hev","novc-hev","ovc-fchv","novc-fchv"],"title":"VehicleEngineClass","description":"Types of (hybrid) vehicles engines."},"VehicleLookupResponseSchema":{"properties":{"modality_id":{"type":"integer","title":"Modality Id"},"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"name":{"type":"string","title":"Name","description":"The user's self chosen name for the vehicle"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"license_plate_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Plate Number"},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"co2_g_km_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Tailpipe"},"co2_g_km_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Upstream"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country","description":"The country the vehicle is registered in","default":"nl"},"vehicle_class":{"$ref":"#/components/schemas/VehicleClassSchema"}},"additionalProperties":false,"type":"object","required":["modality_id","vehicle_class_id","name","vehicle_class"],"title":"VehicleLookupResponseSchema","description":"Vehicle lookup resource response body."},"VehicleRequestSchema":{"properties":{"modality_id":{"type":"integer","title":"Modality Id"},"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"name":{"type":"string","title":"Name","description":"The user's self chosen name for the vehicle"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"license_plate_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Plate Number"},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"co2_g_km_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Tailpipe"},"co2_g_km_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Upstream"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country","description":"The country the vehicle is registered in","default":"nl"}},"additionalProperties":false,"type":"object","required":["modality_id","vehicle_class_id","name"],"title":"VehicleRequestSchema","description":"Vehicle resource request body."},"VehicleResponseSchema":{"properties":{"created_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created On","description":"Creation timestamp"},"updated_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated On","description":"Last update timestamp"},"modality_id":{"type":"integer","title":"Modality Id"},"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"name":{"type":"string","title":"Name","description":"The user's self chosen name for the vehicle"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"license_plate_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Plate Number"},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"co2_g_km_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Tailpipe"},"co2_g_km_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Upstream"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country","description":"The country the vehicle is registered in","default":"nl"},"id":{"type":"integer","title":"Id"},"modality":{"$ref":"#/components/schemas/ModalitySchema"},"vehicle_class":{"$ref":"#/components/schemas/VehicleClassSchema"}},"additionalProperties":false,"type":"object","required":["modality_id","vehicle_class_id","name","id","modality","vehicle_class"],"title":"VehicleResponseSchema","description":"Vehicle resource response body."},"VehicleUpdateSchema":{"properties":{"modality_id":{"type":"integer","title":"Modality Id"},"vehicle_class_id":{"type":"integer","title":"Vehicle Class Id"},"name":{"type":"string","title":"Name","description":"The user's self chosen name for the vehicle"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"license_plate_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Plate Number"},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype"},"co2_g_km_tailpipe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Tailpipe"},"co2_g_km_upstream":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Co2 G Km Upstream"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country","description":"The country the vehicle is registered in"}},"additionalProperties":false,"type":"object","title":"VehicleUpdateSchema"},"WpmReportType":{"type":"string","enum":["survey","regular"],"title":"WpmReportType","description":"The kind of WPM report bundle, each filled from its own Excel template."}},"securitySchemes":{"OpenIdConnect":{"type":"openIdConnect","openIdConnectUrl":"https://accounts.google.com/.well-known/openid-configuration"}}},"tags":[{"name":"auth","description":"Operations related to authentication."},{"name":"modalities","description":"Operations related to modalities."},{"name":"user","description":"Operations acting on data of a single user."},{"name":"app","description":"Operations specifically for the mobile apps."},{"name":"admin","description":"Admin operations for the dashboard (requires admin permissions)."},{"name":"debug","description":"Operations related to debugging and error handling."}]}