---
title: "Create a Recovery Link"
method: POST
path: "/admin/recovery/link"
tags: ["identity"]
---

# Create a Recovery Link

`POST /admin/recovery/link`

This endpoint creates a recovery link which should be given to the user in order for them to recover
(or activate) their account.

## Query parameters

- `return_to` string

## Request body

- CreateRecoveryLinkForIdentityBody — Create Recovery Link for Identity Request Body
  - `expires_in` string — Link Expires In The recovery link will expire after that amount of time has passed. Defaults to the configuration value of `selfservice.methods.code.config.lifespan`.
  - `identity_id` string, uuid, required — Identity to Recover The identity's ID you wish to recover.

## Response `200`

recoveryLinkForIdentity

- RecoveryLinkForIdentity — Used when an administrator creates a recovery link for an identity.
  - `expires_at` string, date-time — Recovery Link Expires At The timestamp when the recovery link expires.
  - `recovery_link` string, required — Recovery Link This link can be used to recover the account.

## Other responses

- `400` — errorGeneric
- `404` — errorGeneric
- `default` — errorGeneric

## Changes

- **2024-02-20** `4f071812f3ea` — 1 info
  - added the new optional `query` request parameter `return_to`
- **2023-01-14** `3f9901877db9` — 1 info
  - the endpoint scheme security `oryAccessToken` was added to the API
- **2022-12-02** `b6e5ffa30d4c` — 1 breaking, 4 info
  - the `identity_id` request property type/format changed from `string`/`uuid4` to `string`/`uuid`
  - api operation id `adminCreateSelfServiceRecoveryLink` removed and replaced with `createRecoveryLinkForIdentity`
  - api tag `identity` added
  - api tag `v0alpha2` removed
  - …1 more
- **2022-03-22** `028a4cf83c15` — 1 info
  - endpoint added
- **2021-05-05** `381c760af46e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ory/apis/ory-identities-api/changes/admin/recovery/link/post.md)

---

[API](https://skmtc.dev/ory/apis/ory-identities-api.md) · [All operations](https://skmtc.dev/ory/apis/ory-identities-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ory/ory-identities-api/revisions/7a0df90e2f13/schema)
