Create Registration Flow for Native Apps
GEThttps://accounts.<domain>/auth/self-service/registration/api
This endpoint initiates a registration 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
will be returned unless the URL query parameter ?refresh=true
is set.
To fetch an existing registration flow call /registration/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.
In the case of an error, the error.id
of the JSON response body can be one of:
session_already_available
: The user is already signed in.
security_csrf_violation
: Unable to fetch the flow because a CSRF violation occurred.
This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).
Request
Query Parameters
EnableSessionTokenExchangeCode requests the login flow to include a code that can be used to retrieve the session token after the login flow has been completed.
The URL to return the browser to after the flow was completed.
Responses
- 200
- 400
- default
registrationFlow
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [password
, totp
, oidc
, webauthn
, lookup_secret
, code
]
and so on.
ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated.
ID represents the flow's unique ID. When performing the registration flow, this
represents the id in the registration ui's query parameter: http://<selfservice.flows.registration.ui_url>/?flow=
IssuedAt is the time (UTC) when the flow occurred.
OAuth 2.0 Login Challenge.
This value is set using the login_challenge
query parameter of the registration and login endpoints.
If set will cooperate with OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider.
oauth2_login_request object
RequestURL is the initial URL that was requested. It can be used to forward information contained in the URL's path or query for example.
ReturnTo contains the requested return_to URL.
SessionTokenExchangeCode holds the secret code that the client can use to retrieve a session token after the flow has been completed. This is only set if the client has requested a session token exchange code, and if the flow is of type "api", and only on creating the flow.
State represents the state of this request:
choose_method: ask the user to choose a method (e.g. registration with email) sent_email: the email has been sent to the user passed_challenge: the request was successful and the registration challenge was passed.
TransientPayload is used to pass data from the registration to a webhook
The flow type can either be api
or browser
.
ui objectrequired
{
"active": "password",
"expires_at": "2025-04-17T12:10:30.826Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"issued_at": "2025-04-17T12:10:30.826Z",
"oauth2_login_challenge": "string",
"oauth2_login_request": {
"AdditionalProperties": {},
"challenge": "string",
"client": {
"AdditionalProperties": {},
"access_token_strategy": "string",
"allowed_cors_origins": [
"string"
],
"audience": [
"string"
],
"authorization_code_grant_access_token_lifespan": "string",
"authorization_code_grant_id_token_lifespan": "string",
"authorization_code_grant_refresh_token_lifespan": "string",
"backchannel_logout_session_required": true,
"backchannel_logout_uri": "string",
"client_credentials_grant_access_token_lifespan": "string",
"client_id": "string",
"client_name": "string",
"client_secret": "string",
"client_secret_expires_at": 0,
"client_uri": "string",
"contacts": [
"string"
],
"created_at": "2025-04-17T12:10:30.826Z",
"frontchannel_logout_session_required": true,
"frontchannel_logout_uri": "string",
"grant_types": [
"string"
],
"implicit_grant_access_token_lifespan": "string",
"implicit_grant_id_token_lifespan": "string",
"jwks_uri": "string",
"jwt_bearer_grant_access_token_lifespan": "string",
"logo_uri": "string",
"metadata": {},
"owner": "string",
"policy_uri": "string",
"post_logout_redirect_uris": [
"string"
],
"redirect_uris": [
"string"
],
"refresh_token_grant_access_token_lifespan": "string",
"refresh_token_grant_id_token_lifespan": "string",
"refresh_token_grant_refresh_token_lifespan": "string",
"registration_access_token": "string",
"registration_client_uri": "string",
"request_object_signing_alg": "string",
"request_uris": [
"string"
],
"response_types": [
"string"
],
"scope": "string",
"sector_identifier_uri": "string",
"skip_consent": true,
"subject_type": "string",
"token_endpoint_auth_method": "string",
"token_endpoint_auth_signing_alg": "string",
"tos_uri": "string",
"updated_at": "2025-04-17T12:10:30.826Z",
"userinfo_signed_response_alg": "string"
},
"oidc_context": {
"AdditionalProperties": {},
"acr_values": [
"string"
],
"display": "string",
"id_token_hint_claims": {},
"login_hint": "string",
"ui_locales": [
"string"
]
},
"request_url": "string",
"requested_access_token_audience": [
"string"
],
"requested_scope": [
"string"
],
"session_id": "string",
"skip": true,
"subject": "string"
},
"organization_id": "string",
"request_url": "string",
"return_to": "string",
"session_token_exchange_code": "string",
"transient_payload": {},
"type": "string",
"ui": {
"action": "string",
"messages": [
{
"context": {},
"id": 0,
"text": "string",
"type": "info"
}
],
"method": "string",
"nodes": [
{
"attributes": {},
"group": "default",
"messages": [
{
"context": {},
"id": 0,
"text": "string",
"type": "info"
}
],
"meta": {
"label": {
"context": {},
"id": 0,
"text": "string",
"type": "info"
}
},
"type": "text"
}
]
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X GET 'https://accounts.<domain>/auth/self-service/registration/api' \
-H 'Accept: application/json'