@faable/auth-sdk 2.7.104 → 2.7.105

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.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -347,6 +347,60 @@
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
+ },
350
404
  "login_flow": {
351
405
  "type": "string",
352
406
  "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 +1739,60 @@
1685
1739
  "additionalProperties": false,
1686
1740
  "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
1741
  },
1742
+ "profile_fields": {
1743
+ "type": "array",
1744
+ "items": {
1745
+ "type": "object",
1746
+ "required": [
1747
+ "key",
1748
+ "type"
1749
+ ],
1750
+ "properties": {
1751
+ "key": {
1752
+ "type": "string",
1753
+ "pattern": "^[a-z0-9_]{1,40}$",
1754
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
1755
+ },
1756
+ "type": {
1757
+ "anyOf": [
1758
+ {
1759
+ "type": "string",
1760
+ "enum": [
1761
+ "string"
1762
+ ]
1763
+ },
1764
+ {
1765
+ "type": "string",
1766
+ "enum": [
1767
+ "enum"
1768
+ ]
1769
+ }
1770
+ ],
1771
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
1772
+ },
1773
+ "options": {
1774
+ "type": "array",
1775
+ "items": {
1776
+ "type": "string",
1777
+ "minLength": 1,
1778
+ "maxLength": 200
1779
+ },
1780
+ "minItems": 1,
1781
+ "maxItems": 100,
1782
+ "description": "The accepted values when `type` is `enum`."
1783
+ },
1784
+ "max_length": {
1785
+ "type": "integer",
1786
+ "minimum": 1,
1787
+ "maximum": 1000,
1788
+ "description": "Longest accepted value for a `string` field. Default 200."
1789
+ }
1790
+ },
1791
+ "additionalProperties": false
1792
+ },
1793
+ "maxItems": 20,
1794
+ "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."
1795
+ },
1688
1796
  "mfa_policy": {
1689
1797
  "type": "object",
1690
1798
  "properties": {
@@ -2463,6 +2571,61 @@
2463
2571
  }
2464
2572
  ]
2465
2573
  },
2574
+ "profile_fields": {
2575
+ "type": "array",
2576
+ "items": {
2577
+ "type": "object",
2578
+ "required": [
2579
+ "key",
2580
+ "type"
2581
+ ],
2582
+ "properties": {
2583
+ "key": {
2584
+ "type": "string",
2585
+ "pattern": "^[a-z0-9_]{1,40}$",
2586
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
2587
+ },
2588
+ "type": {
2589
+ "anyOf": [
2590
+ {
2591
+ "type": "string",
2592
+ "enum": [
2593
+ "string"
2594
+ ]
2595
+ },
2596
+ {
2597
+ "type": "string",
2598
+ "enum": [
2599
+ "enum"
2600
+ ]
2601
+ }
2602
+ ],
2603
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
2604
+ },
2605
+ "options": {
2606
+ "type": "array",
2607
+ "items": {
2608
+ "type": "string",
2609
+ "minLength": 1,
2610
+ "maxLength": 200
2611
+ },
2612
+ "minItems": 1,
2613
+ "maxItems": 100,
2614
+ "description": "The accepted values when `type` is `enum`."
2615
+ },
2616
+ "max_length": {
2617
+ "type": "integer",
2618
+ "minimum": 1,
2619
+ "maximum": 1000,
2620
+ "description": "Longest accepted value for a `string` field. Default 200."
2621
+ }
2622
+ },
2623
+ "additionalProperties": false
2624
+ },
2625
+ "maxItems": 20,
2626
+ "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.",
2627
+ "nullable": true
2628
+ },
2466
2629
  "mfa_policy": {
2467
2630
  "anyOf": [
2468
2631
  {
@@ -6869,9 +7032,15 @@
6869
7032
  "enum": [
6870
7033
  "user"
6871
7034
  ]
7035
+ },
7036
+ {
7037
+ "type": "string",
7038
+ "enum": [
7039
+ "password_change"
7040
+ ]
6872
7041
  }
6873
7042
  ],
6874
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
7043
+ "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
7044
  },
6876
7045
  "account": {
6877
7046
  "type": "string",
@@ -7696,6 +7865,61 @@
7696
7865
  }
7697
7866
  ]
7698
7867
  },
