v1

latestOpenAPI 3.0.3Apache 2.02026-07-1756158355.3 KB
frontend

Create Settings Flow for Native Apps

This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK.

To fetch an existing settings flow call /self-service/settings/flows?flow=<flow_id>.

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.

Depending on your configuration this endpoint might return a 403 error if the session has a lower Authenticator Assurance Level (AAL) than is possible for the identity. This can happen if the identity has password + webauthn credentials (which would result in AAL2) but the session has only AAL1. If this error occurs, ask the user to sign in with the second factor or change the configuration.

In the case of an error, the error.id of the JSON response body can be one of:

security_csrf_violation: Unable to fetch the flow because a CSRF violation occurred. session_inactive: No Ory Session was found - sign in a user first.

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 User Settings & Profile Management Documentation.

get/self-service/settings/api

Headers

X-Session-Tokenstring

The Session Token of the Identity performing the settings flow.

Response

settingsFlow

activestring

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

expires_atstring date-time required

ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to update the setting, a new flow has to be initiated.

idstring uuid required

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

issued_atstring date-time required

IssuedAt is the time (UTC) when the flow 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:settingsFlow:properties:state","oasType":"schema","type":"unknown","description":"State represents the state of this flow. It knows two states:\n\nshow_form: No user data has been collected, or it is invalid, and thus the form should be shown.\nsuccess: Indicates that the settings flow has been updated successfully with the provided data.\nDone will stay true when repeatedly checking. If set to true, done will revert back to false only\nwhen a flow with invalid (e.g. \"please use a valid phone number\") data was sent."}
transient_payloadobject

TransientPayload is used to pass data from the settings 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"
      }
    ]
  },
  "identity": {
    "traits": "",
    "credentials": {
      "key": {
        "updated_at": "2000-01-23T04:56:07.000+00:00",
        "identifiers": [
          "identifiers",
          "identifiers"
        ],
        "created_at": "2000-01-23T04:56:07.000+00:00",
        "type": "password",
        "config": "{}",
        "version": 0
      }
    },
    "state_changed_at": "2000-01-23T04:56:07.000+00:00",
    "created_at": "2000-01-23T04:56:07.000+00:00",
    "external_id": "external_id",
    "recovery_addresses": [
      {
        "updated_at": "2000-01-23T04:56:07.000+00:00",
        "created_at": "2000-01-23T04:56:07.000+00:00",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "value": "value",
        "via": "via"
      },
      {
        "updated_at": "2000-01-23T04:56:07.000+00:00",
        "created_at": "2000-01-23T04:56:07.000+00:00",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "value": "value",
        "via": "via"
      }
    ],
    "metadata_admin": "",
    "updated_at": "2000-01-23T04:56:07.000+00:00",
    "verifiable_addresses": [
      {
        "updated_at": "2014-01-01T23:28:56.782Z",
        "verified_at": "2000-01-23T04:56:07.000+00:00",
        "verified": true,
        "created_at": "2014-01-01T23:28:56.782Z",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "value": "value",
        "status": "status",
        "via": "email"
      },
      {
        "updated_at": "2014-01-01T23:28:56.782Z",
        "verified_at": "2000-01-23T04:56:07.000+00:00",
        "verified": true,
        "created_at": "2014-01-01T23:28:56.782Z",
        "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
        "value": "value",
        "status": "status",
        "via": "email"
      }
    ],
    "organization_id": "organization_id",
    "schema_id": "schema_id",
    "schema_url": "schema_url",
    "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "state": "active",
    "metadata_public": ""
  },
  "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"
}