---
title: "Подтверждение двухэтапной авторизации"
method: POST
path: "/auth/confirm"
tags: ["Авторизация"]
---

# Подтверждение двухэтапной авторизации

`POST /auth/confirm`

Подтверждает код двухэтапной авторизации и возвращает access и refresh token. Если после подтверждения пользователю требуется обязательная смена пароля, возвращает 403 с password_change_token для метода смены пароля.

## Headers

- `X-Lang` 'ru' | 'kk' | 'en' | 'es'

## Request body

- object
  - `email` string, email, required — Email пользователя панели
  - `code` string, required — Код подтверждения из письма
  - `sec_response` string, required — Ответ Yandex SmartCaptcha

## Response `200`

Успешная авторизация

- AuthData
  - `user_id` integer, required — ID пользователя панели
  - `access_token` string, required — JWT access token. В payload содержит `token_type`, `token_id` и `user_id`.
  - `refresh_token` string, required — Refresh token

## Other responses

- `400` — Неправильный запрос
- `401` — Пользователь не авторизован
- `403` — Доступ запрещен или требуется обязательная смена пароля
- `429` — Превышен лимит на количество запросов
- `500` — Внутренняя ошибка сервера
- `503` — Сервис недоступен или отключен

## Changes

> 10 revisions in range; 3 could not be searched.

- **2026-05-18** `f6e4c021cd18` — 1 warning
  - deleted the `header` request parameter `User-Agent`
- **2026-05-13** `7bed86251460` — 4 breaking
  - added `#/components/schemas/Error, #/components/schemas/PasswordChangeRequired` to the response body `oneOf` list for the response status `403`
  - the response's body type/format changed from `object`/`` to ``/`` for status `403`
  - removed the required property `code` from the response with the `403` status
  - removed the required property `error` from the response with the `403` status

[Change history](https://skmtc.dev/smartofood/apis/smartofood-admin-api/changes/auth/confirm/post.md)

---

[API](https://skmtc.dev/smartofood/apis/smartofood-admin-api.md) · [All operations](https://skmtc.dev/smartofood/apis/smartofood-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smartofood/smartofood-admin-api/revisions/c22dfa568481/schema)
