v1

latestOpenAPI 3.0.3Apache 2.02026-07-1756158355.3 KB
frontend

Create Recovery Flow for Native Apps

This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on.

If a valid provided session cookie or session token is provided, a 400 Bad Request error.

On an existing recovery flow, use the getRecoveryFlow API endpoint.

You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks.

This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).

More information can be found at Ory Kratos Account Recovery Documentation.

get/self-service/recovery/api

Response

recoveryFlow

activestring

Active, if set, contains the recovery method that is being used. It is initially not set.

expires_atstring date-time required

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.

idstring uuid required

ID represents the request's unique ID. When performing the recovery flow, this represents the id in the recovery ui's query parameter: http://<selfservice.flows.recovery.ui_url>?request=<id>

issued_atstring date-time required

IssuedAt is the time (UTC) when the request occurred.

request_urlstring required

RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example.

return_tostring

ReturnTo contains the requested return_to URL.

{"stackTrail":"components:schemas:recoveryFlow:properties:state","oasType":"schema","type":"unknown","description":"State represents the state of this request:\n\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."}
transient_payloadobject

TransientPayload is used to pass data from the recovery flow to hooks and email templates

typestring required

The flow type can either be api or browser.

Example response

{
  "expires_at": "2000-01-23T04:56:07.000+00:00",
  "transient_payload": "{}",
  "ui": {
    "nodes": [
      {
        "meta": {
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        },
        "messages": [
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        ],
        "attributes": {
          "autocomplete": "email",
          "maxlength": 1,
          "onclick": "onclick",
          "pattern": "pattern",
          "onclickTrigger": "oryWebAuthnRegistration",
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          "type": "text",
          "required": true,
          "onload": "onload",
          "node_type": "input",
          "onloadTrigger": "oryWebAuthnRegistration",
          "name": "name",
          "disabled": true,
          "value": ""
        },
        "type": "text",
        "group": "default"
      },
      {
        "meta": {
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        },
        "messages": [
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          }
        ],
        "attributes": {
          "autocomplete": "email",
          "maxlength": 1,
          "onclick": "onclick",
          "pattern": "pattern",
          "onclickTrigger": "oryWebAuthnRegistration",
          "label": {
            "context": "{}",
            "id": 6,
            "text": "text",
            "type": "info"
          },
          "type": "text",
          "required": true,
          "onload": "onload",
          "node_type": "input",
          "onloadTrigger": "oryWebAuthnRegistration",
          "name": "name",
          "disabled": true,
          "value": ""
        },
        "type": "text",
        "group": "default"
      }
    ],
    "method": "method",
    "action": "action",
    "messages": [
      {
        "context": "{}",
        "id": 6,
        "text": "text",
        "type": "info"
      },
      {
        "context": "{}",
        "id": 6,
        "text": "text",
        "type": "info"
      }
    ]
  },
  "continue_with": [
    {
      "action": "show_verification_ui",
      "flow": {
        "verifiable_address": "verifiable_address",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "url": "url"
      }
    },
    {
      "action": "show_verification_ui",
      "flow": {
        "verifiable_address": "verifiable_address",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "url": "url"
      }
    }
  ],
  "active": "active",
  "return_to": "return_to",
  "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "state": "",
  "type": "type",
  "issued_at": "2000-01-23T04:56:07.000+00:00",
  "request_url": "request_url"
}