@faable/auth-sdk 2.7.104 → 2.7.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/spec/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "@faablecloud/auth",
5
5
  "description": "Auth Platform made by Faable. Manage Users and Roles",
6
- "version": "2.77.0",
6
+ "version": "2.78.1",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -347,6 +347,61 @@
347
347
  "additionalProperties": false,
348
348
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
349
349
  },
350
+ "profile_fields": {
351
+ "type": "array",
352
+ "items": {
353
+ "type": "object",
354
+ "required": [
355
+ "key",
356
+ "type"
357
+ ],
358
+ "properties": {
359
+ "key": {
360
+ "type": "string",
361
+ "pattern": "^[a-z0-9_]{1,40}$",
362
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
363
+ },
364
+ "type": {
365
+ "anyOf": [
366
+ {
367
+ "type": "string",
368
+ "enum": [
369
+ "string"
370
+ ]
371
+ },
372
+ {
373
+ "type": "string",
374
+ "enum": [
375
+ "enum"
376
+ ]
377
+ }
378
+ ],
379
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
380
+ },
381
+ "options": {
382
+ "type": "array",
383
+ "items": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "maxLength": 200
387
+ },
388
+ "minItems": 1,
389
+ "maxItems": 100,
390
+ "description": "The accepted values when `type` is `enum`."
391
+ },
392
+ "max_length": {
393
+ "type": "integer",
394
+ "minimum": 1,
395
+ "maximum": 1000,
396
+ "description": "Longest accepted value for a `string` field. Default 200."
397
+ }
398
+ },
399
+ "additionalProperties": false
400
+ },
401
+ "maxItems": 20,
402
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
403
+ "nullable": true
404
+ },
350
405
  "login_flow": {
351
406
  "type": "string",
352
407
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -1685,6 +1740,61 @@
1685
1740
  "additionalProperties": false,
1686
1741
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
1687
1742
  },
1743
+ "profile_fields": {
1744
+ "type": "array",
1745
+ "items": {
1746
+ "type": "object",
1747
+ "required": [
1748
+ "key",
1749
+ "type"
1750
+ ],
1751
+ "properties": {
1752
+ "key": {
1753
+ "type": "string",
1754
+ "pattern": "^[a-z0-9_]{1,40}$",
1755
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
1756
+ },
1757
+ "type": {
1758
+ "anyOf": [
1759
+ {
1760
+ "type": "string",
1761
+ "enum": [
1762
+ "string"
1763
+ ]
1764
+ },
1765
+ {
1766
+ "type": "string",
1767
+ "enum": [
1768
+ "enum"
1769
+ ]
1770
+ }
1771
+ ],
1772
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
1773
+ },
1774
+ "options": {
1775
+ "type": "array",
1776
+ "items": {
1777
+ "type": "string",
1778
+ "minLength": 1,
1779
+ "maxLength": 200
1780
+ },
1781
+ "minItems": 1,
1782
+ "maxItems": 100,
1783
+ "description": "The accepted values when `type` is `enum`."
1784
+ },
1785
+ "max_length": {
1786
+ "type": "integer",
1787
+ "minimum": 1,
1788
+ "maximum": 1000,
1789
+ "description": "Longest accepted value for a `string` field. Default 200."
1790
+ }
1791
+ },
1792
+ "additionalProperties": false
1793
+ },
1794
+ "maxItems": 20,
1795
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
1796
+ "nullable": true
1797
+ },
1688
1798
  "mfa_policy": {
1689
1799
  "type": "object",
1690
1800
  "properties": {
@@ -2463,6 +2573,61 @@
2463
2573
  }
2464
2574
  ]
2465
2575
  },
2576
+ "profile_fields": {
2577
+ "type": "array",
2578
+ "items": {
2579
+ "type": "object",
2580
+ "required": [
2581
+ "key",
2582
+ "type"
2583
+ ],
2584
+ "properties": {
2585
+ "key": {
2586
+ "type": "string",
2587
+ "pattern": "^[a-z0-9_]{1,40}$",
2588
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
2589
+ },
2590
+ "type": {
2591
+ "anyOf": [
2592
+ {
2593
+ "type": "string",
2594
+ "enum": [
2595
+ "string"
2596
+ ]
2597
+ },
2598
+ {
2599
+ "type": "string",
2600
+ "enum": [
2601
+ "enum"
2602
+ ]
2603
+ }
2604
+ ],
2605
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
2606
+ },
2607
+ "options": {
2608
+ "type": "array",
2609
+ "items": {
2610
+ "type": "string",
2611
+ "minLength": 1,
2612
+ "maxLength": 200
2613
+ },
2614
+ "minItems": 1,
2615
+ "maxItems": 100,
2616
+ "description": "The accepted values when `type` is `enum`."
2617
+ },
2618
+ "max_length": {
2619
+ "type": "integer",
2620
+ "minimum": 1,
2621
+ "maximum": 1000,
2622
+ "description": "Longest accepted value for a `string` field. Default 200."
2623
+ }
2624
+ },
2625
+ "additionalProperties": false
2626
+ },
2627
+ "maxItems": 20,
2628
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
2629
+ "nullable": true
2630
+ },
2466
2631
  "mfa_policy": {
2467
2632
  "anyOf": [
2468
2633
  {
@@ -6869,9 +7034,15 @@
6869
7034
  "enum": [
6870
7035
  "user"
6871
7036
  ]
7037
+ },
7038
+ {
7039
+ "type": "string",
7040
+ "enum": [
7041
+ "password_change"
7042
+ ]
6872
7043
  }
6873
7044
  ],
6874
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
7045
+ "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device. `password_change`: the user set or changed their password, which ends every other session."
6875
7046
  },
6876
7047
  "account": {
6877
7048
  "type": "string",
@@ -7696,6 +7867,61 @@
7696
7867
  }
7697
7868
  ]
7698
7869
  },
