API reference OpenAPI 3.1
POST /auth/login

Login

Public — no authentication application/json operation login

Request

Content type: application/json · required

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

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

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

Responses

200 OK session or MFA challenge. First login with an invite-issued temporary password returns tokens plus must_change_password:true; data calls then 403 with code auth.password_change_required until POST /auth/password/change clears the flag. application/json
{
  "access_token": "<jwt>",
  "refresh_token": "<opaque>",
  "access_expires_in": 900,
  "must_change_password": false,
  "session_id": "ses_01M3R..."
}
Response fields
FieldTypeRequiredDescription
access_token string No —
refresh_token string No —
access_expires_in integer No —
must_change_password boolean No —
mfa_required boolean No —
challenge_id string No —

Error responses

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

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