Initialize recovery flow for browsers
Endpoint
Query parameters
URL to redirect the browser to after successful recovery.
Response
The flow ID, used to fetch and submit the flow.
The flow type:
browser or api.Time when this flow expires (RFC3339 format).
Time when this flow was issued (RFC3339 format).
The original request URL.
Current state of the flow:
choose_method, sent_email, or passed_challenge.UI container with form fields and messages.
Status codes
| Status | Description |
|---|---|
| 200 | Recovery flow created (AJAX requests) |
| 303 | Redirect to recovery UI with flow ID |
| 400 | Invalid request |
Initialize recovery flow for native apps
Endpoint
Response
Returns the same recovery flow object as the browser endpoint.Status codes
| Status | Description |
|---|---|
| 200 | Recovery flow created successfully |
| 400 | Invalid request |
Get recovery flow
Endpoint
Query parameters
The recovery flow ID from the
flow URL query parameter.Headers
HTTP Cookie header for browser flows. Required for CSRF validation.
Response
Returns the recovery flow object.Status codes
| Status | Description |
|---|---|
| 200 | Recovery flow found |
| 404 | Flow not found |
| 410 | Flow expired |
Submit recovery flow
The recovery flow has multiple states, each requiring different submissions:Choose method state
Submit the user’s email address to send a recovery link or code.Sent email state
Request another recovery email to be sent.Endpoint
Query parameters
The recovery flow ID.
Recovery token from the recovery link (used in
passed_challenge state).Headers
HTTP Cookie header for browser flows.
Request body
Recovery method:
link or code.User’s email address for recovery.
CSRF token from the flow (required for browser flows).
The recovery code sent to the user’s email.
Response
Updated flow state.
Updated UI with messages and form fields.
Next actions to take. When recovery succeeds, typically includes a settings flow to update the password.
Response (browser flows)
Browser flows behave differently: Inchoose_method state:
- 200 OK with updated flow (API/AJAX)
- 303 redirect to recovery UI (browser)
sent_email state:
- 200 OK with updated flow (API/AJAX)
- 303 redirect to recovery UI with success message (browser)
passed_challenge state (valid recovery link):
- 303 redirect to settings UI to update password
passed_challenge state (invalid recovery link):
- 303 redirect to recovery UI with error message
Status codes
| Status | Description |
|---|---|
| 200 | Flow updated successfully |
| 303 | Redirect (browser flows) |
| 400 | Form validation errors |
| 410 | Flow expired |
| 422 | Browser location change required |
Recovery flow states
The recovery flow progresses through these states:- choose_method - User selects recovery method and provides email
- sent_email - Recovery email sent, user can request another
- passed_challenge - User clicked recovery link, redirect to settings
Error responses
Common validation errors:emailis required - No email providedCould not find email- Email not associated with any accountRecovery token is invalid- Token expired or already usedsecurity_csrf_violation- CSRF token validation failed