Create a Recovery Link
POST/iam/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.
Request
- application/json
Body
expires_instring
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.
Possible values: Value must match regular expression ^[0-9]+(ns|us|ms|s|m|h)$
identity_idstring<uuid>required
Identity to Recover
The identity's ID you wish to recover.
Responses
- 200
- 400
- 404
- default
recoveryLinkForIdentity
- application/json
- Schema
- Example (auto)
Schema
expires_atstring<date-time>
Recovery Link Expires At
The timestamp when the recovery link expires.
recovery_linkstringrequired
Recovery Link
This link can be used to recover the account.
{
"expires_at": "2024-07-29T15:51:28.071Z",
"recovery_link": "string"
}
errorGeneric
- application/json
- Schema
- Example (auto)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (auto)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
errorGeneric
- application/json
- Schema
- Example (auto)
Schema
error objectrequired
{
"error": {
"code": 404,
"debug": "SQL field \"foo\" is not a bool.",
"details": {},
"id": "string",
"message": "The resource could not be found",
"reason": "User with ID 1234 does not exist.",
"request": "d7ef54b1-ec15-46e6-bccb-524b82c035e6",
"status": "Not Found"
}
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://connhex.com/iam/recovery/link");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"expires_in\": \"string\",\n \"identity_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());