<@U04UQ68083H> Can i trigger a recovery email in o...
# ory-copilot
f
@chilly-king-10285 Can i trigger a recovery email in ory network via adminapi?
c
A message from kapa.ai
Yes, you can trigger a recovery process for a user in the Ory Network via the Admin API. However, it's important to note that currently, it's not possible to send the recovery link directly to a user's email. This feature is being tracked in issue [#595](https://github.com/ory/kratos/issues/595). Here are the steps to initiate the recovery process: 1. Send a request to the Admin API of your project to create a recovery link. This operation requires an API Key. The
expires_in
property sets the expiry time for the recovery link. If the user doesn't access the link before it expires, you must generate a new recovery link.
Copy code
bash curl --request POST -sL \    --header "Authorization: Bearer {ORY_API_KEY}" \    --header "Content-Type: application/json" \    --data '{    "expires_in": "12h",    "identity_id": "{ACCOUNT_ID}"    }' https://{project-slug}.<http://projects.oryapis.com/admin/recovery/link|projects.oryapis.com/admin/recovery/link>
2. The response contains a
recovery_link
with the flow ID and a random token. The user must access the link to recover the account. Upon accessing the link, the user can connect to a social sign-in provider or set up a new password.
Copy code
json {     "recovery_link": "<https://playground.projects.oryapis.com/self-service/recovery?flow=81c55cec-76fd-4907-bddf-cc112e835698&token=yM9nAZpPIjwccKh9qHRh8OfywZSRcr6q>",     "expires_at": "2022-02-25T03:09:37.60684766Z"   }
For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/manage-identities/account-recovery#magic-links).