API reference OpenAPI 3.1
POST /auth/mfa/verify

Mfa verify

Public — no authentication application/json operation mfaVerify

Request

Content type: application/json · required

FieldTypeRequiredDescription
code string Yes —
challenge_id string Yes —
curl -X POST "$MONICHEK_API/auth/mfa/verify" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "string",
  "challenge_id": "id_01M3R..."
}'
const res = await fetch(`${MONICHEK_API}/auth/mfa/verify`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "code": "string",
    "challenge_id": "id_01M3R..."
  }),
});

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

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

Responses

200 OK session issued with access/refresh tokens plus must_change_password flag application/json
{
  "access_token": "<jwt>",
  "refresh_token": "<opaque>",
  "access_expires_in": 900,
  "must_change_password": false
}

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.