API reference OpenAPI 3.1
POST /auth/password/set

Password set

Set initial password (invite accept) or reset via single-use token.

Public — no authentication application/json operation passwordSet

Request

Content type: application/json · required

FieldTypeRequiredDescription
token string Yes —
new_password string Yes —
curl -X POST "$MONICHEK_API/auth/password/set" \
  -H "Content-Type: application/json" \
  -d '{
  "token": "<token>",
  "new_password": "<password>"
}'
const res = await fetch(`${MONICHEK_API}/auth/password/set`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "token": "<token>",
    "new_password": "<password>"
  }),
});

const data = await res.json();
import os
import requests

res = requests.post(
    f"{os.environ['MONICHEK_API']}/auth/password/set",
    json={
      "token": "<token>",
      "new_password": "<password>"
    },
)
print(res.json())
$ch = curl_init(getenv('MONICHEK_API') . '/auth/password/set');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'token' => '<token>',
        'new_password' => '<password>',
    ]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Responses

200 OK set application/json

No response example is published for this status.

Error responses

StatusMeaningBody
401 Unauthorized RFC 9457 problem
422 Unprocessable Entity RFC 9457 problem

Errors use the RFC 9457 problem format with a stable code.