User recovery API
POST /v1/users/{id}/recovery — send or return a set-password link for an existing identity
Create a password recovery / set-password link for an existing user. This is not the organisation invite API. Invites that should create membership and a first-password experience must use Organisation invites.
| Method | POST |
| Path | /v1/users/{id}/recovery |
| Scope | users:write |
| Success | 200 OK |
Request
| Field | Type | Default | Description |
|---|---|---|---|
return_to | https URI | — | Allowlisted URL after the user sets a password |
send | boolean | true | When false, do not email; return recovery_link |
email | boolean | — | Legacy alias of send. email: false is treated as send: false |
An empty body is valid and emails the recovery template.
Response
Wocha sends mail (send true)
Silent link (send false)
The hosted URL is rewritten onto id.wocha.ai/recovery so the session cookie lands on the Auth origin. Query params include return_to (when allowlisted) and org_id when the identity has an org hint. Completing the token persists those values in cookies before Kratos finishes the flow.
SDKs
Loading playground…
Errors
| Status | Code | When |
|---|---|---|
400 | validation_error | Identity has no email, or return_to is not allowlisted |
404 | not_found | User not found in this tenant |
502 | upstream_error | Identity service failed to create the link |
503 | service_unavailable | Identity service is not configured |