Create Settings Flow for Native Apps

GET {{baseUrl}}/self-service/settings/api

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.

HEADERS

KeyDatatypeRequiredDescription
X-Session-TokenstringThe Session Token of the Identity performing the settings flow.
Acceptstring

RESPONSES

status: OK

{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;type&quot;:&quot;\u003cstring\u003e&quot;,&quot;expires_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;issued_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;request_url&quot;:&quot;\u003cstring\u003e&quot;,&quot;ui&quot;:{&quot;action&quot;:&quot;\u003cstring\u003e&quot;,&quot;method&quot;:&quot;\u003cstring\u003e&quot;,&quot;nodes&quot;:[{&quot;type&quot;:&quot;text&quot;,&quot;group&quot;:&quot;webauthn&quot;,&quot;attributes&quot;:{&quot;name&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;text&quot;,&quot;disabled&quot;:&quot;\u003cboolean\u003e&quot;,&quot;node_type&quot;:&quot;input&quot;,&quot;autocomplete&quot;:&quot;one-time-code&quot;,&quot;label&quot;:{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;success&quot;,&quot;context&quot;:{}},&quot;onclick&quot;:&quot;\u003cstring\u003e&quot;,&quot;onload&quot;:&quot;\u003cstring\u003e&quot;,&quot;pattern&quot;:&quot;\u003cstring\u003e&quot;,&quot;required&quot;:&quot;\u003cboolean\u003e&quot;,&quot;value&quot;:{&quot;description&quot;:&quot;The input&#39;s value.&quot;,&quot;nullable&quot;:true}},&quot;messages&quot;:[{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;success&quot;,&quot;context&quot;:{}},{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;error&quot;,&quot;context&quot;:{}}],&quot;meta&quot;:{&quot;label&quot;:{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;error&quot;,&quot;context&quot;:{}}}},{&quot;type&quot;:&quot;input&quot;,&quot;group&quot;:&quot;webauthn&quot;,&quot;attributes&quot;:{&quot;name&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;number&quot;,&quot;disabled&quot;:&quot;\u003cboolean\u003e&quot;,&quot;node_type&quot;:&quot;img&quot;,&quot;autocomplete&quot;:&quot;url&quot;,&quot;label&quot;:{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;info&quot;,&quot;context&quot;:{}},&quot;onclick&quot;:&quot;\u003cstring\u003e&quot;,&quot;onload&quot;:&quot;\u003cstring\u003e&quot;,&quot;pattern&quot;:&quot;\u003cstring\u003e&quot;,&quot;required&quot;:&quot;\u003cboolean\u003e&quot;,&quot;value&quot;:{&quot;description&quot;:&quot;The input&#39;s value.&quot;,&quot;nullable&quot;:true}},&quot;messages&quot;:[{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;info&quot;,&quot;context&quot;:{}},{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;success&quot;,&quot;context&quot;:{}}],&quot;meta&quot;:{&quot;label&quot;:{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;error&quot;,&quot;context&quot;:{}}}}],&quot;messages&quot;:[{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;success&quot;,&quot;context&quot;:{}},{&quot;id&quot;:&quot;\u003clong\u003e&quot;,&quot;text&quot;:&quot;\u003cstring\u003e&quot;,&quot;type&quot;:&quot;success&quot;,&quot;context&quot;:{}}]},&quot;identity&quot;:{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;schema_id&quot;:&quot;\u003cstring\u003e&quot;,&quot;schema_url&quot;:&quot;\u003cstring\u003e&quot;,&quot;traits&quot;:{&quot;description&quot;:&quot;Traits represent an identity&#39;s traits. The identity is able to create, modify, and delete traits\nin a self-service manner. The input will always be validated against the JSON Schema defined\nin `schema_url`.&quot;},&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;credentials&quot;:{&quot;fugiat37a&quot;:{&quot;config&quot;:{},&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;identifiers&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;type&quot;:&quot;oidc&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;version&quot;:&quot;\u003clong\u003e&quot;},&quot;ut1&quot;:{&quot;config&quot;:{},&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;identifiers&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;type&quot;:&quot;totp&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;version&quot;:&quot;\u003clong\u003e&quot;}},&quot;metadata_admin&quot;:{&quot;description&quot;:&quot;NullJSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger and is NULLable-&quot;,&quot;nullable&quot;:true},&quot;metadata_public&quot;:{&quot;description&quot;:&quot;NullJSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger and is NULLable-&quot;,&quot;nullable&quot;:true},&quot;organization_id&quot;:&quot;\u003cstring\u003e&quot;,&quot;recovery_addresses&quot;:[{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;value&quot;:&quot;\u003cstring\u003e&quot;,&quot;via&quot;:&quot;\u003cstring\u003e&quot;,&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;},{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;value&quot;:&quot;\u003cstring\u003e&quot;,&quot;via&quot;:&quot;\u003cstring\u003e&quot;,&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;}],&quot;state&quot;:&quot;active&quot;,&quot;state_changed_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;verifiable_addresses&quot;:[{&quot;value&quot;:&quot;\u003cstring\u003e&quot;,&quot;verified&quot;:&quot;\u003cboolean\u003e&quot;,&quot;via&quot;:&quot;sms&quot;,&quot;status&quot;:&quot;\u003cstring\u003e&quot;,&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;verified_at&quot;:&quot;\u003cdateTime\u003e&quot;},{&quot;value&quot;:&quot;\u003cstring\u003e&quot;,&quot;verified&quot;:&quot;\u003cboolean\u003e&quot;,&quot;via&quot;:&quot;email&quot;,&quot;status&quot;:&quot;\u003cstring\u003e&quot;,&quot;created_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;updated_at&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;verified_at&quot;:&quot;\u003cdateTime\u003e&quot;}]},&quot;state&quot;:{&quot;description&quot;:&quot;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. \&quot;please use a valid phone number\&quot;) data was sent.&quot;},&quot;active&quot;:&quot;\u003cstring\u003e&quot;,&quot;continue_with&quot;:[{&quot;action&quot;:&quot;show_verification_ui&quot;,&quot;flow&quot;:{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;verifiable_address&quot;:&quot;\u003cstring\u003e&quot;,&quot;url&quot;:&quot;\u003cstring\u003e&quot;}},{&quot;action&quot;:&quot;show_verification_ui&quot;,&quot;flow&quot;:{&quot;id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;verifiable_address&quot;:&quot;\u003cstring\u003e&quot;,&quot;url&quot;:&quot;\u003cstring\u003e&quot;}}],&quot;return_to&quot;:&quot;\u003cstring\u003e&quot;,&quot;transient_payload&quot;:{}}