Reset password
curl --request PATCH \
--url https://{host}/v1/password-resets/{token} \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "password-resets",
"attributes": {
"clientId": "9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34",
"email": "jeffrey@example.test",
"password": "the-one-they-chose-now"
}
}
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'password-resets',
attributes: {
clientId: '9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34',
email: 'jeffrey@example.test',
password: 'the-one-they-chose-now'
}
}
})
};
fetch('https://{host}/v1/password-resets/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/password-resets/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'password-resets',
'attributes' => [
'clientId' => '9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34',
'email' => 'jeffrey@example.test',
'password' => 'the-one-they-chose-now'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/password-resets/{token}"
payload = { "data": {
"type": "password-resets",
"attributes": {
"clientId": "9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34",
"email": "jeffrey@example.test",
"password": "the-one-they-chose-now"
}
} }
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Authentication
Reset password
Scope: none — this happens before there is a token.
The address as well as the token: a token on its own does not say who it is
for. A token that has expired, been used, or belongs to another address is
refused with 422 and code: reset_failed.
The new password needs at least 8 characters.
Every “remember me” session on every device ends with it, and every app token is revoked. Somebody who had to reset a password may have lost control of the account, and leaving those standing is the one thing they came here to prevent.
PATCH
/
v1
/
password-resets
/
{token}
Reset password
curl --request PATCH \
--url https://{host}/v1/password-resets/{token} \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "password-resets",
"attributes": {
"clientId": "9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34",
"email": "jeffrey@example.test",
"password": "the-one-they-chose-now"
}
}
}
'const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'password-resets',
attributes: {
clientId: '9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34',
email: 'jeffrey@example.test',
password: 'the-one-they-chose-now'
}
}
})
};
fetch('https://{host}/v1/password-resets/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/password-resets/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'password-resets',
'attributes' => [
'clientId' => '9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34',
'email' => 'jeffrey@example.test',
'password' => 'the-one-they-chose-now'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/password-resets/{token}"
payload = { "data": {
"type": "password-resets",
"attributes": {
"clientId": "9f2c1b7e-4d3a-4f61-9c8b-2e5a7d0f1b34",
"email": "jeffrey@example.test",
"password": "the-one-they-chose-now"
}
} }
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}