Update Registration Flow
POSThttps://accounts.<domain>/auth/self-service/registration
Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint behaves differently for API and browser flows.
API flows expect application/json
to be sent in the body and respond with
HTTP 200 and a application/json body with the created identity success - if the session hook is configured the
session
and session_token
will also be included;
HTTP 410 if the original flow expired with the appropriate error messages set and optionally a use_flow_id
parameter in the body;
HTTP 400 on form validation errors.
Browser flows expect a Content-Type of application/x-www-form-urlencoded
or application/json
to be sent in the body and respond with
a HTTP 303 redirect to the post/after registration URL or the return_to
value if it was set and if the registration succeeded;
a HTTP 303 redirect to the registration UI URL with the flow ID containing the validation errors otherwise.
Browser flows with an accept header of application/json
will not redirect but instead respond with
HTTP 200 and a application/json body with the signed in identity and a Set-Cookie
header on success;
HTTP 303 redirect to a fresh login flow if the original flow expired with the appropriate error messages set;
HTTP 400 on form validation errors.
If this endpoint is called with Accept: application/json
in the header, the response contains the flow without a redirect. 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.
security_identity_mismatch
: The requested ?return_to
address is not allowed to be used. Adjust this in the configuration!
browser_location_change_required
: Usually sent when an AJAX request indicates that the browser needs to open a specific URL.
Most likely used in Social Sign In flows.
Request
Query Parameters
The Registration Flow ID
The value for this parameter comes from flow
URL Query parameter sent to your
application (e.g. /registration?flow=abcde
).
Header Parameters
HTTP Cookies
When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected.
- application/json
- application/x-www-form-urlencoded
Body
required
- updateRegistrationFlowWithPasswordMethod
- updateRegistrationFlowWithOidcMethod
- updateRegistrationFlowWithWebAuthnMethod
- updateRegistrationFlowWithCodeMethod
The CSRF Token
Method to use
This field must be set to password
when using the password method.
Password to sign the user up with
The identity's traits
Transient data to pass along to any webhooks
The CSRF Token
IDToken is an optional id token provided by an OIDC provider
If submitted, it is verified using the OIDC provider's public key set and the claims are used to populate
the OIDC credentials of the identity.
If the OIDC provider does not store additional claims (such as name, etc.) in the IDToken itself, you can use
the traits
field to populate the identity's traits. Note, that Apple only includes the users email in the IDToken.
Supported providers are Apple
IDTokenNonce is the nonce, used when generating the IDToken. If the provider supports nonce validation, the nonce will be validated against this value and is required.
Method to use
This field must be set to oidc
when using the oidc method.
The provider to register with
The identity traits
Transient data to pass along to any webhooks
UpstreamParameters are the parameters that are passed to the upstream identity provider.
These parameters are optional and depend on what the upstream identity provider supports.
Supported parameters are:
login_hint
(string): The login_hint
parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session.
hd
(string): The hd
parameter limits the login/registration process to a Google Organization, e.g. mycollege.edu
.
prompt
(string): The prompt
specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. select_account
.
CSRFToken is the anti-CSRF token
Method
Should be set to "webauthn" when trying to add, update, or remove a webAuthn pairing.
The identity's traits
Transient data to pass along to any webhooks
Register a WebAuthn Security Key
It is expected that the JSON returned by the WebAuthn registration process is included here.
Name of the WebAuthn Security Key to be Added
A human-readable name for the security key which will be added.
The OTP Code sent to the user
The CSRF Token
Method to use
This field must be set to code
when using the code method.
Resend restarts the flow with a new code
The identity's traits
Transient data to pass along to any webhooks
Body
required
- updateRegistrationFlowWithPasswordMethod
- updateRegistrationFlowWithOidcMethod
- updateRegistrationFlowWithWebAuthnMethod
- updateRegistrationFlowWithCodeMethod
The CSRF Token
Method to use
This field must be set to password
when using the password method.
Password to sign the user up with
The identity's traits
Transient data to pass along to any webhooks
The CSRF Token
IDToken is an optional id token provided by an OIDC provider
If submitted, it is verified using the OIDC provider's public key set and the claims are used to populate
the OIDC credentials of the identity.
If the OIDC provider does not store additional claims (such as name, etc.) in the IDToken itself, you can use
the traits
field to populate the identity's traits. Note, that Apple only includes the users email in the IDToken.
Supported providers are Apple
IDTokenNonce is the nonce, used when generating the IDToken. If the provider supports nonce validation, the nonce will be validated against this value and is required.
Method to use
This field must be set to oidc
when using the oidc method.
The provider to register with
The identity traits
Transient data to pass along to any webhooks
UpstreamParameters are the parameters that are passed to the upstream identity provider.
These parameters are optional and depend on what the upstream identity provider supports.
Supported parameters are:
login_hint
(string): The login_hint
parameter suppresses the account chooser and either pre-fills the email box on the sign-in form, or selects the proper session.
hd
(string): The hd
parameter limits the login/registration process to a Google Organization, e.g. mycollege.edu
.
prompt
(string): The prompt
specifies whether the Authorization Server prompts the End-User for reauthentication and consent, e.g. select_account
.
CSRFToken is the anti-CSRF token
Method
Should be set to "webauthn" when trying to add, update, or remove a webAuthn pairing.
The identity's traits
Transient data to pass along to any webhooks
Register a WebAuthn Security Key
It is expected that the JSON returned by the WebAuthn registration process is included here.
Name of the WebAuthn Security Key to be Added
A human-readable name for the security key which will be added.
The OTP Code sent to the user
The CSRF Token
Method to use
This field must be set to code
when using the code method.
Resend restarts the flow with a new code
The identity's traits
Transient data to pass along to any webhooks
Responses
- 200
- 303
- 400
- 410
- 422
- default
successfulNativeRegistration
- application/json
- Schema
- Example (from schema)
Schema
continue_with object[]
identity objectrequired
session object
The Session Token
This field is only set when the session hook is configured as a post-registration hook.
A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization Header:
Authorization: bearer ${session-token}
The session token is only issued for API flows, not for Browser flows!
{
"continue_with": [
{},
{},
{},
{}
],
"identity": {
"created_at": "2025-04-17T12:10:30.823Z",
"credentials": {},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organization_id": "string",
"recovery_addresses": [
{
"created_at": "2025-04-17T12:10:30.823Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"updated_at": "2025-04-17T12:10:30.823Z",
"value": "string",
"via": "string"
}
],
"schema_id": "string",
"schema_url": "string",
"state": "active",
"state_changed_at": "2025-04-17T12:10:30.823Z",
"updated_at": "2025-04-17T12:10:30.823Z",
"verifiable_addresses": [
{
"created_at": "2014-01-01T23:28:56.782Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "string",
"updated_at": "2014-01-01T23:28:56.782Z",
"value": "string",
"verified": true,
"verified_at": "2025-04-17T12:10:30.823Z",
"via": "email"
}
]
},
"session": {
"active": true,
"authenticated_at": "2025-04-17T12:10:30.823Z",
"authentication_methods": [
{
"aal": "aal0",
"completed_at": "2025-04-17T12:10:30.823Z",
"method": "link_recovery",
"organization": "string",
"provider": "string"
}
],
"authenticator_assurance_level": "aal0",
"devices": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ip_address": "string",
"location": "string",
"user_agent": "string"
}
],
"expires_at": "2025-04-17T12:10:30.823Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"identity": {
"created_at": "2025-04-17T12:10:30.823Z",
"credentials": {},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organization_id": "string",
"recovery_addresses": [
{
"created_at": "2025-04-17T12:10:30.823Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"updated_at": "2025-04-17T12:10:30.823Z",
"value": "string",
"via": "string"
}
],
"schema_id": "string",
"schema_url": "string",
"state": "active",
"state_changed_at": "2025-04-17T12:10:30.823Z",
"updated_at": "2025-04-17T12:10:30.823Z",
"verifiable_addresses": [
{
"created_at": "2014-01-01T23:28:56.782Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "string",
"updated_at": "2014-01-01T23:28:56.782Z",
"value": "string",
"verified": true,
"verified_at": "2025-04-17T12:10:30.823Z",
"via": "email"
}
]
},
"issued_at": "2025-04-17T12:10:30.823Z",
"tokenized": "string"
},
"session_token": "string"
}
Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201.
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.824Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"issued_at": "2025-04-17T12:10:30.824Z",
"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.824Z",
"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.824Z",
"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"
}
}
errorBrowserLocationChangeRequired
- application/json
- Schema
- Example (from schema)
Schema
error object
Points to where to redirect the user to next.
{
"error": {
"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"
}
},
"redirect_browser_to": "string"
}
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 POST 'https://accounts.<domain>/auth/self-service/registration' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"csrf_token": "string",
"method": "string",
"password": "string",
"traits": {},
"transient_payload": {}
}'