{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/numspot/json-schema/numspot-recovery-flow-schema.json",
  "title": "A Recovery Flow",
  "description": "This request is used when an identity wants to recover their account.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/numspot-openapi.yml#/components/schemas/RecoveryFlow",
  "type": "object",
  "properties": {
    "active": {
      "type": "string",
      "description": "Active, if set, contains the recovery method that is being used. It is initially not set."
    },
    "continue_with": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContinueWith"
      },
      "description": "Contains possible actions that could follow this flow"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "ExpiresAt is the time (UTC) when the request expires. If the user still wishes to update the setting, a new request has to be initiated."
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID represents the request's unique ID."
    },
    "issued_at": {
      "type": "string",
      "format": "date-time",
      "description": "IssuedAt is the time (UTC) when the request occurred."
    },
    "request_url": {
      "type": "string",
      "description": "RequestURL is the initial URL that was requested. It can be used\nto forward information contained in the URL's path or query for example."
    },
    "return_to": {
      "type": "string",
      "description": "ReturnTo contains the requested return_to URL."
    },
    "state": {
      "description": "State represents the state of this request:\nchoose_method: ask the user to choose a method (e.g. recover account via email)\nsent_email: the email has been sent to the user\npassed_challenge: the request was successful and the recovery challenge was passed."
    },
    "type": {
      "$ref": "#/$defs/SelfServiceFlowType"
    },
    "ui": {
      "$ref": "#/$defs/UiContainer"
    }
  },
  "required": [
    "id",
    "type",
    "expires_at",
    "issued_at",
    "request_url",
    "ui",
    "state"
  ],
  "$defs": {
    "ContinueWith": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "oneOf": [
        {
          "$ref": "#/$defs/ContinueWithVerificationUi"
        },
        {
          "$ref": "#/$defs/ContinueWithSetSessionToken"
        },
        {
          "$ref": "#/$defs/ContinueWithSettingsUi"
        },
        {
          "$ref": "#/$defs/ContinueWithRecoveryUi"
        }
      ],
      "title": "Continue With"
    },
    "ContinueWithRecoveryUi": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "show_recovery_ui"
          ],
          "description": "Action will always be `show_recovery_ui`\nshow_recovery_ui ContinueWithActionShowRecoveryUIString"
        },
        "flow": {
          "$ref": "#/$defs/ContinueWithRecoveryUiFlow"
        }
      },
      "title": "Continue With Recovery Ui",
      "required": [
        "action",
        "flow"
      ],
      "description": "Indicates, that the UI flow could be continued by showing a recovery ui"
    },
    "ContinueWithRecoveryUiFlow": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the recovery flow"
        },
        "url": {
          "type": "string",
          "description": "The URL of the recovery flow"
        }
      },
      "title": "Continue With Recovery Ui Flow",
      "required": [
        "id"
      ]
    },
    "ContinueWithSetSessionToken": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "set_session_token"
          ],
          "description": "Action will always be `set_session_token`\nset_session_token ContinueWithActionSetSessionTokenString"
        },
        "session_token": {
          "type": "string",
          "description": "Token is the token of the session"
        }
      },
      "title": "Continue With Set Session Token",
      "required": [
        "action",
        "session_token"
      ],
      "description": "Indicates that a session was issued, and the application should use this token for authenticated requests"
    },
    "ContinueWithSettingsUi": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "show_settings_ui"
          ],
          "description": "Action will always be `show_settings_ui`\nshow_settings_ui ContinueWithActionShowSettingsUIString"
        },
        "flow": {
          "$ref": "#/$defs/ContinueWithSettingsUiFlow"
        }
      },
      "title": "Continue With Settings Ui",
      "required": [
        "action",
        "flow"
      ],
      "description": "Indicates, that the UI flow could be continued by showing a settings ui"
    },
    "ContinueWithSettingsUiFlow": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the settings flow"
        }
      },
      "title": "Continue With Settings Ui Flow",
      "required": [
        "id"
      ]
    },
    "ContinueWithVerificationUi": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "show_verification_ui"
          ],
          "description": "Action will always be `show_verification_ui`\nshow_verification_ui ContinueWithActionShowVerificationUIString"
        },
        "flow": {
          "$ref": "#/$defs/ContinueWithVerificationUiFlow"
        }
      },
      "title": "Continue With Verification Ui",
      "required": [
        "action",
        "flow"
      ],
      "description": "Indicates, that the UI flow could be continued by showing a verification ui"
    },
    "ContinueWithVerificationUiFlow": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The ID of the verification flow"
        },
        "url": {
          "type": "string",
          "description": "The URL of the verification flow"
        },
        "verifiable_address": {
          "type": "string",
          "description": "The address that should be verified in this flow"
        }
      },
      "title": "Continue With Verification Ui Flow",
      "required": [
        "id",
        "verifiable_address"
      ]
    },
    "ID": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "integer",
      "title": "ID",
      "format": "int64"
    },
    "SelfServiceFlowType": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "string",
      "title": "Type is the flow type.",
      "description": "The flow type can either be `api` or `browser`."
    },
    "UiContainer": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "Action should be used as the form action URL `<form action=\"{{.Action }}\" method=\"post\">`."
        },
        "messages": {
          "$ref": "#/$defs/UiTexts"
        },
        "method": {
          "type": "string",
          "description": "Method is the form method (e.g. POST)"
        },
        "nodes": {
          "$ref": "#/$defs/UiNodes"
        }
      },
      "title": "Ui Container",
      "required": [
        "action",
        "method",
        "nodes"
      ],
      "description": "Container represents a HTML Form. The container can work with both HTTP Form and JSON requests."
    },
    "UiNode": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "attributes": {
          "$ref": "#/$defs/UiNodeAttributes"
        },
        "group": {
          "type": "string",
          "enum": [
            "default",
            "password",
            "oidc",
            "profile",
            "link",
            "code",
            "totp",
            "lookup_secret",
            "webauthn"
          ],
          "description": "Group specifies which group (e.g. password authenticator) this node belongs to.\ndefault DefaultGroup\npassword PasswordGroup\noidc OpenIDConnectGroup\nprofile ProfileGroup\nlink LinkGroup\ncode CodeGroup\ntotp TOTPGroup\nlookup_secret LookupGroup\nwebauthn WebAuthnGroup"
        },
        "messages": {
          "$ref": "#/$defs/UiTexts"
        },
        "meta": {
          "$ref": "#/$defs/UiNodeMeta"
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "input",
            "img",
            "a",
            "script"
          ],
          "description": "The node's type\ntext Text\ninput Input\nimg Image\na Anchor\nscript Script"
        }
      },
      "title": "Node represents a flow's nodes",
      "required": [
        "type",
        "group",
        "attributes",
        "messages",
        "meta"
      ],
      "description": "Nodes are represented as HTML elements or their native UI equivalents. For example,\na node can be an `<img>` tag, or an `<input element>` but also `some plain text`."
    },
    "UiNodeAnchorAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "href": {
          "type": "string",
          "description": "The link's href (destination) URL.\n\nformat: uri"
        },
        "id": {
          "type": "string",
          "description": "A unique identifier"
        },
        "node_type": {
          "type": "string",
          "description": "NodeType represents this node's types. It is a mirror of `node.type` and\nis primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"a\"."
        },
        "title": {
          "$ref": "#/$defs/UiText"
        }
      },
      "title": "AnchorAttributes represents the attributes of an anchor node.",
      "required": [
        "href",
        "title",
        "id",
        "node_type"
      ]
    },
    "UiNodeAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "oneOf": [
        {
          "$ref": "#/$defs/UiNodeInputAttributes"
        },
        {
          "$ref": "#/$defs/UiNodeTextAttributes"
        },
        {
          "$ref": "#/$defs/UiNodeImageAttributes"
        },
        {
          "$ref": "#/$defs/UiNodeAnchorAttributes"
        },
        {
          "$ref": "#/$defs/UiNodeScriptAttributes"
        }
      ],
      "title": "Attributes represents a list of attributes"
    },
    "UiNodeImageAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "height": {
          "type": "integer",
          "format": "int64",
          "description": "Height of the image"
        },
        "id": {
          "type": "string",
          "description": "A unique identifier"
        },
        "node_type": {
          "type": "string",
          "description": "NodeType represents this node's types. It is a mirror of `node.type` and\nis primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"img\"."
        },
        "src": {
          "type": "string",
          "description": "The image's source URL.\n\nformat: uri"
        },
        "width": {
          "type": "integer",
          "format": "int64",
          "description": "Width of the image"
        }
      },
      "title": "ImageAttributes represents the attributes of an image node.",
      "required": [
        "src",
        "id",
        "width",
        "height",
        "node_type"
      ]
    },
    "UiNodeInputAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "autocomplete": {
          "type": "string",
          "enum": [
            "email",
            "tel",
            "url",
            "current-password",
            "new-password",
            "one-time-code"
          ],
          "description": "The autocomplete attribute for the input.\nemail InputAttributeAutocompleteEmail\ntel InputAttributeAutocompleteTel\nurl InputAttributeAutocompleteUrl\ncurrent-password InputAttributeAutocompleteCurrentPassword\nnew-password InputAttributeAutocompleteNewPassword\none-time-code InputAttributeAutocompleteOneTimeCode"
        },
        "disabled": {
          "type": "boolean",
          "description": "Sets the input's disabled field to true or false."
        },
        "label": {
          "$ref": "#/$defs/UiText"
        },
        "name": {
          "type": "string",
          "description": "The input's element name."
        },
        "node_type": {
          "type": "string",
          "description": "NodeType represents this node's types. It is a mirror of `node.type` and\nis primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"input\"."
        },
        "onclick": {
          "type": "string",
          "description": "OnClick may contain javascript which should be executed on click. This is primarily\nused for WebAuthn."
        },
        "pattern": {
          "type": "string",
          "description": "The input's pattern."
        },
        "required": {
          "type": "boolean",
          "description": "Mark this input field as required."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "password",
            "number",
            "checkbox",
            "hidden",
            "email",
            "tel",
            "submit",
            "button",
            "datetime-local",
            "date",
            "url"
          ],
          "description": "The input's element type.\ntext InputAttributeTypeText\npassword InputAttributeTypePassword\nnumber InputAttributeTypeNumber\ncheckbox InputAttributeTypeCheckbox\nhidden InputAttributeTypeHidden\nemail InputAttributeTypeEmail\ntel InputAttributeTypeTel\nsubmit InputAttributeTypeSubmit\nbutton InputAttributeTypeButton\ndatetime-local InputAttributeTypeDateTimeLocal\ndate InputAttributeTypeDate\nurl InputAttributeTypeURI"
        },
        "value": {
          "description": "The input's value."
        }
      },
      "title": "ScriptAttributes represent input nodes which load javascript.",
      "required": [
        "name",
        "type",
        "disabled",
        "node_type"
      ],
      "description": "InputAttributes represents the attributes of an input node"
    },
    "UiNodeMeta": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "label": {
          "$ref": "#/$defs/UiText"
        }
      },
      "title": "A Node's Meta Information",
      "description": "This might include a label and other information that can optionally\nbe used to render UIs."
    },
    "UiNodeScriptAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "async": {
          "type": "boolean",
          "description": "The script async type"
        },
        "crossorigin": {
          "type": "string",
          "description": "The script cross origin policy"
        },
        "id": {
          "type": "string",
          "description": "A unique identifier"
        },
        "integrity": {
          "type": "string",
          "description": "The script's integrity hash"
        },
        "node_type": {
          "type": "string",
          "description": "NodeType represents this node's types. It is a mirror of `node.type` and\nis primarily used to allow compatibility with OpenAPI 3.0. In this struct it technically always is \"script\"."
        },
        "nonce": {
          "type": "string",
          "description": "Nonce for CSP\n\nA nonce you may want to use to improve your Content Security Policy.\nYou do not have to use this value but if you want to improve your CSP\npolicies you may use it. You can also choose to use your own nonce value!"
        },
        "referrerpolicy": {
          "type": "string",
          "description": "The script referrer policy"
        },
        "src": {
          "type": "string",
          "description": "The script source"
        },
        "type": {
          "type": "string",
          "description": "The script MIME type"
        }
      },
      "title": "ScriptAttributes represent script nodes which load javascript.",
      "required": [
        "src",
        "async",
        "referrerpolicy",
        "crossorigin",
        "integrity",
        "type",
        "id",
        "nonce",
        "node_type"
      ]
    },
    "UiNodeTextAttributes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A unique identifier"
        },
        "node_type": {
          "type": "string",
          "description": "NodeType represents this node's types. It is a mirror of `node.type` and\nis primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"text\"."
        },
        "text": {
          "$ref": "#/$defs/UiText"
        }
      },
      "title": "TextAttributes represents the attributes of a text node.",
      "required": [
        "text",
        "id",
        "node_type"
      ]
    },
    "UiNodes": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "array",
      "items": {
        "$ref": "#/$defs/UiNode"
      },
      "title": "Ui Nodes"
    },
    "UiText": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "context": {
          "type": "object",
          "description": "The message's context. Useful when customizing messages."
        },
        "id": {
          "$ref": "#/$defs/ID"
        },
        "text": {
          "type": "string",
          "description": "The message text. Written in american english."
        },
        "type": {
          "type": "string",
          "enum": [
            "info",
            "error",
            "success"
          ],
          "description": "The message type.\ninfo Info\nerror Error\nsuccess Success"
        }
      },
      "title": "Ui Text",
      "required": [
        "id",
        "text",
        "type"
      ]
    },
    "UiTexts": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "array",
      "items": {
        "$ref": "#/$defs/UiText"
      },
      "title": "Ui Texts"
    }
  }
}