Аутентификация
Регистрация нового пользователя.
Body
Схема для регистрации нового пользователя
emailstring · emailRequired
Email пользователя
passwordstring · min: 6 · max: 100Required
Пароль (минимум 6 символов)
Responses
201
Successful Response
application/json
422
Validation Error
application/json
post
/api/auth/registerPOST /api/auth/register HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"email": "[email protected]",
"password": "text"
}{
"id": 1,
"email": "text",
"created_at": "2025-12-08T00:08:05.874Z"
}Авторизация пользователя и получение access и refresh токенов.
Body
Схема для авторизации пользователя
emailstring · emailRequired
Email пользователя
passwordstringRequired
Пароль
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/api/auth/loginPOST /api/auth/login HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"email": "[email protected]",
"password": "text"
}{
"access_token": "text",
"refresh_token": "text",
"token_type": "bearer"
}Получение данных текущего авторизованного пользователя.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Successful Response
application/json
get
/api/auth/meGET /api/auth/me HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
Successful Response
{
"id": 1,
"email": "text",
"created_at": "2025-12-08T00:08:05.874Z"
}Выход из системы - отзывает refresh токен в БД.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Successful Response
application/json
post
/api/auth/logoutPOST /api/auth/logout HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
Successful Response
No content
Обновление access токена с помощью refresh токена.
Body
Схема запроса для обновления токена
refresh_tokenstringRequired
Refresh токен
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/api/auth/refresh-tokenPOST /api/auth/refresh-token HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"refresh_token": "text"
}{
"access_token": "text",
"refresh_token": "text",
"token_type": "bearer"
}Последнее обновление