7870
+ "profile_fields": {
7871
+ "type": "array",
7872
+ "items": {
7873
+ "type": "object",
7874
+ "required": [
7875
+ "key",
7876
+ "type"
7877
+ ],
7878
+ "properties": {
7879
+ "key": {
7880
+ "type": "string",
7881
+ "pattern": "^[a-z0-9_]{1,40}$",
7882
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
7883
+ },
7884
+ "type": {
7885
+ "anyOf": [
7886
+ {
7887
+ "type": "string",
7888
+ "enum": [
7889
+ "string"
7890
+ ]
7891
+ },
7892
+ {
7893
+ "type": "string",
7894
+ "enum": [
7895
+ "enum"
7896
+ ]
7897
+ }
7898
+ ],
7899
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
7900
+ },
7901
+ "options": {
7902
+ "type": "array",
7903
+ "items": {
7904
+ "type": "string",
7905
+ "minLength": 1,
7906
+ "maxLength": 200
7907
+ },
7908
+ "minItems": 1,
7909
+ "maxItems": 100,
7910
+ "description": "The accepted values when `type` is `enum`."
7911
+ },
7912
+ "max_length": {
7913
+ "type": "integer",
7914
+ "minimum": 1,
7915
+ "maximum": 1000,
7916
+ "description": "Longest accepted value for a `string` field. Default 200."
7917
+ }
7918
+ },
7919
+ "additionalProperties": false
7920
+ },
7921
+ "maxItems": 20,
7922
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
7923
+ "nullable": true
7924
+ },
7699
7925
  "mfa_policy": {
7700
7926
  "anyOf": [
7701
7927
  {
@@ -8243,7 +8469,7 @@
8243
8469
  },
8244
8470
  "ErrorCode": {
8245
8471
  "type": "string",
8246
- "description": "Machine-readable error code. One HTTP status per code.\n\n- `bad_request` (400): The request is malformed. `message` says what is wrong.\n- `validation_error` (400): The body, query or path failed schema validation. `details.issues` lists each failing field.\n- `unauthorized` (401): The request carries no valid credentials.\n- `payment_required` (402): The feature is not included in the current plan.\n- `forbidden` (403): The credentials are valid but do not allow this operation.\n- `not_found` (404): The resource does not exist in this account.\n- `method_not_allowed` (405): The HTTP method is not supported on this path.\n- `conflict` (409): The request conflicts with the current state of the resource.\n- `payload_too_large` (413): The request body exceeds the size limit.\n- `unsupported_media_type` (415): The `Content-Type` is not accepted by this endpoint.\n- `unprocessable_entity` (422): The request is well-formed but cannot be processed.\n- `too_many_requests` (429): Rate limit exceeded. Honour the `Retry-After` header.\n- `internal_error` (500): Unexpected server error. Retry later; the request id is logged.\n- `already_exists` (400): A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.\n- `invalid_id` (400): The id in the path is not a valid id for this resource.\n- `account_not_found` (404): No Auth Account matches the request (domain, header or token).\n- `invalid_query` (400): The `?query=` FaableQL expression could not be parsed.\n- `search_not_supported` (400): This resource does not support `?search=`.\n- `invalid_expand` (400): An `?expand=` path is not allowed on this resource.\n- `access_denied` (401): The caller may not access this row (ownership or machine-to-machine restriction).\n- `insufficient_scope` (403): The token lacks a scope this operation requires. `message` names it.\n- `team_required` (400): An Auth Account must belong to a project (team).\n- `account_limit_reached` (409): The project already has the maximum number of Auth Accounts.\n- `invalid_project_id` (400): The project id is not of the form `project_<hex>` or `team_<hex>`.\n- `account_transfer_refused` (409): The Auth Account cannot be moved to that project. `details.blockers` lists why.\n- `email_sender_domain_not_allowed` (400): The sender address is not in a domain this platform signs email for (AUTH_EMAIL_SENDER_DOMAINS).\n- `plan_required` (402): The setting requires a higher plan. `message` says which.\n- `invalid_canonical_host` (400): `canonical_host` must be this account's own platform host or one of its verified custom domains.\n- `canonical_host_breaks_passkeys` (400): `canonical_host` is outside the account's current WebAuthn RP ID — every passkey already enrolled would stop working. Set `webauthn_rp_id` in the same request to a suffix that covers both.\n- `not_logged_in` (401): There is no signed-in session for this request.\n- `session_already_revoked` (409): The session was already revoked.\n- `invalid_token` (401): The bearer token is missing, malformed, expired or has no subject.\n- `not_owner` (403): The caller may only perform this operation on their own user.\n- `user_suspended` (403): The user is suspended and cannot sign in or be modified.\n- `invalid_credentials` (400): The email/username or password is incorrect.\n- `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.\n- `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n- `client_credentials_denied` (401): An Action denied the client_credentials grant. `message` carries the reason.\n- `m2m_quota_exceeded` (402): The project used the machine-to-machine tokens its plan includes this month. Free is capped; Hobby and Pro are billed per token instead.\n- `signup_disabled` (403): Self-service sign-up is disabled on this connection.\n- `email_taken` (409): Another user in this account already uses that email.\n- `username_taken` (409): Another user of this database connection already uses that username.\n- `invalid_username` (400): The username is empty, or contains an `@` or whitespace. `message` says which.\n- `invalid_email` (400): The email address is not valid.\n- `invalid_name` (400): The name contains a link. `message` says which field.\n- `same_email` (400): The new email is the same as the current one.\n- `user_has_no_email` (400): The operation needs an email but the user has none.\n- `password_too_weak` (400): The password does not meet the connection policy. `message` lists each unmet rule.\n- `invalid_password_hash` (400): The imported password hash cannot be read, or its cost is above what a login can afford. `message` names the field.\n- `weak_password_hash` (400): The imported password hash uses a fast digest (MD5, SHA-1, SHA-2) or a cost below the minimum. `message` says which.\n- `invalid_code` (400): The verification code is wrong, expired or already used.\n- `invalid_phone` (400): The phone number is not E.164 and could not be resolved with the account default country. Include the country code.\n- `phone_changed` (400): The phone on the user changed after the code was sent. Start again.\n- `phone_already_verified` (409): The user already has a verified phone; the number cannot be swapped from the screen.\n- `sms_unavailable` (409): This account cannot send SMS right now. The suffix says why: `sms_unavailable:plan`, `:quota`, `:provider`.\n- `sms_failed` (409): The SMS provider rejected the message.\n- `invalid_state` (400): The `state` is missing, expired, or does not describe a resumable step.\n- `state_mismatch` (401): The `state` belongs to another account, session, client or ceremony.\n- `invalid_ticket` (400): The ticket does not exist or is not the kind this endpoint accepts.\n- `ticket_used` (400): The ticket was already consumed.\n- `ticket_expired` (400): The ticket is past its expiry.\n- `ticket_not_found` (404): No ticket with that id belongs to this user.\n- `credential_not_found` (404): The user has no password credential on this connection.\n- `invalid_link` (400): The magic link is malformed.\n- `expired_link` (400): The magic link token was not found or has expired.\n- `invalid_otp` (401): The one-time password is wrong or expired.\n- `invalid_client` (400): The `client_id` in the request does not name a client of this account.\n- `client_not_found` (404): No client with that `client_id`.\n- `client_mismatch` (401): The client belongs to a different account.\n- `invalid_client_metadata` (400): Dynamic client registration rejected a field (RFC 7591). `message` names it.\n- `invalid_connection` (400): The connection does not exist, is disabled, or is not of the type this flow needs.\n- `no_database_connection` (400): The tenant has no database connection, so there is nowhere to store a password. Create one and retry.\n- `connection_required` (400): No connection was given and the client has no `default_connection`.\n- `connection_misconfigured` (400): The connection is missing settings needed to talk to its provider.\n- `passwordless_unavailable` (400): No passwordless connection is configured or enabled for this client.\n- `ambiguous_connection` (400): Several connections match; pass `connection_id`.\n- `invalid_redirect_uri` (400): The redirect URI is not registered for the client.\n- `invalid_saml_request` (400): The SAMLRequest is missing, too large, not well-formed or not a SAML 2.0 AuthnRequest.\n- `saml_sp_mismatch` (400): The AuthnRequest does not match the client's SAML configuration: its Issuer is not the configured entity_id, or it asks for another Assertion Consumer Service URL or binding.\n- `saml_not_enabled` (404): This client does not have SAML enabled.\n- `invalid_saml_sp` (400): The `saml_sp` configuration is invalid: `acs_url` must be an absolute https URL without a fragment.\n- `origin_not_allowed` (403): The request `Origin` is not in the client's Allowed Web Origins.\n- `audience_not_found` (403): The `audience` does not name an API registered in this account.\n- `system_resource` (403): The resource is managed by Faable and cannot be modified or deleted.\n- `invalid_request` (400): A required OAuth parameter is missing or two of them are incompatible. `message` says which.\n- `invalid_device_code` (400): The device or user code is invalid or expired.\n- `provider_error` (400): The upstream identity provider returned an error. The suffix is the provider’s own code, when it sent one: `provider_error:bad_refresh_token` (the user must re-authorize), `provider_error:incorrect_client_credentials` (our configuration, the user can do nothing). `details.provider_error_description` carries the provider’s sentence.\n- `identity_already_linked` (409): That external identity is already linked to another user.\n- `identity_link_denied` (409): That external identity cannot be linked to this user.\n- `identity_conflict` (409): The user already has a linked identity for this connection.\n- `identity_orphaned` (400): The identity pointed at a user that no longer exists; it was removed. Sign in again.\n- `no_provider_token` (400): The identity holds no provider access token.\n- `no_refresh_token` (400): The identity holds no provider refresh token, so it cannot be refreshed.\n- `action_unavailable` (401): The Action that paused this login is disabled or belongs elsewhere.\n- `login_flow_misconfigured` (500): The login flow of this account cannot run. `message` carries the node error.\n- `mfa_required` (403): The login needs a second factor that this flow cannot collect, or one is still pending on the session.\n- `step_up_required` (403): Confirm an existing factor before changing your factors.\n- `interaction_required` (403): An Action asked for a redirect on a non-interactive flow.\n- `passkey_login_disabled` (400): Sign in with a passkey is not enabled for this client.\n- `mfa_pending` (401): A second-factor challenge is pending; answer it before continuing.\n- `mfa_invalid_code` (401): The authenticator code did not verify.\n- `mfa_invalid_recovery_code` (401): The recovery code did not verify.\n- `too_many_attempts` (429): Too many wrong codes. Wait a few minutes and try again.\n- `too_many_login_attempts` (429): Too many failed sign-in attempts for this email or username from this network. Wait a few minutes and try again.\n- `totp_not_allowed` (401): This account does not accept authenticator apps.\n- `no_usable_factor` (400): The user has no confirmed second factor to challenge.\n- `factor_not_found` (400): No factor with that id belongs to this user.\n- `factor_already_confirmed` (400): The factor was already confirmed.\n- `invalid_factor` (400): The factor cannot be verified (no secret material).\n- `session_missing` (401): The session that started this login no longer exists.\n- `passkey_verification_failed` (400): The WebAuthn response could not be verified.\n- `no_passkey_enrolled` (400): The user has no passkey to sign in with.\n- `malformed_credential` (400): The WebAuthn credential is malformed.\n- `unknown_passkey` (401): The passkey is not enrolled for this user.\n- `invalid_passkey` (401): The passkey assertion did not verify.\n- `invalid_invite_url` (400): An invite's `accept_url` or `redirect_uri` is not an http(s) URL at an origin of this tenant's client callbacks or `callback_hostnames`, or it carries a fragment.\n- `invite_email_mismatch` (403): The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.\n- `invite_email_unverified` (403): The accepting user's email matches the invite but is not verified yet.\n- `invite_not_found` (404): No invite with that id in this account.\n- `invite_used` (400): The invite was already accepted.\n- `already_member` (400): The user is already a member of the team.\n- `not_a_member` (404): The user is not a member of the team.\n- `consent_options_unavailable` (502): The consent screen could not load the choices from the API being authorized (its `consent_options.url`). Try again in a moment.\n- `consent_choice_invalid` (400): The choice sent with the consent decision is not one the API offered for this user.\n- `registration_disabled` (403): Dynamic client registration is turned off for this tenant. Create the client from the dashboard or the Management API, or turn on `dynamic_client_registration_enabled`.\n- `invalid_email_domain` (400): Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.\n- `public_email_domain` (400): A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.\n- `organization_domain_not_found` (404): The organization has no such domain.\n- `organization_domain_taken` (409): Another organization of this tenant already verified this domain. A domain belongs to one organization.\n- `organization_domain_unverified` (400): The TXT record was not found or does not hold the expected value yet. `details.record` says what was expected and what resolves now; DNS can take a few minutes to propagate.\n- `plan_unavailable` (503): The plan could not be checked right now, and this setting is only for paid plans. Try again in a minute.\n- `organization_domain_mismatch` (403): This organization's identity provider can only sign in addresses of the organization's verified email domains.\n- `team_not_in_organization` (400): Auto-join can only put people in teams of the same organization. `details.teams` lists the others.\n- `organization_has_no_idp` (400): Requiring SSO needs an identity provider: bind an `oidc` connection to the organization first.\n- `organization_not_found` (404): No organization with that id in this account.\n- `invalid_user` (400): The user does not exist in this account.\n- `not_an_organization_admin` (404): The user is not an admin of the organization.\n- `last_organization_admin` (409): An organization keeps at least one admin. Add another admin before removing this one.\n- `team_id_unavailable` (409): The team id cannot be used in this tenant. Pick another id or let the API generate one.\n- `use_team_member_route` (400): This generic route cannot create memberships. Use `POST /team/{team_id}/member` for team members or `POST /role/{role_id}/users` for role grants.\n- `role_not_found` (404): No role with that id in this account.\n- `invalid_role` (400): The role belongs to another account.\n- `flow_not_found` (400): The login flow does not exist in this account.\n- `revision_not_found` (404): The revision is not in the flow history.\n- `invalid_webhook_event` (400): An event is not in the webhook event catalog. `message` and `details.valid_events` list the valid ones.\n- `invalid_webhook_url` (400): The webhook URL must be an absolute `https` URL.\n- `not_a_webhook` (400): The operation only applies to `webhook` subscriptions.\n- `delivery_not_found` (404): No webhook delivery with that id for this subscription.\n- `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.",
8472
+ "description": "Machine-readable error code. One HTTP status per code.\n\n- `bad_request` (400): The request is malformed. `message` says what is wrong.\n- `validation_error` (400): The body, query or path failed schema validation. `details.issues` lists each failing field.\n- `unauthorized` (401): The request carries no valid credentials.\n- `payment_required` (402): The feature is not included in the current plan.\n- `forbidden` (403): The credentials are valid but do not allow this operation.\n- `not_found` (404): The resource does not exist in this account.\n- `method_not_allowed` (405): The HTTP method is not supported on this path.\n- `conflict` (409): The request conflicts with the current state of the resource.\n- `payload_too_large` (413): The request body exceeds the size limit.\n- `unsupported_media_type` (415): The `Content-Type` is not accepted by this endpoint.\n- `unprocessable_entity` (422): The request is well-formed but cannot be processed.\n- `too_many_requests` (429): Rate limit exceeded. Honour the `Retry-After` header.\n- `internal_error` (500): Unexpected server error. Retry later; the request id is logged.\n- `already_exists` (400): A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.\n- `invalid_id` (400): The id in the path is not a valid id for this resource.\n- `account_not_found` (404): No Auth Account matches the request (domain, header or token).\n- `invalid_query` (400): The `?query=` FaableQL expression could not be parsed.\n- `search_not_supported` (400): This resource does not support `?search=`.\n- `invalid_expand` (400): An `?expand=` path is not allowed on this resource.\n- `access_denied` (401): The caller may not access this row (ownership or machine-to-machine restriction).\n- `insufficient_scope` (403): The token lacks a scope this operation requires. `message` names it.\n- `team_required` (400): An Auth Account must belong to a project (team).\n- `account_limit_reached` (409): The project already has the maximum number of Auth Accounts.\n- `invalid_project_id` (400): The project id is not of the form `project_<hex>` or `team_<hex>`.\n- `account_transfer_refused` (409): The Auth Account cannot be moved to that project. `details.blockers` lists why.\n- `email_sender_domain_not_allowed` (400): The sender address is not in a domain this platform signs email for (AUTH_EMAIL_SENDER_DOMAINS).\n- `plan_required` (402): The setting requires a higher plan. `message` says which.\n- `invalid_canonical_host` (400): `canonical_host` must be this account's own platform host or one of its verified custom domains.\n- `canonical_host_breaks_passkeys` (400): `canonical_host` is outside the account's current WebAuthn RP ID — every passkey already enrolled would stop working. Set `webauthn_rp_id` in the same request to a suffix that covers both.\n- `not_logged_in` (401): There is no signed-in session for this request.\n- `session_already_revoked` (409): The session was already revoked.\n- `invalid_token` (401): The bearer token is missing, malformed, expired or has no subject.\n- `not_owner` (403): The caller may only perform this operation on their own user.\n- `user_suspended` (403): The user is suspended and cannot sign in or be modified.\n- `invalid_credentials` (400): The email/username or password is incorrect.\n- `login_denied` (401): A post-login Action denied the sign-in. `message` carries the reason it gave. On token grants it is a 403 with `error: invalid_grant`.\n- `signup_denied` (403): A pre-signup Action or an active block denied the sign-up. `message` carries the reason.\n- `client_credentials_denied` (401): An Action denied the client_credentials grant. `message` carries the reason.\n- `m2m_quota_exceeded` (402): The project used the machine-to-machine tokens its plan includes this month. Free is capped; Hobby and Pro are billed per token instead.\n- `signup_disabled` (403): Self-service sign-up is disabled on this connection.\n- `email_taken` (409): Another user in this account already uses that email.\n- `username_taken` (409): Another user of this database connection already uses that username.\n- `invalid_username` (400): The username is empty, or contains an `@` or whitespace. `message` says which.\n- `invalid_email` (400): The email address is not valid.\n- `invalid_name` (400): The name contains a link. `message` says which field.\n- `same_email` (400): The new email is the same as the current one.\n- `user_has_no_email` (400): The operation needs an email but the user has none.\n- `password_too_weak` (400): The password does not meet the connection policy. `message` lists each unmet rule.\n- `invalid_password_hash` (400): The imported password hash cannot be read, or its cost is above what a login can afford. `message` names the field.\n- `weak_password_hash` (400): The imported password hash uses a fast digest (MD5, SHA-1, SHA-2) or a cost below the minimum. `message` says which.\n- `invalid_code` (400): The verification code is wrong, expired or already used.\n- `invalid_phone` (400): The phone number is not E.164 and could not be resolved with the account default country. Include the country code.\n- `phone_changed` (400): The phone on the user changed after the code was sent. Start again.\n- `phone_already_verified` (409): The user already has a verified phone; the number cannot be swapped from the screen.\n- `sms_unavailable` (409): This account cannot send SMS right now. The suffix says why: `sms_unavailable:plan`, `:quota`, `:provider`.\n- `sms_failed` (409): The SMS provider rejected the message.\n- `invalid_state` (400): The `state` is missing, expired, or does not describe a resumable step.\n- `state_mismatch` (401): The `state` belongs to another account, session, client or ceremony.\n- `invalid_ticket` (400): The ticket does not exist or is not the kind this endpoint accepts.\n- `ticket_used` (400): The ticket was already consumed.\n- `ticket_expired` (400): The ticket is past its expiry.\n- `ticket_not_found` (404): No ticket with that id belongs to this user.\n- `credential_not_found` (404): The user has no password credential on this connection.\n- `invalid_link` (400): The magic link is malformed.\n- `expired_link` (400): The magic link token was not found or has expired.\n- `invalid_otp` (401): The one-time password is wrong or expired.\n- `invalid_client` (400): The `client_id` in the request does not name a client of this account.\n- `client_not_found` (404): No client with that `client_id`.\n- `client_mismatch` (401): The client belongs to a different account.\n- `invalid_client_metadata` (400): Dynamic client registration rejected a field (RFC 7591). `message` names it.\n- `invalid_connection` (400): The connection does not exist, is disabled, or is not of the type this flow needs.\n- `no_database_connection` (400): The tenant has no database connection, so there is nowhere to store a password. Create one and retry.\n- `connection_required` (400): No connection was given and the client has no `default_connection`.\n- `connection_misconfigured` (400): The connection is missing settings needed to talk to its provider.\n- `passwordless_unavailable` (400): No passwordless connection is configured or enabled for this client.\n- `ambiguous_connection` (400): Several connections match; pass `connection_id`.\n- `invalid_redirect_uri` (400): The redirect URI is not registered for the client.\n- `invalid_saml_request` (400): The SAMLRequest is missing, too large, not well-formed or not a SAML 2.0 AuthnRequest.\n- `saml_sp_mismatch` (400): The AuthnRequest does not match the client's SAML configuration: its Issuer is not the configured entity_id, or it asks for another Assertion Consumer Service URL or binding.\n- `saml_not_enabled` (404): This client does not have SAML enabled.\n- `invalid_saml_sp` (400): The `saml_sp` configuration is invalid: `acs_url` must be an absolute https URL without a fragment.\n- `origin_not_allowed` (403): The request `Origin` is not in the client's Allowed Web Origins.\n- `audience_not_found` (403): The `audience` does not name an API registered in this account.\n- `system_resource` (403): The resource is managed by Faable and cannot be modified or deleted.\n- `invalid_request` (400): A required OAuth parameter is missing or two of them are incompatible. `message` says which.\n- `invalid_device_code` (400): The device or user code is invalid or expired.\n- `provider_error` (400): The upstream identity provider returned an error. The suffix is the provider’s own code, when it sent one: `provider_error:bad_refresh_token` (the user must re-authorize), `provider_error:incorrect_client_credentials` (our configuration, the user can do nothing). `details.provider_error_description` carries the provider’s sentence.\n- `identity_already_linked` (409): That external identity is already linked to another user.\n- `identity_link_denied` (409): That external identity cannot be linked to this user.\n- `identity_conflict` (409): The user already has a linked identity for this connection.\n- `identity_orphaned` (400): The identity pointed at a user that no longer exists; it was removed. Sign in again.\n- `no_provider_token` (400): The identity holds no provider access token.\n- `no_refresh_token` (400): The identity holds no provider refresh token, so it cannot be refreshed.\n- `action_unavailable` (401): The Action that paused this login is disabled or belongs elsewhere.\n- `login_flow_misconfigured` (500): The login flow of this account cannot run. `message` carries the node error.\n- `mfa_required` (403): The login needs a second factor that this flow cannot collect, or one is still pending on the session.\n- `step_up_required` (403): Confirm an existing factor before changing your factors.\n- `reauth_required` (403): The operation needs a recent sign-in (and the second factor, when the user has one). Sign in again with `max_age=0` and retry with the new token.\n- `invalid_current_password` (400): The current password is wrong.\n- `email_not_verified` (403): The user's email is not verified, and the operation needs it to be.\n- `invalid_profile_field` (400): A profile field is not declared for this application, or its value does not match the declaration. `message` names the key.\n- `interaction_required` (403): An Action asked for a redirect on a non-interactive flow.\n- `passkey_login_disabled` (400): Sign in with a passkey is not enabled for this client.\n- `mfa_pending` (401): A second-factor challenge is pending; answer it before continuing.\n- `mfa_invalid_code` (401): The authenticator code did not verify.\n- `mfa_invalid_recovery_code` (401): The recovery code did not verify.\n- `too_many_attempts` (429): Too many wrong codes. Wait a few minutes and try again.\n- `too_many_login_attempts` (429): Too many failed sign-in attempts for this email or username from this network. Wait a few minutes and try again.\n- `totp_not_allowed` (401): This account does not accept authenticator apps.\n- `no_usable_factor` (400): The user has no confirmed second factor to challenge.\n- `factor_not_found` (400): No factor with that id belongs to this user.\n- `factor_already_confirmed` (400): The factor was already confirmed.\n- `invalid_factor` (400): The factor cannot be verified (no secret material).\n- `session_missing` (401): The session that started this login no longer exists.\n- `passkey_verification_failed` (400): The WebAuthn response could not be verified.\n- `no_passkey_enrolled` (400): The user has no passkey to sign in with.\n- `malformed_credential` (400): The WebAuthn credential is malformed.\n- `unknown_passkey` (401): The passkey is not enrolled for this user.\n- `invalid_passkey` (401): The passkey assertion did not verify.\n- `invalid_invite_url` (400): An invite's `accept_url` or `redirect_uri` is not an http(s) URL at an origin of this tenant's client callbacks or `callback_hostnames`, or it carries a fragment.\n- `invite_email_mismatch` (403): The invite is for another email address than the accepting user's. `details.invited_email` shows it masked.\n- `invite_email_unverified` (403): The accepting user's email matches the invite but is not verified yet.\n- `invite_not_found` (404): No invite with that id in this account.\n- `invite_used` (400): The invite was already accepted.\n- `already_member` (400): The user is already a member of the team.\n- `not_a_member` (404): The user is not a member of the team.\n- `consent_options_unavailable` (502): The consent screen could not load the choices from the API being authorized (its `consent_options.url`). Try again in a moment.\n- `consent_choice_invalid` (400): The choice sent with the consent decision is not one the API offered for this user.\n- `registration_disabled` (403): Dynamic client registration is turned off for this tenant. Create the client from the dashboard or the Management API, or turn on `dynamic_client_registration_enabled`.\n- `invalid_email_domain` (400): Not an email domain this organization can claim: it must be a plain domain name (`acme.com`), lowercase, without scheme, path or wildcard.\n- `public_email_domain` (400): A public email provider (gmail.com, outlook.com…) cannot belong to an organization: anyone can have an address there.\n- `organization_domain_not_found` (404): The organization has no such domain.\n- `organization_domain_taken` (409): Another organization of this tenant already verified this domain. A domain belongs to one organization.\n- `organization_domain_unverified` (400): The TXT record was not found or does not hold the expected value yet. `details.record` says what was expected and what resolves now; DNS can take a few minutes to propagate.\n- `plan_unavailable` (503): The plan could not be checked right now, and this setting is only for paid plans. Try again in a minute.\n- `organization_domain_mismatch` (403): This organization's identity provider can only sign in addresses of the organization's verified email domains.\n- `team_not_in_organization` (400): Auto-join can only put people in teams of the same organization. `details.teams` lists the others.\n- `organization_has_no_idp` (400): Requiring SSO needs an identity provider: bind an `oidc` connection to the organization first.\n- `organization_not_found` (404): No organization with that id in this account.\n- `invalid_user` (400): The user does not exist in this account.\n- `not_an_organization_admin` (404): The user is not an admin of the organization.\n- `last_organization_admin` (409): An organization keeps at least one admin. Add another admin before removing this one.\n- `team_id_unavailable` (409): The team id cannot be used in this tenant. Pick another id or let the API generate one.\n- `use_team_member_route` (400): This generic route cannot create memberships. Use `POST /team/{team_id}/member` for team members or `POST /role/{role_id}/users` for role grants.\n- `role_not_found` (404): No role with that id in this account.\n- `invalid_role` (400): The role belongs to another account.\n- `flow_not_found` (400): The login flow does not exist in this account.\n- `revision_not_found` (404): The revision is not in the flow history.\n- `invalid_webhook_event` (400): An event is not in the webhook event catalog. `message` and `details.valid_events` list the valid ones.\n- `invalid_webhook_url` (400): The webhook URL must be an absolute `https` URL.\n- `not_a_webhook` (400): The operation only applies to `webhook` subscriptions.\n- `delivery_not_found` (404): No webhook delivery with that id for this subscription.\n- `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.",
8247
8473
  "enum": [
8248
8474
  "bad_request",
8249
8475
  "validation_error",
@@ -8342,6 +8568,10 @@
8342
8568
  "login_flow_misconfigured",
8343
8569
  "mfa_required",
8344
8570
  "step_up_required",
8571
+ "reauth_required",
8572
+ "invalid_current_password",
8573
+ "email_not_verified",
8574
+ "invalid_profile_field",
8345
8575
  "interaction_required",
8346
8576
  "passkey_login_disabled",
8347
8577
  "mfa_pending",
@@ -8861,6 +9091,61 @@
8861
9091
  "additionalProperties": false,
8862
9092
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
8863
9093
  },
9094
+ "profile_fields": {
9095
+ "type": "array",
9096
+ "items": {
9097
+ "type": "object",
9098
+ "required": [
9099
+ "key",
9100
+ "type"
9101
+ ],
9102
+ "properties": {
9103
+ "key": {
9104
+ "type": "string",
9105
+ "pattern": "^[a-z0-9_]{1,40}$",
9106
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
9107
+ },
9108
+ "type": {
9109
+ "anyOf": [
9110
+ {
9111
+ "type": "string",
9112
+ "enum": [
9113
+ "string"
9114
+ ]
9115
+ },
9116
+ {
9117
+ "type": "string",
9118
+ "enum": [
9119
+ "enum"
9120
+ ]
9121
+ }
9122
+ ],
9123
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
9124
+ },
9125
+ "options": {
9126
+ "type": "array",
9127
+ "items": {
9128
+ "type": "string",
9129
+ "minLength": 1,
9130
+ "maxLength": 200
9131
+ },
9132
+ "minItems": 1,
9133
+ "maxItems": 100,
9134
+ "description": "The accepted values when `type` is `enum`."
9135
+ },
9136
+ "max_length": {
9137
+ "type": "integer",
9138
+ "minimum": 1,
9139
+ "maximum": 1000,
9140
+ "description": "Longest accepted value for a `string` field. Default 200."
9141
+ }
9142
+ },
9143
+ "additionalProperties": false
9144
+ },
9145
+ "maxItems": 20,
9146
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
9147
+ "nullable": true
9148
+ },
8864
9149
  "login_flow": {
8865
9150
  "type": "string",
8866
9151
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -9613,6 +9898,61 @@
9613
9898
  "additionalProperties": false,
9614
9899
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
9615
9900
  },
9901
+ "profile_fields": {
9902
+ "type": "array",
9903
+ "items": {
9904
+ "type": "object",
9905
+ "required": [
9906
+ "key",
9907
+ "type"
9908
+ ],
9909
+ "properties": {
9910
+ "key": {
9911
+ "type": "string",
9912
+ "pattern": "^[a-z0-9_]{1,40}$",
9913
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
9914
+ },
9915
+ "type": {
9916
+ "anyOf": [
9917
+ {
9918
+ "type": "string",
9919
+ "enum": [
9920
+ "string"
9921
+ ]
9922
+ },
9923
+ {
9924
+ "type": "string",
9925
+ "enum": [
9926
+ "enum"
9927
+ ]
9928
+ }
9929
+ ],
9930
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
9931
+ },
9932
+ "options": {
9933
+ "type": "array",
9934
+ "items": {
9935
+ "type": "string",
9936
+ "minLength": 1,
9937
+ "maxLength": 200
9938
+ },
9939
+ "minItems": 1,
9940
+ "maxItems": 100,
9941
+ "description": "The accepted values when `type` is `enum`."
9942
+ },
9943
+ "max_length": {
9944
+ "type": "integer",
9945
+ "minimum": 1,
9946
+ "maximum": 1000,
9947
+ "description": "Longest accepted value for a `string` field. Default 200."
9948
+ }
9949
+ },
9950
+ "additionalProperties": false
9951
+ },
9952
+ "maxItems": 20,
9953
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
9954
+ "nullable": true
9955
+ },
9616
9956
  "login_flow": {
9617
9957
  "type": "string",
9618
9958
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -10602,6 +10942,61 @@
10602
10942
  "additionalProperties": false,
10603
10943
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
10604
10944
  },
10945
+ "profile_fields": {
10946
+ "type": "array",
10947
+ "items": {
10948
+ "type": "object",
10949
+ "required": [
10950
+ "key",
10951
+ "type"
10952
+ ],
10953
+ "properties": {
10954
+ "key": {
10955
+ "type": "string",
10956
+ "pattern": "^[a-z0-9_]{1,40}$",
10957
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
10958
+ },
10959
+ "type": {
10960
+ "anyOf": [
10961
+ {
10962
+ "type": "string",
10963
+ "enum": [
10964
+ "string"
10965
+ ]
10966
+ },
10967
+ {
10968
+ "type": "string",
10969
+ "enum": [
10970
+ "enum"
10971
+ ]
10972
+ }
10973
+ ],
10974
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
10975
+ },
10976
+ "options": {
10977
+ "type": "array",
10978
+ "items": {
10979
+ "type": "string",
10980
+ "minLength": 1,
10981
+ "maxLength": 200
10982
+ },
10983
+ "minItems": 1,
10984
+ "maxItems": 100,
10985
+ "description": "The accepted values when `type` is `enum`."
10986
+ },
10987
+ "max_length": {
10988
+ "type": "integer",
10989
+ "minimum": 1,
10990
+ "maximum": 1000,
10991
+ "description": "Longest accepted value for a `string` field. Default 200."
10992
+ }
10993
+ },
10994
+ "additionalProperties": false
10995
+ },
10996
+ "maxItems": 20,
10997
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
10998
+ "nullable": true
10999
+ },
10605
11000
  "login_flow": {
10606
11001
  "type": "string",
10607
11002
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -11216,6 +11611,61 @@
11216
11611
  }
11217
11612
  ]
11218
11613
  },
11614
+ "profile_fields": {
11615
+ "type": "array",
11616
+ "items": {
11617
+ "type": "object",
11618
+ "required": [
11619
+ "key",
11620
+ "type"
11621
+ ],
11622
+ "properties": {
11623
+ "key": {
11624
+ "type": "string",
11625
+ "pattern": "^[a-z0-9_]{1,40}$",
11626
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
11627
+ },
11628
+ "type": {
11629
+ "anyOf": [
11630
+ {
11631
+ "type": "string",
11632
+ "enum": [
11633
+ "string"
11634
+ ]
11635
+ },
11636
+ {
11637
+ "type": "string",
11638
+ "enum": [
11639
+ "enum"
11640
+ ]
11641
+ }
11642
+ ],
11643
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
11644
+ },
11645
+ "options": {
11646
+ "type": "array",
11647
+ "items": {
11648
+ "type": "string",
11649
+ "minLength": 1,
11650
+ "maxLength": 200
11651
+ },
11652
+ "minItems": 1,
11653
+ "maxItems": 100,
11654
+ "description": "The accepted values when `type` is `enum`."
11655
+ },
11656
+ "max_length": {
11657
+ "type": "integer",
11658
+ "minimum": 1,
11659
+ "maximum": 1000,
11660
+ "description": "Longest accepted value for a `string` field. Default 200."
11661
+ }
11662
+ },
11663
+ "additionalProperties": false
11664
+ },
11665
+ "maxItems": 20,
11666
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
11667
+ "nullable": true
11668
+ },
11219
11669
  "mfa_policy": {
11220
11670
  "anyOf": [
11221
11671
  {
@@ -11775,6 +12225,61 @@
11775
12225
  "additionalProperties": false,
11776
12226
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
11777
12227
  },
12228
+ "profile_fields": {
12229
+ "type": "array",
12230
+ "items": {
12231
+ "type": "object",
12232
+ "required": [
12233
+ "key",
12234
+ "type"
12235
+ ],
12236
+ "properties": {
12237
+ "key": {
12238
+ "type": "string",
12239
+ "pattern": "^[a-z0-9_]{1,40}$",
12240
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
12241
+ },
12242
+ "type": {
12243
+ "anyOf": [
12244
+ {
12245
+ "type": "string",
12246
+ "enum": [
12247
+ "string"
12248
+ ]
12249
+ },
12250
+ {
12251
+ "type": "string",
12252
+ "enum": [
12253
+ "enum"
12254
+ ]
12255
+ }
12256
+ ],
12257
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
12258
+ },
12259
+ "options": {
12260
+ "type": "array",
12261
+ "items": {
12262
+ "type": "string",
12263
+ "minLength": 1,
12264
+ "maxLength": 200
12265
+ },
12266
+ "minItems": 1,
12267
+ "maxItems": 100,
12268
+ "description": "The accepted values when `type` is `enum`."
12269
+ },
12270
+ "max_length": {
12271
+ "type": "integer",
12272
+ "minimum": 1,
12273
+ "maximum": 1000,
12274
+ "description": "Longest accepted value for a `string` field. Default 200."
12275
+ }
12276
+ },
12277
+ "additionalProperties": false
12278
+ },
12279
+ "maxItems": 20,
12280
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
12281
+ "nullable": true
12282
+ },
11778
12283
  "login_flow": {
11779
12284
  "type": "string",
11780
12285
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -14981,6 +15486,61 @@
14981
15486
  "additionalProperties": false,
14982
15487
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
14983
15488
  },
15489
+ "profile_fields": {
15490
+ "type": "array",
15491
+ "items": {
15492
+ "type": "object",
15493
+ "required": [
15494
+ "key",
15495
+ "type"
15496
+ ],
15497
+ "properties": {
15498
+ "key": {
15499
+ "type": "string",
15500
+ "pattern": "^[a-z0-9_]{1,40}$",
15501
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
15502
+ },
15503
+ "type": {
15504
+ "anyOf": [
15505
+ {
15506
+ "type": "string",
15507
+ "enum": [
15508
+ "string"
15509
+ ]
15510
+ },
15511
+ {
15512
+ "type": "string",
15513
+ "enum": [
15514
+ "enum"
15515
+ ]
15516
+ }
15517
+ ],
15518
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
15519
+ },
15520
+ "options": {
15521
+ "type": "array",
15522
+ "items": {
15523
+ "type": "string",
15524
+ "minLength": 1,
15525
+ "maxLength": 200
15526
+ },
15527
+ "minItems": 1,
15528
+ "maxItems": 100,
15529
+ "description": "The accepted values when `type` is `enum`."
15530
+ },
15531
+ "max_length": {
15532
+ "type": "integer",
15533
+ "minimum": 1,
15534
+ "maximum": 1000,
15535
+ "description": "Longest accepted value for a `string` field. Default 200."
15536
+ }
15537
+ },
15538
+ "additionalProperties": false
15539
+ },
15540
+ "maxItems": 20,
15541
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
15542
+ "nullable": true
15543
+ },
14984
15544
  "login_flow": {
14985
15545
  "type": "string",
14986
15546
  "description": "The login flow bound to this account (`loginflow_xxx`). Absent = the flow compiled from the settings. A Client may bind its own.",
@@ -19172,6 +19732,61 @@
19172
19732
  "additionalProperties": false,
19173
19733
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
19174
19734
  },
19735
+ "profile_fields": {
19736
+ "type": "array",
19737
+ "items": {
19738
+ "type": "object",
19739
+ "required": [
19740
+ "key",
19741
+ "type"
19742
+ ],
19743
+ "properties": {
19744
+ "key": {
19745
+ "type": "string",
19746
+ "pattern": "^[a-z0-9_]{1,40}$",
19747
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
19748
+ },
19749
+ "type": {
19750
+ "anyOf": [
19751
+ {
19752
+ "type": "string",
19753
+ "enum": [
19754
+ "string"
19755
+ ]
19756
+ },
19757
+ {
19758
+ "type": "string",
19759
+ "enum": [
19760
+ "enum"
19761
+ ]
19762
+ }
19763
+ ],
19764
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
19765
+ },
19766
+ "options": {
19767
+ "type": "array",
19768
+ "items": {
19769
+ "type": "string",
19770
+ "minLength": 1,
19771
+ "maxLength": 200
19772
+ },
19773
+ "minItems": 1,
19774
+ "maxItems": 100,
19775
+ "description": "The accepted values when `type` is `enum`."
19776
+ },
19777
+ "max_length": {
19778
+ "type": "integer",
19779
+ "minimum": 1,
19780
+ "maximum": 1000,
19781
+ "description": "Longest accepted value for a `string` field. Default 200."
19782
+ }
19783
+ },
19784
+ "additionalProperties": false
19785
+ },
19786
+ "maxItems": 20,
19787
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
19788
+ "nullable": true
19789
+ },
19175
19790
  "mfa_policy": {
19176
19791
  "type": "object",
19177
19792
  "properties": {
@@ -19927,6 +20542,61 @@
19927
20542
  "additionalProperties": false,
19928
20543
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
19929
20544
  },
20545
+ "profile_fields": {
20546
+ "type": "array",
20547
+ "items": {
20548
+ "type": "object",
20549
+ "required": [
20550
+ "key",
20551
+ "type"
20552
+ ],
20553
+ "properties": {
20554
+ "key": {
20555
+ "type": "string",
20556
+ "pattern": "^[a-z0-9_]{1,40}$",
20557
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
20558
+ },
20559
+ "type": {
20560
+ "anyOf": [
20561
+ {
20562
+ "type": "string",
20563
+ "enum": [
20564
+ "string"
20565
+ ]
20566
+ },
20567
+ {
20568
+ "type": "string",
20569
+ "enum": [
20570
+ "enum"
20571
+ ]
20572
+ }
20573
+ ],
20574
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
20575
+ },
20576
+ "options": {
20577
+ "type": "array",
20578
+ "items": {
20579
+ "type": "string",
20580
+ "minLength": 1,
20581
+ "maxLength": 200
20582
+ },
20583
+ "minItems": 1,
20584
+ "maxItems": 100,
20585
+ "description": "The accepted values when `type` is `enum`."
20586
+ },
20587
+ "max_length": {
20588
+ "type": "integer",
20589
+ "minimum": 1,
20590
+ "maximum": 1000,
20591
+ "description": "Longest accepted value for a `string` field. Default 200."
20592
+ }
20593
+ },
20594
+ "additionalProperties": false
20595
+ },
20596
+ "maxItems": 20,
20597
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
20598
+ "nullable": true
20599
+ },
19930
20600
  "mfa_policy": {
19931
20601
  "type": "object",
19932
20602
  "properties": {
@@ -20701,6 +21371,61 @@
20701
21371
  }
20702
21372
  ]
20703
21373
  },
21374
+ "profile_fields": {
21375
+ "type": "array",
21376
+ "items": {
21377
+ "type": "object",
21378
+ "required": [
21379
+ "key",
21380
+ "type"
21381
+ ],
21382
+ "properties": {
21383
+ "key": {
21384
+ "type": "string",
21385
+ "pattern": "^[a-z0-9_]{1,40}$",
21386
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
21387
+ },
21388
+ "type": {
21389
+ "anyOf": [
21390
+ {
21391
+ "type": "string",
21392
+ "enum": [
21393
+ "string"
21394
+ ]
21395
+ },
21396
+ {
21397
+ "type": "string",
21398
+ "enum": [
21399
+ "enum"
21400
+ ]
21401
+ }
21402
+ ],
21403
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
21404
+ },
21405
+ "options": {
21406
+ "type": "array",
21407
+ "items": {
21408
+ "type": "string",
21409
+ "minLength": 1,
21410
+ "maxLength": 200
21411
+ },
21412
+ "minItems": 1,
21413
+ "maxItems": 100,
21414
+ "description": "The accepted values when `type` is `enum`."
21415
+ },
21416
+ "max_length": {
21417
+ "type": "integer",
21418
+ "minimum": 1,
21419
+ "maximum": 1000,
21420
+ "description": "Longest accepted value for a `string` field. Default 200."
21421
+ }
21422
+ },
21423
+ "additionalProperties": false
21424
+ },
21425
+ "maxItems": 20,
21426
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
21427
+ "nullable": true
21428
+ },
20704
21429
  "mfa_policy": {
20705
21430
  "anyOf": [
20706
21431
  {
@@ -21301,6 +22026,61 @@
21301
22026
  "additionalProperties": false,
21302
22027
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
21303
22028
  },
22029
+ "profile_fields": {
22030
+ "type": "array",
22031
+ "items": {
22032
+ "type": "object",
22033
+ "required": [
22034
+ "key",
22035
+ "type"
22036
+ ],
22037
+ "properties": {
22038
+ "key": {
22039
+ "type": "string",
22040
+ "pattern": "^[a-z0-9_]{1,40}$",
22041
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
22042
+ },
22043
+ "type": {
22044
+ "anyOf": [
22045
+ {
22046
+ "type": "string",
22047
+ "enum": [
22048
+ "string"
22049
+ ]
22050
+ },
22051
+ {
22052
+ "type": "string",
22053
+ "enum": [
22054
+ "enum"
22055
+ ]
22056
+ }
22057
+ ],
22058
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
22059
+ },
22060
+ "options": {
22061
+ "type": "array",
22062
+ "items": {
22063
+ "type": "string",
22064
+ "minLength": 1,
22065
+ "maxLength": 200
22066
+ },
22067
+ "minItems": 1,
22068
+ "maxItems": 100,
22069
+ "description": "The accepted values when `type` is `enum`."
22070
+ },
22071
+ "max_length": {
22072
+ "type": "integer",
22073
+ "minimum": 1,
22074
+ "maximum": 1000,
22075
+ "description": "Longest accepted value for a `string` field. Default 200."
22076
+ }
22077
+ },
22078
+ "additionalProperties": false
22079
+ },
22080
+ "maxItems": 20,
22081
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
22082
+ "nullable": true
22083
+ },
21304
22084
  "mfa_policy": {
21305
22085
  "type": "object",
21306
22086
  "properties": {
@@ -22056,6 +22836,61 @@
22056
22836
  "additionalProperties": false,
22057
22837
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
22058
22838
  },
22839
+ "profile_fields": {
22840
+ "type": "array",
22841
+ "items": {
22842
+ "type": "object",
22843
+ "required": [
22844
+ "key",
22845
+ "type"
22846
+ ],
22847
+ "properties": {
22848
+ "key": {
22849
+ "type": "string",
22850
+ "pattern": "^[a-z0-9_]{1,40}$",
22851
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
22852
+ },
22853
+ "type": {
22854
+ "anyOf": [
22855
+ {
22856
+ "type": "string",
22857
+ "enum": [
22858
+ "string"
22859
+ ]
22860
+ },
22861
+ {
22862
+ "type": "string",
22863
+ "enum": [
22864
+ "enum"
22865
+ ]
22866
+ }
22867
+ ],
22868
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
22869
+ },
22870
+ "options": {
22871
+ "type": "array",
22872
+ "items": {
22873
+ "type": "string",
22874
+ "minLength": 1,
22875
+ "maxLength": 200
22876
+ },
22877
+ "minItems": 1,
22878
+ "maxItems": 100,
22879
+ "description": "The accepted values when `type` is `enum`."
22880
+ },
22881
+ "max_length": {
22882
+ "type": "integer",
22883
+ "minimum": 1,
22884
+ "maximum": 1000,
22885
+ "description": "Longest accepted value for a `string` field. Default 200."
22886
+ }
22887
+ },
22888
+ "additionalProperties": false
22889
+ },
22890
+ "maxItems": 20,
22891
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
22892
+ "nullable": true
22893
+ },
22059
22894
  "mfa_policy": {
22060
22895
  "type": "object",
22061
22896
  "properties": {
@@ -22812,6 +23647,61 @@
22812
23647
  "additionalProperties": false,
22813
23648
  "description": "Which login methods the hosted login screen offers and in what order. Set on the Account as the tenant default; the same object on a Client overrides it **field by field**, so a client can flip one flag without restating the rest. Absent everywhere = built-in defaults."
22814
23649
  },
23650
+ "profile_fields": {
23651
+ "type": "array",
23652
+ "items": {
23653
+ "type": "object",
23654
+ "required": [
23655
+ "key",
23656
+ "type"
23657
+ ],
23658
+ "properties": {
23659
+ "key": {
23660
+ "type": "string",
23661
+ "pattern": "^[a-z0-9_]{1,40}$",
23662
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
23663
+ },
23664
+ "type": {
23665
+ "anyOf": [
23666
+ {
23667
+ "type": "string",
23668
+ "enum": [
23669
+ "string"
23670
+ ]
23671
+ },
23672
+ {
23673
+ "type": "string",
23674
+ "enum": [
23675
+ "enum"
23676
+ ]
23677
+ }
23678
+ ],
23679
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
23680
+ },
23681
+ "options": {
23682
+ "type": "array",
23683
+ "items": {
23684
+ "type": "string",
23685
+ "minLength": 1,
23686
+ "maxLength": 200
23687
+ },
23688
+ "minItems": 1,
23689
+ "maxItems": 100,
23690
+ "description": "The accepted values when `type` is `enum`."
23691
+ },
23692
+ "max_length": {
23693
+ "type": "integer",
23694
+ "minimum": 1,
23695
+ "maximum": 1000,
23696
+ "description": "Longest accepted value for a `string` field. Default 200."
23697
+ }
23698
+ },
23699
+ "additionalProperties": false
23700
+ },
23701
+ "maxItems": 20,
23702
+ "description": "Profile fields the user may write on themselves with `PATCH /me` (`fields`), stored in `user_metadata[\"faable.com/fields\"]`. On a Client it replaces the account's list entirely; absent = inherit.",
23703
+ "nullable": true
23704
+ },
22815
23705
  "mfa_policy": {
22816
23706
  "type": "object",
22817
23707
  "properties": {
@@ -60700,9 +61590,15 @@
60700
61590
  "enum": [
60701
61591
  "user"
60702
61592
  ]
61593
+ },
61594
+ {
61595
+ "type": "string",
61596
+ "enum": [
61597
+ "password_change"
61598
+ ]
60703
61599
  }
60704
61600
  ],
60705
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
61601
+ "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device. `password_change`: the user set or changed their password, which ends every other session."
60706
61602
  },
60707
61603
  "account": {
60708
61604
  "type": "string",
@@ -61035,9 +61931,15 @@
61035
61931
  "enum": [
61036
61932
  "user"
61037
61933
  ]
61934
+ },
61935
+ {
61936
+ "type": "string",
61937
+ "enum": [
61938
+ "password_change"
61939
+ ]
61038
61940
  }
61039
61941
  ],
61040
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
61942
+ "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device. `password_change`: the user set or changed their password, which ends every other session."
61041
61943
  },
61042
61944
  "account": {
61043
61945
  "type": "string",
@@ -67500,6 +68402,31 @@
67500
68402
  }
67501
68403
  }
67502
68404
  },
68405
+ "403": {
68406
+ "description": "`forbidden` — The credentials are valid but do not allow this operation.",
68407
+ "content": {
68408
+ "application/json": {
68409
+ "schema": {
68410
+ "allOf": [
68411
+ {
68412
+ "$ref": "#/components/schemas/ErrorResponse"
68413
+ },
68414
+ {
68415
+ "type": "object",
68416
+ "properties": {
68417
+ "error_code": {
68418
+ "type": "string",
68419
+ "enum": [
68420
+ "forbidden"
68421
+ ]
68422
+ }
68423
+ }
68424
+ }
68425
+ ]
68426
+ }
68427
+ }
68428
+ }
68429
+ },
67503
68430
  "404": {
67504
68431
  "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
67505
68432
  "content": {
@@ -67583,7 +68510,7 @@
67583
68510
  "tags": [
67584
68511
  "session"
67585
68512
  ],
67586
- "description": "Updates the profile of the User behind the current session or bearer token. Only `name`, `company_name` and `country_iso` can be changed; `company_name` is merged into `user_metadata` without touching its other keys. A Bearer token must belong to this Account.",
68513
+ "description": "Updates the profile of the User behind the current session or bearer token. Only `name`, `company_name`, `country_iso` and the custom `fields` the application declares (`profile_fields`) can be changed; `company_name` and `fields` are merged into `user_metadata` without touching its other keys. A Bearer token must belong to this Account.",
67587
68514
  "requestBody": {
67588
68515
  "required": true,
67589
68516
  "content": {
@@ -67603,14 +68530,39 @@
67603
68530
  "country_iso": {
67604
68531
  "type": "string",
67605
68532
  "maxLength": 3
68533
+ },
68534
+ "fields": {
68535
+ "type": "array",
68536
+ "items": {
68537
+ "type": "object",
68538
+ "required": [
68539
+ "key",
68540
+ "value"
68541
+ ],
68542
+ "properties": {
68543
+ "key": {
68544
+ "type": "string",
68545
+ "minLength": 1,
68546
+ "maxLength": 40
68547
+ },
68548
+ "value": {
68549
+ "type": "string",
68550
+ "maxLength": 1000,
68551
+ "nullable": true
68552
+ }
68553
+ },
68554
+ "additionalProperties": false
68555
+ },
68556
+ "maxItems": 20,
68557
+ "description": "Custom profile fields, stored in `user_metadata[\"faable.com/fields\"]` and merged by key: keys not named here are kept, `null` removes one. Only the keys the application declares in `profile_fields` (Client, else Account) are accepted; any other key fails the whole request with `invalid_profile_field`."
67606
68558
  }
67607
68559
  },
67608
68560
  "additionalProperties": false,
67609
- "description": "Profile fields the current User may edit on themselves. `company_name` is stored in `user_metadata`, merged with whatever else is there."
68561
+ "description": "Profile fields the current User may edit on themselves. `company_name` and `fields` are stored in `user_metadata`, merged with whatever else is there."
67610
68562
  }
67611
68563
  }
67612
68564
  },
67613
- "description": "Profile fields the current User may edit on themselves. `company_name` is stored in `user_metadata`, merged with whatever else is there."
68565
+ "description": "Profile fields the current User may edit on themselves. `company_name` and `fields` are stored in `user_metadata`, merged with whatever else is there."
67614
68566
  },
67615
68567
  "responses": {
67616
68568
  "200": {
@@ -68005,7 +68957,7 @@
68005
68957
  }
68006
68958
  },
68007
68959
  "400": {
68008
- "description": "`bad_request` — The request is malformed. `message` says what is wrong.\n\n`validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.",
68960
+ "description": "`bad_request` — The request is malformed. `message` says what is wrong.\n\n`invalid_profile_field` — A profile field is not declared for this application, or its value does not match the declaration. `message` names the key.\n\n`validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.",
68009
68961
  "content": {
68010
68962
  "application/json": {
68011
68963
  "schema": {
@@ -68020,6 +68972,7 @@
68020
68972
  "type": "string",
68021
68973
  "enum": [
68022
68974
  "bad_request",
68975
+ "invalid_profile_field",
68023
68976
  "validation_error"
68024
68977
  ]
68025
68978
  }
@@ -68576,6 +69529,429 @@
68576
69529
  }
68577
69530
  }
68578
69531
  },
69532
+ "/me/credentials": {
69533
+ "get": {
69534
+ "operationId": "session/me_credentials",
69535
+ "summary": "How the current User signs in",
69536
+ "tags": [
69537
+ "session"
69538
+ ],
69539
+ "description": "Whether the User behind the session or bearer token has a password, and which connections they are linked to. A Bearer token must belong to this Account and be a user token.",
69540
+ "responses": {
69541
+ "200": {
69542
+ "description": "Default Response",
69543
+ "content": {
69544
+ "application/json": {
69545
+ "schema": {
69546
+ "type": "object",
69547
+ "required": [
69548
+ "has_password",
69549
+ "connections"
69550
+ ],
69551
+ "properties": {
69552
+ "has_password": {
69553
+ "type": "boolean",
69554
+ "description": "Whether the user can sign in with a password: they have a `database` credential with a password set."
69555
+ },
69556
+ "connections": {
69557
+ "type": "array",
69558
+ "items": {
69559
+ "type": "object",
69560
+ "required": [
69561
+ "id",
69562
+ "name",
69563
+ "type"
69564
+ ],
69565
+ "properties": {
69566
+ "id": {
69567
+ "type": "string",
69568
+ "description": "The Connection id (`connection_xxx`)."
69569
+ },
69570
+ "name": {
69571
+ "type": "string",
69572
+ "description": "The Connection name."
69573
+ },
69574
+ "type": {
69575
+ "type": "string",
69576
+ "description": "The Connection type: `database`, `google`, `github`, …"
69577
+ }
69578
+ },
69579
+ "additionalProperties": false
69580
+ },
69581
+ "description": "Every connection the user is linked to: the database one when they have a password, and each social or enterprise identity. Never the provider tokens or profile."
69582
+ }
69583
+ }
69584
+ }
69585
+ }
69586
+ }
69587
+ },
69588
+ "401": {
69589
+ "description": "`mfa_pending` — A second-factor challenge is pending; answer it before continuing.\n\n`not_logged_in` — There is no signed-in session for this request.",
69590
+ "content": {
69591
+ "application/json": {
69592
+ "schema": {
69593
+ "allOf": [
69594
+ {
69595
+ "$ref": "#/components/schemas/ErrorResponse"
69596
+ },
69597
+ {
69598
+ "type": "object",
69599
+ "properties": {
69600
+ "error_code": {
69601
+ "type": "string",
69602
+ "enum": [
69603
+ "mfa_pending",
69604
+ "not_logged_in"
69605
+ ]
69606
+ }
69607
+ }
69608
+ }
69609
+ ]
69610
+ }
69611
+ }
69612
+ }
69613
+ },
69614
+ "403": {
69615
+ "description": "`forbidden` — The credentials are valid but do not allow this operation.",
69616
+ "content": {
69617
+ "application/json": {
69618
+ "schema": {
69619
+ "allOf": [
69620
+ {
69621
+ "$ref": "#/components/schemas/ErrorResponse"
69622
+ },
69623
+ {
69624
+ "type": "object",
69625
+ "properties": {
69626
+ "error_code": {
69627
+ "type": "string",
69628
+ "enum": [
69629
+ "forbidden"
69630
+ ]
69631
+ }
69632
+ }
69633
+ }
69634
+ ]
69635
+ }
69636
+ }
69637
+ }
69638
+ },
69639
+ "404": {
69640
+ "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
69641
+ "content": {
69642
+ "application/json": {
69643
+ "schema": {
69644
+ "allOf": [
69645
+ {
69646
+ "$ref": "#/components/schemas/ErrorResponse"
69647
+ },
69648
+ {
69649
+ "type": "object",
69650
+ "properties": {
69651
+ "error_code": {
69652
+ "type": "string",
69653
+ "enum": [
69654
+ "account_not_found"
69655
+ ]
69656
+ }
69657
+ }
69658
+ }
69659
+ ]
69660
+ }
69661
+ }
69662
+ }
69663
+ },
69664
+ "429": {
69665
+ "description": "`too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header.",
69666
+ "content": {
69667
+ "application/json": {
69668
+ "schema": {
69669
+ "allOf": [
69670
+ {
69671
+ "$ref": "#/components/schemas/ErrorResponse"
69672
+ },
69673
+ {
69674
+ "type": "object",
69675
+ "properties": {
69676
+ "error_code": {
69677
+ "type": "string",
69678
+ "enum": [
69679
+ "too_many_requests"
69680
+ ]
69681
+ }
69682
+ }
69683
+ }
69684
+ ]
69685
+ }
69686
+ }
69687
+ }
69688
+ },
69689
+ "500": {
69690
+ "description": "`internal_error` — Unexpected server error. Retry later; the request id is logged.",
69691
+ "content": {
69692
+ "application/json": {
69693
+ "schema": {
69694
+ "allOf": [
69695
+ {
69696
+ "$ref": "#/components/schemas/ErrorResponse"
69697
+ },
69698
+ {
69699
+ "type": "object",
69700
+ "properties": {
69701
+ "error_code": {
69702
+ "type": "string",
69703
+ "enum": [
69704
+ "internal_error"
69705
+ ]
69706
+ }
69707
+ }
69708
+ }
69709
+ ]
69710
+ }
69711
+ }
69712
+ }
69713
+ }
69714
+ }
69715
+ }
69716
+ },
69717
+ "/me/password": {
69718
+ "post": {
69719
+ "operationId": "session/me_password",
69720
+ "summary": "Set or change the current User password",
69721
+ "tags": [
69722
+ "session"
69723
+ ],
69724
+ "description": "Sets the password of the User behind the session or bearer token, creating their `database` credential if they have none (e.g. they signed up with Google). Changing an existing password needs `current_password`. Setting the first one needs a verified email and a recent sign-in: `auth_time` within 5 minutes and, when the User has a second factor, a sign-in that completed it (`acr` = `urn:faable:loa:2`); otherwise `reauth_required`, and the app signs in again with `max_age=0`. The connection's password policy applies. Every other session of the User is revoked, and the User gets a security email. A Bearer token must belong to this Account and be a user token.",
69725
+ "requestBody": {
69726
+ "required": true,
69727
+ "content": {
69728
+ "application/json": {
69729
+ "schema": {
69730
+ "type": "object",
69731
+ "required": [
69732
+ "password"
69733
+ ],
69734
+ "properties": {
69735
+ "password": {
69736
+ "type": "string",
69737
+ "minLength": 1,
69738
+ "maxLength": 512
69739
+ },
69740
+ "current_password": {
69741
+ "type": "string",
69742
+ "maxLength": 512
69743
+ }
69744
+ },
69745
+ "additionalProperties": false
69746
+ }
69747
+ }
69748
+ }
69749
+ },
69750
+ "responses": {
69751
+ "200": {
69752
+ "description": "Default Response",
69753
+ "content": {
69754
+ "application/json": {
69755
+ "schema": {
69756
+ "type": "object",
69757
+ "required": [
69758
+ "revoked_sessions"
69759
+ ],
69760
+ "properties": {
69761
+ "revoked_sessions": {
69762
+ "type": "number",
69763
+ "description": "How many other sessions of the user were ended."
69764
+ }
69765
+ }
69766
+ }
69767
+ }
69768
+ }
69769
+ },
69770
+ "400": {
69771
+ "description": "`invalid_current_password` — The current password is wrong.\n\n`password_too_weak` — The password does not meet the connection policy. `message` lists each unmet rule.\n\n`no_database_connection` — The tenant has no database connection, so there is nowhere to store a password. Create one and retry.\n\n`validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.",
69772
+ "content": {
69773
+ "application/json": {
69774
+ "schema": {
69775
+ "allOf": [
69776
+ {
69777
+ "$ref": "#/components/schemas/ErrorResponse"
69778
+ },
69779
+ {
69780
+ "type": "object",
69781
+ "properties": {
69782
+ "error_code": {
69783
+ "type": "string",
69784
+ "enum": [
69785
+ "invalid_current_password",
69786
+ "password_too_weak",
69787
+ "no_database_connection",
69788
+ "validation_error"
69789
+ ]
69790
+ }
69791
+ }
69792
+ }
69793
+ ]
69794
+ }
69795
+ }
69796
+ }
69797
+ },
69798
+ "401": {
69799
+ "description": "`mfa_pending` — A second-factor challenge is pending; answer it before continuing.\n\n`not_logged_in` — There is no signed-in session for this request.",
69800
+ "content": {
69801
+ "application/json": {
69802
+ "schema": {
69803
+ "allOf": [
69804
+ {
69805
+ "$ref": "#/components/schemas/ErrorResponse"
69806
+ },
69807
+ {
69808
+ "type": "object",
69809
+ "properties": {
69810
+ "error_code": {
69811
+ "type": "string",
69812
+ "enum": [
69813
+ "mfa_pending",
69814
+ "not_logged_in"
69815
+ ]
69816
+ }
69817
+ }
69818
+ }
69819
+ ]
69820
+ }
69821
+ }
69822
+ }
69823
+ },
69824
+ "403": {
69825
+ "description": "`forbidden` — The credentials are valid but do not allow this operation.\n\n`reauth_required` — The operation needs a recent sign-in (and the second factor, when the user has one). Sign in again with `max_age=0` and retry with the new token.\n\n`email_not_verified` — The user's email is not verified, and the operation needs it to be.",
69826
+ "content": {
69827
+ "application/json": {
69828
+ "schema": {
69829
+ "allOf": [
69830
+ {
69831
+ "$ref": "#/components/schemas/ErrorResponse"
69832
+ },
69833
+ {
69834
+ "type": "object",
69835
+ "properties": {
69836
+ "error_code": {
69837
+ "type": "string",
69838
+ "enum": [
69839
+ "forbidden",
69840
+ "reauth_required",
69841
+ "email_not_verified"
69842
+ ]
69843
+ }
69844
+ }
69845
+ }
69846
+ ]
69847
+ }
69848
+ }
69849
+ }
69850
+ },
69851
+ "404": {
69852
+ "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
69853
+ "content": {
69854
+ "application/json": {
69855
+ "schema": {
69856
+ "allOf": [
69857
+ {
69858
+ "$ref": "#/components/schemas/ErrorResponse"
69859
+ },
69860
+ {
69861
+ "type": "object",
69862
+ "properties": {
69863
+ "error_code": {
69864
+ "type": "string",
69865
+ "enum": [
69866
+ "account_not_found"
69867
+ ]
69868
+ }
69869
+ }
69870
+ }
69871
+ ]
69872
+ }
69873
+ }
69874
+ }
69875
+ },
69876
+ "409": {
69877
+ "description": "`conflict` — The request conflicts with the current state of the resource.",
69878
+ "content": {
69879
+ "application/json": {
69880
+ "schema": {
69881
+ "allOf": [
69882
+ {
69883
+ "$ref": "#/components/schemas/ErrorResponse"
69884
+ },
69885
+ {
69886
+ "type": "object",
69887
+ "properties": {
69888
+ "error_code": {
69889
+ "type": "string",
69890
+ "enum": [
69891
+ "conflict"
69892
+ ]
69893
+ }
69894
+ }
69895
+ }
69896
+ ]
69897
+ }
69898
+ }
69899
+ }
69900
+ },
69901
+ "429": {
69902
+ "description": "`too_many_login_attempts` — Too many failed sign-in attempts for this email or username from this network. Wait a few minutes and try again.\n\n`too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header.",
69903
+ "content": {
69904
+ "application/json": {
69905
+ "schema": {
69906
+ "allOf": [
69907
+ {
69908
+ "$ref": "#/components/schemas/ErrorResponse"
69909
+ },
69910
+ {
69911
+ "type": "object",
69912
+ "properties": {
69913
+ "error_code": {
69914
+ "type": "string",
69915
+ "enum": [
69916
+ "too_many_login_attempts",
69917
+ "too_many_requests"
69918
+ ]
69919
+ }
69920
+ }
69921
+ }
69922
+ ]
69923
+ }
69924
+ }
69925
+ }
69926
+ },
69927
+ "500": {
69928
+ "description": "`internal_error` — Unexpected server error. Retry later; the request id is logged.",
69929
+ "content": {
69930
+ "application/json": {
69931
+ "schema": {
69932
+ "allOf": [
69933
+ {
69934
+ "$ref": "#/components/schemas/ErrorResponse"
69935
+ },
69936
+ {
69937
+ "type": "object",
69938
+ "properties": {
69939
+ "error_code": {
69940
+ "type": "string",
69941
+ "enum": [
69942
+ "internal_error"
69943
+ ]
69944
+ }
69945
+ }
69946
+ }
69947
+ ]
69948
+ }
69949
+ }
69950
+ }
69951
+ }
69952
+ }
69953
+ }
69954
+ },
68579
69955
  "/logout": {
68580
69956
  "get": {
68581
69957
  "operationId": "session/logout",