7868
+ "profile_fields": {
7869
+ "type": "array",
7870
+ "items": {
7871
+ "type": "object",
7872
+ "required": [
7873
+ "key",
7874
+ "type"
7875
+ ],
7876
+ "properties": {
7877
+ "key": {
7878
+ "type": "string",
7879
+ "pattern": "^[a-z0-9_]{1,40}$",
7880
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
7881
+ },
7882
+ "type": {
7883
+ "anyOf": [
7884
+ {
7885
+ "type": "string",
7886
+ "enum": [
7887
+ "string"
7888
+ ]
7889
+ },
7890
+ {
7891
+ "type": "string",
7892
+ "enum": [
7893
+ "enum"
7894
+ ]
7895
+ }
7896
+ ],
7897
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
7898
+ },
7899
+ "options": {
7900
+ "type": "array",
7901
+ "items": {
7902
+ "type": "string",
7903
+ "minLength": 1,
7904
+ "maxLength": 200
7905
+ },
7906
+ "minItems": 1,
7907
+ "maxItems": 100,
7908
+ "description": "The accepted values when `type` is `enum`."
7909
+ },
7910
+ "max_length": {
7911
+ "type": "integer",
7912
+ "minimum": 1,
7913
+ "maximum": 1000,
7914
+ "description": "Longest accepted value for a `string` field. Default 200."
7915
+ }
7916
+ },
7917
+ "additionalProperties": false
7918
+ },
7919
+ "maxItems": 20,
7920
+ "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.",
7921
+ "nullable": true
7922
+ },
7699
7923
  "mfa_policy": {
7700
7924
  "anyOf": [
7701
7925
  {
@@ -8243,7 +8467,7 @@
8243
8467
  },
8244
8468
  "ErrorCode": {
8245
8469
  "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.",
8470
+ "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
8471
  "enum": [
8248
8472
  "bad_request",
8249
8473
  "validation_error",
@@ -8342,6 +8566,10 @@
8342
8566
  "login_flow_misconfigured",
8343
8567
  "mfa_required",
8344
8568
  "step_up_required",
8569
+ "reauth_required",
8570
+ "invalid_current_password",
8571
+ "email_not_verified",
8572
+ "invalid_profile_field",
8345
8573
  "interaction_required",
8346
8574
  "passkey_login_disabled",
8347
8575
  "mfa_pending",
@@ -8861,6 +9089,60 @@
8861
9089
  "additionalProperties": false,
8862
9090
  "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
9091
  },
9092
+ "profile_fields": {
9093
+ "type": "array",
9094
+ "items": {
9095
+ "type": "object",
9096
+ "required": [
9097
+ "key",
9098
+ "type"
9099
+ ],
9100
+ "properties": {
9101
+ "key": {
9102
+ "type": "string",
9103
+ "pattern": "^[a-z0-9_]{1,40}$",
9104
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
9105
+ },
9106
+ "type": {
9107
+ "anyOf": [
9108
+ {
9109
+ "type": "string",
9110
+ "enum": [
9111
+ "string"
9112
+ ]
9113
+ },
9114
+ {
9115
+ "type": "string",
9116
+ "enum": [
9117
+ "enum"
9118
+ ]
9119
+ }
9120
+ ],
9121
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
9122
+ },
9123
+ "options": {
9124
+ "type": "array",
9125
+ "items": {
9126
+ "type": "string",
9127
+ "minLength": 1,
9128
+ "maxLength": 200
9129
+ },
9130
+ "minItems": 1,
9131
+ "maxItems": 100,
9132
+ "description": "The accepted values when `type` is `enum`."
9133
+ },
9134
+ "max_length": {
9135
+ "type": "integer",
9136
+ "minimum": 1,
9137
+ "maximum": 1000,
9138
+ "description": "Longest accepted value for a `string` field. Default 200."
9139
+ }
9140
+ },
9141
+ "additionalProperties": false
9142
+ },
9143
+ "maxItems": 20,
9144
+ "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."
9145
+ },
8864
9146
  "login_flow": {
8865
9147
  "type": "string",
8866
9148
  "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 +9895,60 @@
9613
9895
  "additionalProperties": false,
9614
9896
  "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
9897
  },
9898
+ "profile_fields": {
9899
+ "type": "array",
9900
+ "items": {
9901
+ "type": "object",
9902
+ "required": [
9903
+ "key",
9904
+ "type"
9905
+ ],
9906
+ "properties": {
9907
+ "key": {
9908
+ "type": "string",
9909
+ "pattern": "^[a-z0-9_]{1,40}$",
9910
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
9911
+ },
9912
+ "type": {
9913
+ "anyOf": [
9914
+ {
9915
+ "type": "string",
9916
+ "enum": [
9917
+ "string"
9918
+ ]
9919
+ },
9920
+ {
9921
+ "type": "string",
9922
+ "enum": [
9923
+ "enum"
9924
+ ]
9925
+ }
9926
+ ],
9927
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
9928
+ },
9929
+ "options": {
9930
+ "type": "array",
9931
+ "items": {
9932
+ "type": "string",
9933
+ "minLength": 1,
9934
+ "maxLength": 200
9935
+ },
9936
+ "minItems": 1,
9937
+ "maxItems": 100,
9938
+ "description": "The accepted values when `type` is `enum`."
9939
+ },
9940
+ "max_length": {
9941
+ "type": "integer",
9942
+ "minimum": 1,
9943
+ "maximum": 1000,
9944
+ "description": "Longest accepted value for a `string` field. Default 200."
9945
+ }
9946
+ },
9947
+ "additionalProperties": false
9948
+ },
9949
+ "maxItems": 20,
9950
+ "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."
9951
+ },
9616
9952
  "login_flow": {
9617
9953
  "type": "string",
9618
9954
  "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 +10938,60 @@
10602
10938
  "additionalProperties": false,
10603
10939
  "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
10940
  },
10941
+ "profile_fields": {
10942
+ "type": "array",
10943
+ "items": {
10944
+ "type": "object",
10945
+ "required": [
10946
+ "key",
10947
+ "type"
10948
+ ],
10949
+ "properties": {
10950
+ "key": {
10951
+ "type": "string",
10952
+ "pattern": "^[a-z0-9_]{1,40}$",
10953
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
10954
+ },
10955
+ "type": {
10956
+ "anyOf": [
10957
+ {
10958
+ "type": "string",
10959
+ "enum": [
10960
+ "string"
10961
+ ]
10962
+ },
10963
+ {
10964
+ "type": "string",
10965
+ "enum": [
10966
+ "enum"
10967
+ ]
10968
+ }
10969
+ ],
10970
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
10971
+ },
10972
+ "options": {
10973
+ "type": "array",
10974
+ "items": {
10975
+ "type": "string",
10976
+ "minLength": 1,
10977
+ "maxLength": 200
10978
+ },
10979
+ "minItems": 1,
10980
+ "maxItems": 100,
10981
+ "description": "The accepted values when `type` is `enum`."
10982
+ },
10983
+ "max_length": {
10984
+ "type": "integer",
10985
+ "minimum": 1,
10986
+ "maximum": 1000,
10987
+ "description": "Longest accepted value for a `string` field. Default 200."
10988
+ }
10989
+ },
10990
+ "additionalProperties": false
10991
+ },
10992
+ "maxItems": 20,
10993
+ "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."
10994
+ },
10605
10995
  "login_flow": {
10606
10996
  "type": "string",
10607
10997
  "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 +11606,61 @@
11216
11606
  }
11217
11607
  ]
11218
11608
  },
11609
+ "profile_fields": {
11610
+ "type": "array",
11611
+ "items": {
11612
+ "type": "object",
11613
+ "required": [
11614
+ "key",
11615
+ "type"
11616
+ ],
11617
+ "properties": {
11618
+ "key": {
11619
+ "type": "string",
11620
+ "pattern": "^[a-z0-9_]{1,40}$",
11621
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
11622
+ },
11623
+ "type": {
11624
+ "anyOf": [
11625
+ {
11626
+ "type": "string",
11627
+ "enum": [
11628
+ "string"
11629
+ ]
11630
+ },
11631
+ {
11632
+ "type": "string",
11633
+ "enum": [
11634
+ "enum"
11635
+ ]
11636
+ }
11637
+ ],
11638
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
11639
+ },
11640
+ "options": {
11641
+ "type": "array",
11642
+ "items": {
11643
+ "type": "string",
11644
+ "minLength": 1,
11645
+ "maxLength": 200
11646
+ },
11647
+ "minItems": 1,
11648
+ "maxItems": 100,
11649
+ "description": "The accepted values when `type` is `enum`."
11650
+ },
11651
+ "max_length": {
11652
+ "type": "integer",
11653
+ "minimum": 1,
11654
+ "maximum": 1000,
11655
+ "description": "Longest accepted value for a `string` field. Default 200."
11656
+ }
11657
+ },
11658
+ "additionalProperties": false
11659
+ },
11660
+ "maxItems": 20,
11661
+ "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.",
11662
+ "nullable": true
11663
+ },
11219
11664
  "mfa_policy": {
11220
11665
  "anyOf": [
11221
11666
  {
@@ -11775,6 +12220,60 @@
11775
12220
  "additionalProperties": false,
11776
12221
  "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
12222
  },
12223
+ "profile_fields": {
12224
+ "type": "array",
12225
+ "items": {
12226
+ "type": "object",
12227
+ "required": [
12228
+ "key",
12229
+ "type"
12230
+ ],
12231
+ "properties": {
12232
+ "key": {
12233
+ "type": "string",
12234
+ "pattern": "^[a-z0-9_]{1,40}$",
12235
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
12236
+ },
12237
+ "type": {
12238
+ "anyOf": [
12239
+ {
12240
+ "type": "string",
12241
+ "enum": [
12242
+ "string"
12243
+ ]
12244
+ },
12245
+ {
12246
+ "type": "string",
12247
+ "enum": [
12248
+ "enum"
12249
+ ]
12250
+ }
12251
+ ],
12252
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
12253
+ },
12254
+ "options": {
12255
+ "type": "array",
12256
+ "items": {
12257
+ "type": "string",
12258
+ "minLength": 1,
12259
+ "maxLength": 200
12260
+ },
12261
+ "minItems": 1,
12262
+ "maxItems": 100,
12263
+ "description": "The accepted values when `type` is `enum`."
12264
+ },
12265
+ "max_length": {
12266
+ "type": "integer",
12267
+ "minimum": 1,
12268
+ "maximum": 1000,
12269
+ "description": "Longest accepted value for a `string` field. Default 200."
12270
+ }
12271
+ },
12272
+ "additionalProperties": false
12273
+ },
12274
+ "maxItems": 20,
12275
+ "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."
12276
+ },
11778
12277
  "login_flow": {
11779
12278
  "type": "string",
11780
12279
  "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 +15480,60 @@
14981
15480
  "additionalProperties": false,
14982
15481
  "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
15482
  },
15483
+ "profile_fields": {
15484
+ "type": "array",
15485
+ "items": {
15486
+ "type": "object",
15487
+ "required": [
15488
+ "key",
15489
+ "type"
15490
+ ],
15491
+ "properties": {
15492
+ "key": {
15493
+ "type": "string",
15494
+ "pattern": "^[a-z0-9_]{1,40}$",
15495
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
15496
+ },
15497
+ "type": {
15498
+ "anyOf": [
15499
+ {
15500
+ "type": "string",
15501
+ "enum": [
15502
+ "string"
15503
+ ]
15504
+ },
15505
+ {
15506
+ "type": "string",
15507
+ "enum": [
15508
+ "enum"
15509
+ ]
15510
+ }
15511
+ ],
15512
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
15513
+ },
15514
+ "options": {
15515
+ "type": "array",
15516
+ "items": {
15517
+ "type": "string",
15518
+ "minLength": 1,
15519
+ "maxLength": 200
15520
+ },
15521
+ "minItems": 1,
15522
+ "maxItems": 100,
15523
+ "description": "The accepted values when `type` is `enum`."
15524
+ },
15525
+ "max_length": {
15526
+ "type": "integer",
15527
+ "minimum": 1,
15528
+ "maximum": 1000,
15529
+ "description": "Longest accepted value for a `string` field. Default 200."
15530
+ }
15531
+ },
15532
+ "additionalProperties": false
15533
+ },
15534
+ "maxItems": 20,
15535
+ "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."
15536
+ },
14984
15537
  "login_flow": {
14985
15538
  "type": "string",
14986
15539
  "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 +19725,60 @@
19172
19725
  "additionalProperties": false,
19173
19726
  "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
19727
  },
19728
+ "profile_fields": {
19729
+ "type": "array",
19730
+ "items": {
19731
+ "type": "object",
19732
+ "required": [
19733
+ "key",
19734
+ "type"
19735
+ ],
19736
+ "properties": {
19737
+ "key": {
19738
+ "type": "string",
19739
+ "pattern": "^[a-z0-9_]{1,40}$",
19740
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
19741
+ },
19742
+ "type": {
19743
+ "anyOf": [
19744
+ {
19745
+ "type": "string",
19746
+ "enum": [
19747
+ "string"
19748
+ ]
19749
+ },
19750
+ {
19751
+ "type": "string",
19752
+ "enum": [
19753
+ "enum"
19754
+ ]
19755
+ }
19756
+ ],
19757
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
19758
+ },
19759
+ "options": {
19760
+ "type": "array",
19761
+ "items": {
19762
+ "type": "string",
19763
+ "minLength": 1,
19764
+ "maxLength": 200
19765
+ },
19766
+ "minItems": 1,
19767
+ "maxItems": 100,
19768
+ "description": "The accepted values when `type` is `enum`."
19769
+ },
19770
+ "max_length": {
19771
+ "type": "integer",
19772
+ "minimum": 1,
19773
+ "maximum": 1000,
19774
+ "description": "Longest accepted value for a `string` field. Default 200."
19775
+ }
19776
+ },
19777
+ "additionalProperties": false
19778
+ },
19779
+ "maxItems": 20,
19780
+ "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."
19781
+ },
19175
19782
  "mfa_policy": {
19176
19783
  "type": "object",
19177
19784
  "properties": {
@@ -19927,6 +20534,60 @@
19927
20534
  "additionalProperties": false,
19928
20535
  "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
20536
  },
20537
+ "profile_fields": {
20538
+ "type": "array",
20539
+ "items": {
20540
+ "type": "object",
20541
+ "required": [
20542
+ "key",
20543
+ "type"
20544
+ ],
20545
+ "properties": {
20546
+ "key": {
20547
+ "type": "string",
20548
+ "pattern": "^[a-z0-9_]{1,40}$",
20549
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
20550
+ },
20551
+ "type": {
20552
+ "anyOf": [
20553
+ {
20554
+ "type": "string",
20555
+ "enum": [
20556
+ "string"
20557
+ ]
20558
+ },
20559
+ {
20560
+ "type": "string",
20561
+ "enum": [
20562
+ "enum"
20563
+ ]
20564
+ }
20565
+ ],
20566
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
20567
+ },
20568
+ "options": {
20569
+ "type": "array",
20570
+ "items": {
20571
+ "type": "string",
20572
+ "minLength": 1,
20573
+ "maxLength": 200
20574
+ },
20575
+ "minItems": 1,
20576
+ "maxItems": 100,
20577
+ "description": "The accepted values when `type` is `enum`."
20578
+ },
20579
+ "max_length": {
20580
+ "type": "integer",
20581
+ "minimum": 1,
20582
+ "maximum": 1000,
20583
+ "description": "Longest accepted value for a `string` field. Default 200."
20584
+ }
20585
+ },
20586
+ "additionalProperties": false
20587
+ },
20588
+ "maxItems": 20,
20589
+ "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."
20590
+ },
19930
20591
  "mfa_policy": {
19931
20592
  "type": "object",
19932
20593
  "properties": {
@@ -20701,6 +21362,61 @@
20701
21362
  }
20702
21363
  ]
20703
21364
  },
21365
+ "profile_fields": {
21366
+ "type": "array",
21367
+ "items": {
21368
+ "type": "object",
21369
+ "required": [
21370
+ "key",
21371
+ "type"
21372
+ ],
21373
+ "properties": {
21374
+ "key": {
21375
+ "type": "string",
21376
+ "pattern": "^[a-z0-9_]{1,40}$",
21377
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
21378
+ },
21379
+ "type": {
21380
+ "anyOf": [
21381
+ {
21382
+ "type": "string",
21383
+ "enum": [
21384
+ "string"
21385
+ ]
21386
+ },
21387
+ {
21388
+ "type": "string",
21389
+ "enum": [
21390
+ "enum"
21391
+ ]
21392
+ }
21393
+ ],
21394
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
21395
+ },
21396
+ "options": {
21397
+ "type": "array",
21398
+ "items": {
21399
+ "type": "string",
21400
+ "minLength": 1,
21401
+ "maxLength": 200
21402
+ },
21403
+ "minItems": 1,
21404
+ "maxItems": 100,
21405
+ "description": "The accepted values when `type` is `enum`."
21406
+ },
21407
+ "max_length": {
21408
+ "type": "integer",
21409
+ "minimum": 1,
21410
+ "maximum": 1000,
21411
+ "description": "Longest accepted value for a `string` field. Default 200."
21412
+ }
21413
+ },
21414
+ "additionalProperties": false
21415
+ },
21416
+ "maxItems": 20,
21417
+ "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.",
21418
+ "nullable": true
21419
+ },
20704
21420
  "mfa_policy": {
20705
21421
  "anyOf": [
20706
21422
  {
@@ -21301,6 +22017,60 @@
21301
22017
  "additionalProperties": false,
21302
22018
  "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
22019
  },
22020
+ "profile_fields": {
22021
+ "type": "array",
22022
+ "items": {
22023
+ "type": "object",
22024
+ "required": [
22025
+ "key",
22026
+ "type"
22027
+ ],
22028
+ "properties": {
22029
+ "key": {
22030
+ "type": "string",
22031
+ "pattern": "^[a-z0-9_]{1,40}$",
22032
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
22033
+ },
22034
+ "type": {
22035
+ "anyOf": [
22036
+ {
22037
+ "type": "string",
22038
+ "enum": [
22039
+ "string"
22040
+ ]
22041
+ },
22042
+ {
22043
+ "type": "string",
22044
+ "enum": [
22045
+ "enum"
22046
+ ]
22047
+ }
22048
+ ],
22049
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
22050
+ },
22051
+ "options": {
22052
+ "type": "array",
22053
+ "items": {
22054
+ "type": "string",
22055
+ "minLength": 1,
22056
+ "maxLength": 200
22057
+ },
22058
+ "minItems": 1,
22059
+ "maxItems": 100,
22060
+ "description": "The accepted values when `type` is `enum`."
22061
+ },
22062
+ "max_length": {
22063
+ "type": "integer",
22064
+ "minimum": 1,
22065
+ "maximum": 1000,
22066
+ "description": "Longest accepted value for a `string` field. Default 200."
22067
+ }
22068
+ },
22069
+ "additionalProperties": false
22070
+ },
22071
+ "maxItems": 20,
22072
+ "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."
22073
+ },
21304
22074
  "mfa_policy": {
21305
22075
  "type": "object",
21306
22076
  "properties": {
@@ -22056,6 +22826,60 @@
22056
22826
  "additionalProperties": false,
22057
22827
  "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
22828
  },
22829
+ "profile_fields": {
22830
+ "type": "array",
22831
+ "items": {
22832
+ "type": "object",
22833
+ "required": [
22834
+ "key",
22835
+ "type"
22836
+ ],
22837
+ "properties": {
22838
+ "key": {
22839
+ "type": "string",
22840
+ "pattern": "^[a-z0-9_]{1,40}$",
22841
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
22842
+ },
22843
+ "type": {
22844
+ "anyOf": [
22845
+ {
22846
+ "type": "string",
22847
+ "enum": [
22848
+ "string"
22849
+ ]
22850
+ },
22851
+ {
22852
+ "type": "string",
22853
+ "enum": [
22854
+ "enum"
22855
+ ]
22856
+ }
22857
+ ],
22858
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
22859
+ },
22860
+ "options": {
22861
+ "type": "array",
22862
+ "items": {
22863
+ "type": "string",
22864
+ "minLength": 1,
22865
+ "maxLength": 200
22866
+ },
22867
+ "minItems": 1,
22868
+ "maxItems": 100,
22869
+ "description": "The accepted values when `type` is `enum`."
22870
+ },
22871
+ "max_length": {
22872
+ "type": "integer",
22873
+ "minimum": 1,
22874
+ "maximum": 1000,
22875
+ "description": "Longest accepted value for a `string` field. Default 200."
22876
+ }
22877
+ },
22878
+ "additionalProperties": false
22879
+ },
22880
+ "maxItems": 20,
22881
+ "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."
22882
+ },
22059
22883
  "mfa_policy": {
22060
22884
  "type": "object",
22061
22885
  "properties": {
@@ -22812,6 +23636,60 @@
22812
23636
  "additionalProperties": false,
22813
23637
  "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
23638
  },
23639
+ "profile_fields": {
23640
+ "type": "array",
23641
+ "items": {
23642
+ "type": "object",
23643
+ "required": [
23644
+ "key",
23645
+ "type"
23646
+ ],
23647
+ "properties": {
23648
+ "key": {
23649
+ "type": "string",
23650
+ "pattern": "^[a-z0-9_]{1,40}$",
23651
+ "description": "The field key, as it is stored in `user_metadata[\"faable.com/fields\"]`."
23652
+ },
23653
+ "type": {
23654
+ "anyOf": [
23655
+ {
23656
+ "type": "string",
23657
+ "enum": [
23658
+ "string"
23659
+ ]
23660
+ },
23661
+ {
23662
+ "type": "string",
23663
+ "enum": [
23664
+ "enum"
23665
+ ]
23666
+ }
23667
+ ],
23668
+ "description": "`string`: free text up to `max_length`. `enum`: one of `options`."
23669
+ },
23670
+ "options": {
23671
+ "type": "array",
23672
+ "items": {
23673
+ "type": "string",
23674
+ "minLength": 1,
23675
+ "maxLength": 200
23676
+ },
23677
+ "minItems": 1,
23678
+ "maxItems": 100,
23679
+ "description": "The accepted values when `type` is `enum`."
23680
+ },
23681
+ "max_length": {
23682
+ "type": "integer",
23683
+ "minimum": 1,
23684
+ "maximum": 1000,
23685
+ "description": "Longest accepted value for a `string` field. Default 200."
23686
+ }
23687
+ },
23688
+ "additionalProperties": false
23689
+ },
23690
+ "maxItems": 20,
23691
+ "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."
23692
+ },
22815
23693
  "mfa_policy": {
22816
23694
  "type": "object",
22817
23695
  "properties": {
@@ -60700,9 +61578,15 @@
60700
61578
  "enum": [
60701
61579
  "user"
60702
61580
  ]
61581
+ },
61582
+ {
61583
+ "type": "string",
61584
+ "enum": [
61585
+ "password_change"
61586
+ ]
60703
61587
  }
60704
61588
  ],
60705
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
61589
+ "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
61590
  },
60707
61591
  "account": {
60708
61592
  "type": "string",
@@ -61035,9 +61919,15 @@
61035
61919
  "enum": [
61036
61920
  "user"
61037
61921
  ]
61922
+ },
61923
+ {
61924
+ "type": "string",
61925
+ "enum": [
61926
+ "password_change"
61927
+ ]
61038
61928
  }
61039
61929
  ],
61040
- "description": "`admin`: revoked through the Management API. `logout`: the user signed out. `user`: the user revoked it from another device."
61930
+ "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
61931
  },
61042
61932
  "account": {
61043
61933
  "type": "string",
@@ -67500,6 +68390,31 @@
67500
68390
  }
67501
68391
  }
67502
68392
  },
68393
+ "403": {
68394
+ "description": "`forbidden` — The credentials are valid but do not allow this operation.",
68395
+ "content": {
68396
+ "application/json": {
68397
+ "schema": {
68398
+ "allOf": [
68399
+ {
68400
+ "$ref": "#/components/schemas/ErrorResponse"
68401
+ },
68402
+ {
68403
+ "type": "object",
68404
+ "properties": {
68405
+ "error_code": {
68406
+ "type": "string",
68407
+ "enum": [
68408
+ "forbidden"
68409
+ ]
68410
+ }
68411
+ }
68412
+ }
68413
+ ]
68414
+ }
68415
+ }
68416
+ }
68417
+ },
67503
68418
  "404": {
67504
68419
  "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
67505
68420
  "content": {
@@ -67583,7 +68498,7 @@
67583
68498
  "tags": [
67584
68499
  "session"
67585
68500
  ],
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.",
68501
+ "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
68502
  "requestBody": {
67588
68503
  "required": true,
67589
68504
  "content": {
@@ -67603,14 +68518,39 @@
67603
68518
  "country_iso": {
67604
68519
  "type": "string",
67605
68520
  "maxLength": 3
68521
+ },
68522
+ "fields": {
68523
+ "type": "array",
68524
+ "items": {
68525
+ "type": "object",
68526
+ "required": [
68527
+ "key",
68528
+ "value"
68529
+ ],
68530
+ "properties": {
68531
+ "key": {
68532
+ "type": "string",
68533
+ "minLength": 1,
68534
+ "maxLength": 40
68535
+ },
68536
+ "value": {
68537
+ "type": "string",
68538
+ "maxLength": 1000,
68539
+ "nullable": true
68540
+ }
68541
+ },
68542
+ "additionalProperties": false
68543
+ },
68544
+ "maxItems": 20,
68545
+ "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
68546
  }
67607
68547
  },
67608
68548
  "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."
68549
+ "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
68550
  }
67611
68551
  }
67612
68552
  },
67613
- "description": "Profile fields the current User may edit on themselves. `company_name` is stored in `user_metadata`, merged with whatever else is there."
68553
+ "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
68554
  },
67615
68555
  "responses": {
67616
68556
  "200": {
@@ -68005,7 +68945,7 @@
68005
68945
  }
68006
68946
  },
68007
68947
  "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.",
68948
+ "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
68949
  "content": {
68010
68950
  "application/json": {
68011
68951
  "schema": {
@@ -68020,6 +68960,7 @@
68020
68960
  "type": "string",
68021
68961
  "enum": [
68022
68962
  "bad_request",
68963
+ "invalid_profile_field",
68023
68964
  "validation_error"
68024
68965
  ]
68025
68966
  }
@@ -68576,6 +69517,429 @@
68576
69517
  }
68577
69518
  }
68578
69519
  },
