brave-rainbow-46970
04/17/2025, 1:13 PMbrief-egg-61061
04/17/2025, 1:13 PMbrief-egg-61061
04/17/2025, 1:14 PMCreateRecoveryLinkForIdentity
API endpoint. This endpoint creates a recovery link for an identity, but it doesn't automatically send the link to the user - you need to handle that part separately. The CreateRecoveryLinkForIdentity
endpoint only generates the recovery link and returns it in the response. According to the documentation, you need to manually send this link to the user's email address. Here's how the process works: 1. You call the API endpoint to create a recovery link for a specific identity 2. The API returns the recovery link in the response 3. You need to extract this link from the response and send it to the user yourself This is actually by design, as explained in the [Invite users](https://www.ory.sh/docs/kratos/manage-identities/invite-users) documentation: 1. You create a basic user account for the user you want to invite. You use their email address as the account identifier. 2. You trigger account recovery for the user account you created. 3. You get the recovery link from the API response and send it to the user's email address. 4. The user performs account recovery which forces them to define new credentials. 5. The user gets a fully functional account with the credentials they defined.
The API response will look something like this: json { "recovery_link": "https://{project-slug}.<http://projects.oryapis.com/self-service/recovery?flow=b6c81504-dc8e-4786-b849-ac292bc9f317&token=VjKUKGU7J4YAonC5b5q1hDySJjWGh3qf|projects.oryapis.com/self-service/recovery?flow=b6c81504-dc8e-4786-b849-ac292bc9f317&token=VjKUKGU7J4YAonC5b5q1hDySJjWGh3qf>", "expires_at": "2023-02-18T02:16:47.286385565Z" }
You need to extract the recovery_link
value and send it to the user via your own email delivery system.