Request a password reset code
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@acme.com"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code"
payload := strings.NewReader("{\n \"email\": \"user@acme.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@acme.com'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code"
payload = { "email": "user@acme.com" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}Request a password reset code
Mails a one-time code to a member who cannot sign in. PUBLIC: this route takes NO bearer token, because the caller has no way to obtain one.
Available only where the deployment enables password recovery.
First of two calls. The second is POST /v1/users/forgot-password/reset, which spends the code and sets the new password. Possession of the emailed code is the only credential in the flow.
On success the response has no body (204). It answers the same way whether or not the address belongs to a known member, so the route cannot be used to enumerate them.
Failures:
400— the e-mail is missing or malformed.
POST
/
v1
/
users
/
forgot-password
/
send-code
Request a password reset code
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@acme.com"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code"
payload := strings.NewReader("{\n \"email\": \"user@acme.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@acme.com'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://identity.sandbox.lerian.net/v1/users/forgot-password/send-code"
payload = { "email": "user@acme.com" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}Cuerpo
application/json
Who is asking to reset their password.
Ejemplo:
"user@acme.com"
Respuesta
No Content
¿Esta página le ayudó?