69520
+ "/me/credentials": {
69521
+ "get": {
69522
+ "operationId": "session/me_credentials",
69523
+ "summary": "How the current User signs in",
69524
+ "tags": [
69525
+ "session"
69526
+ ],
69527
+ "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.",
69528
+ "responses": {
69529
+ "200": {
69530
+ "description": "Default Response",
69531
+ "content": {
69532
+ "application/json": {
69533
+ "schema": {
69534
+ "type": "object",
69535
+ "required": [
69536
+ "has_password",
69537
+ "connections"
69538
+ ],
69539
+ "properties": {
69540
+ "has_password": {
69541
+ "type": "boolean",
69542
+ "description": "Whether the user can sign in with a password: they have a `database` credential with a password set."
69543
+ },
69544
+ "connections": {
69545
+ "type": "array",
69546
+ "items": {
69547
+ "type": "object",
69548
+ "required": [
69549
+ "id",
69550
+ "name",
69551
+ "type"
69552
+ ],
69553
+ "properties": {
69554
+ "id": {
69555
+ "type": "string",
69556
+ "description": "The Connection id (`connection_xxx`)."
69557
+ },
69558
+ "name": {
69559
+ "type": "string",
69560
+ "description": "The Connection name."
69561
+ },
69562
+ "type": {
69563
+ "type": "string",
69564
+ "description": "The Connection type: `database`, `google`, `github`, …"
69565
+ }
69566
+ },
69567
+ "additionalProperties": false
69568
+ },
69569
+ "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."
69570
+ }
69571
+ }
69572
+ }
69573
+ }
69574
+ }
69575
+ },
69576
+ "401": {
69577
+ "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.",
69578
+ "content": {
69579
+ "application/json": {
69580
+ "schema": {
69581
+ "allOf": [
69582
+ {
69583
+ "$ref": "#/components/schemas/ErrorResponse"
69584
+ },
69585
+ {
69586
+ "type": "object",
69587
+ "properties": {
69588
+ "error_code": {
69589
+ "type": "string",
69590
+ "enum": [
69591
+ "mfa_pending",
69592
+ "not_logged_in"
69593
+ ]
69594
+ }
69595
+ }
69596
+ }
69597
+ ]
69598
+ }
69599
+ }
69600
+ }
69601
+ },
69602
+ "403": {
69603
+ "description": "`forbidden` — The credentials are valid but do not allow this operation.",
69604
+ "content": {
69605
+ "application/json": {
69606
+ "schema": {
69607
+ "allOf": [
69608
+ {
69609
+ "$ref": "#/components/schemas/ErrorResponse"
69610
+ },
69611
+ {
69612
+ "type": "object",
69613
+ "properties": {
69614
+ "error_code": {
69615
+ "type": "string",
69616
+ "enum": [
69617
+ "forbidden"
69618
+ ]
69619
+ }
69620
+ }
69621
+ }
69622
+ ]
69623
+ }
69624
+ }
69625
+ }
69626
+ },
69627
+ "404": {
69628
+ "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
69629
+ "content": {
69630
+ "application/json": {
69631
+ "schema": {
69632
+ "allOf": [
69633
+ {
69634
+ "$ref": "#/components/schemas/ErrorResponse"
69635
+ },
69636
+ {
69637
+ "type": "object",
69638
+ "properties": {
69639
+ "error_code": {
69640
+ "type": "string",
69641
+ "enum": [
69642
+ "account_not_found"
69643
+ ]
69644
+ }
69645
+ }
69646
+ }
69647
+ ]
69648
+ }
69649
+ }
69650
+ }
69651
+ },
69652
+ "429": {
69653
+ "description": "`too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header.",
69654
+ "content": {
69655
+ "application/json": {
69656
+ "schema": {
69657
+ "allOf": [
69658
+ {
69659
+ "$ref": "#/components/schemas/ErrorResponse"
69660
+ },
69661
+ {
69662
+ "type": "object",
69663
+ "properties": {
69664
+ "error_code": {
69665
+ "type": "string",
69666
+ "enum": [
69667
+ "too_many_requests"
69668
+ ]
69669
+ }
69670
+ }
69671
+ }
69672
+ ]
69673
+ }
69674
+ }
69675
+ }
69676
+ },
69677
+ "500": {
69678
+ "description": "`internal_error` — Unexpected server error. Retry later; the request id is logged.",
69679
+ "content": {
69680
+ "application/json": {
69681
+ "schema": {
69682
+ "allOf": [
69683
+ {
69684
+ "$ref": "#/components/schemas/ErrorResponse"
69685
+ },
69686
+ {
69687
+ "type": "object",
69688
+ "properties": {
69689
+ "error_code": {
69690
+ "type": "string",
69691
+ "enum": [
69692
+ "internal_error"
69693
+ ]
69694
+ }
69695
+ }
69696
+ }
69697
+ ]
69698
+ }
69699
+ }
69700
+ }
69701
+ }
69702
+ }
69703
+ }
69704
+ },
69705
+ "/me/password": {
69706
+ "post": {
69707
+ "operationId": "session/me_password",
69708
+ "summary": "Set or change the current User password",
69709
+ "tags": [
69710
+ "session"
69711
+ ],
69712
+ "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.",
69713
+ "requestBody": {
69714
+ "required": true,
69715
+ "content": {
69716
+ "application/json": {
69717
+ "schema": {
69718
+ "type": "object",
69719
+ "required": [
69720
+ "password"
69721
+ ],
69722
+ "properties": {
69723
+ "password": {
69724
+ "type": "string",
69725
+ "minLength": 1,
69726
+ "maxLength": 512
69727
+ },
69728
+ "current_password": {
69729
+ "type": "string",
69730
+ "maxLength": 512
69731
+ }
69732
+ },
69733
+ "additionalProperties": false
69734
+ }
69735
+ }
69736
+ }
69737
+ },
69738
+ "responses": {
69739
+ "200": {
69740
+ "description": "Default Response",
69741
+ "content": {
69742
+ "application/json": {
69743
+ "schema": {
69744
+ "type": "object",
69745
+ "required": [
69746
+ "revoked_sessions"
69747
+ ],
69748
+ "properties": {
69749
+ "revoked_sessions": {
69750
+ "type": "number",
69751
+ "description": "How many other sessions of the user were ended."
69752
+ }
69753
+ }
69754
+ }
69755
+ }
69756
+ }
69757
+ },
69758
+ "400": {
69759
+ "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.",
69760
+ "content": {
69761
+ "application/json": {
69762
+ "schema": {
69763
+ "allOf": [
69764
+ {
69765
+ "$ref": "#/components/schemas/ErrorResponse"
69766
+ },
69767
+ {
69768
+ "type": "object",
69769
+ "properties": {
69770
+ "error_code": {
69771
+ "type": "string",
69772
+ "enum": [
69773
+ "invalid_current_password",
69774
+ "password_too_weak",
69775
+ "no_database_connection",
69776
+ "validation_error"
69777
+ ]
69778
+ }
69779
+ }
69780
+ }
69781
+ ]
69782
+ }
69783
+ }
69784
+ }
69785
+ },
69786
+ "401": {
69787
+ "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.",
69788
+ "content": {
69789
+ "application/json": {
69790
+ "schema": {
69791
+ "allOf": [
69792
+ {
69793
+ "$ref": "#/components/schemas/ErrorResponse"
69794
+ },
69795
+ {
69796
+ "type": "object",
69797
+ "properties": {
69798
+ "error_code": {
69799
+ "type": "string",
69800
+ "enum": [
69801
+ "mfa_pending",
69802
+ "not_logged_in"
69803
+ ]
69804
+ }
69805
+ }
69806
+ }
69807
+ ]
69808
+ }
69809
+ }
69810
+ }
69811
+ },
69812
+ "403": {
69813
+ "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.",
69814
+ "content": {
69815
+ "application/json": {
69816
+ "schema": {
69817
+ "allOf": [
69818
+ {
69819
+ "$ref": "#/components/schemas/ErrorResponse"
69820
+ },
69821
+ {
69822
+ "type": "object",
69823
+ "properties": {
69824
+ "error_code": {
69825
+ "type": "string",
69826
+ "enum": [
69827
+ "forbidden",
69828
+ "reauth_required",
69829
+ "email_not_verified"
69830
+ ]
69831
+ }
69832
+ }
69833
+ }
69834
+ ]
69835
+ }
69836
+ }
69837
+ }
69838
+ },
69839
+ "404": {
69840
+ "description": "`account_not_found` — No Auth Account matches the request (domain, header or token).",
69841
+ "content": {
69842
+ "application/json": {
69843
+ "schema": {
69844
+ "allOf": [
69845
+ {
69846
+ "$ref": "#/components/schemas/ErrorResponse"
69847
+ },
69848
+ {
69849
+ "type": "object",
69850
+ "properties": {
69851
+ "error_code": {
69852
+ "type": "string",
69853
+ "enum": [
69854
+ "account_not_found"
69855
+ ]
69856
+ }
69857
+ }
69858
+ }
69859
+ ]
69860
+ }
69861
+ }
69862
+ }
69863
+ },
69864
+ "409": {
69865
+ "description": "`conflict` — The request conflicts with the current state of the resource.",
69866
+ "content": {
69867
+ "application/json": {
69868
+ "schema": {
69869
+ "allOf": [
69870
+ {
69871
+ "$ref": "#/components/schemas/ErrorResponse"
69872
+ },
69873
+ {
69874
+ "type": "object",
69875
+ "properties": {
69876
+ "error_code": {
69877
+ "type": "string",
69878
+ "enum": [
69879
+ "conflict"
69880
+ ]
69881
+ }
69882
+ }
69883
+ }
69884
+ ]
69885
+ }
69886
+ }
69887
+ }
69888
+ },
69889
+ "429": {
69890
+ "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.",
69891
+ "content": {
69892
+ "application/json": {
69893
+ "schema": {
69894
+ "allOf": [
69895
+ {
69896
+ "$ref": "#/components/schemas/ErrorResponse"
69897
+ },
69898
+ {
69899
+ "type": "object",
69900
+ "properties": {
69901
+ "error_code": {
69902
+ "type": "string",
69903
+ "enum": [
69904
+ "too_many_login_attempts",
69905
+ "too_many_requests"
69906
+ ]
69907
+ }
69908
+ }
69909
+ }
69910
+ ]
69911
+ }
69912
+ }
69913
+ }
69914
+ },
69915
+ "500": {
69916
+ "description": "`internal_error` — Unexpected server error. Retry later; the request id is logged.",
69917
+ "content": {
69918
+ "application/json": {
69919
+ "schema": {
69920
+ "allOf": [
69921
+ {
69922
+ "$ref": "#/components/schemas/ErrorResponse"
69923
+ },
69924
+ {
69925
+ "type": "object",
69926
+ "properties": {
69927
+ "error_code": {
69928
+ "type": "string",
69929
+ "enum": [
69930
+ "internal_error"
69931
+ ]
69932
+ }
69933
+ }
69934
+ }
69935
+ ]
69936
+ }
69937
+ }
69938
+ }
69939
+ }
69940
+ }
69941
+ }
69942
+ },
68579
69943
  "/logout": {
68580
69944
  "get": {
68581
69945
  "operationId": "session/logout",