Аутентификация

Register

post

Регистрация нового пользователя.

Body

Схема для регистрации нового пользователя

emailstring · emailRequired

Email пользователя

passwordstring · min: 6 · max: 100Required

Пароль (минимум 6 символов)

Responses
201

Successful Response

application/json
post
/api/auth/register
POST /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"
}

Login

post

Авторизация пользователя и получение access и refresh токенов.

Body

Схема для авторизации пользователя

emailstring · emailRequired

Email пользователя

passwordstringRequired

Пароль

Responses
post
/api/auth/login
POST /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"
}

Get Current User Info

get

Получение данных текущего авторизованного пользователя.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
get
/api/auth/me
GET /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"
}

Logout

post

Выход из системы - отзывает refresh токен в БД.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
post
/api/auth/logout
POST /api/auth/logout HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful Response

No content

Refresh Token

post

Обновление access токена с помощью refresh токена.

Body

Схема запроса для обновления токена

refresh_tokenstringRequired

Refresh токен

Responses
post
/api/auth/refresh-token
POST /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"
}

Последнее обновление