Skip to content

Документация внутреннего API Felmee (0.0.2)

Общий формат ответа для всех REST endpoints:

{
  "success": true,
  "message": "...",
  "codeError": null,
  "data": {}
}
Download OpenAPI description
Languages
Servers
Production
https://felmee.com

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

Авторизация и токены

Operations

Отправить OTP на телефон

Request

Отправляет одноразовый код (OTP) на номер телефона.

Headers
captcha-tokenstringrequired

Токен капчи

Bodyapplication/jsonrequired
recipientstringrequired

Телефон в любом "человеческом" формате, сервер нормализует

Example: "+79991234567"
curl -i -X POST \
  https://felmee.com/api/auth/phone/send/otp \
  -H 'Content-Type: application/json' \
  -H 'captcha-token: string' \
  -d '{
    "recipient": "+79991234567"
  }'

Responses

OTP отправлен

Bodyapplication/json
successbooleanrequired
Example: true
messagestringrequired
Example: "OK"
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
dataany or nullrequired

Полезная нагрузка (может быть null)

Response
application/json
{ "success": true, "message": "OTP code sent successfully", "codeError": null, "data": null }

Логин по телефону и OTP

Request

Возвращает пару токенов JWT (access) и RT (refresh).

Bodyapplication/jsonrequired
phonestringrequired
Example: "+79991234567"
otpstringrequired

OTP код

Example: "123456"
curl -i -X POST \
  https://felmee.com/api/auth/phone/login \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "+79991234567",
    "otp": "123456"
  }'

Responses

Успешная авторизация (JWT + RT)

Bodyapplication/json
dataobject or nullrequired

Полезная нагрузка (может быть null)

data.​JWTstringrequired

Access token (JWT)

data.​RTstringrequired

Refresh token

successbooleanrequired
messagestringrequired
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
Response
application/json
{ "success": true, "message": "The authorization process has been completed successfully!", "codeError": null, "data": { "JWT": "<access_token>", "RT": "<refresh_token>" } }

Отправить email со ссылкой для входа

Request

Отправляет письмо со ссылкой на вход (если пользователь существует). Сервер не раскрывает факт наличия аккаунта.

Headers
captcha-tokenstringrequired

Токен капчи

Bodyapplication/jsonrequired
recipientstring(email)required
Example: "user@example.com"
curl -i -X POST \
  https://felmee.com/api/auth/email/send/login-link \
  -H 'Content-Type: application/json' \
  -H 'captcha-token: string' \
  -d '{
    "recipient": "user@example.com"
  }'

Responses

Ответ всегда успешный (если аккаунт есть — письмо будет отправлено)

Bodyapplication/json
successbooleanrequired
Example: true
messagestringrequired
Example: "OK"
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
dataany or nullrequired

Полезная нагрузка (может быть null)

Response
application/json
{ "success": true, "message": "If an account with this email exists, we will send a login link to this address.", "codeError": null, "data": null }

Отправить OTP для привязки email

Request

Отправляет OTP для привязки email. Код отправляется только если email ещё не зарегистрирован. Требуется JWT.

Security
bearerAuth or jwtCookie
Headers
captcha-tokenstringrequired

Токен капчи

Bodyapplication/jsonrequired
recipientstring(email)required
Example: "user@example.com"
curl -i -X POST \
  https://felmee.com/api/auth/email/send/otp \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'captcha-token: string' \
  -d '{
    "recipient": "user@example.com"
  }'

Responses

Ответ успешный (код отправится только при доступности email)

Bodyapplication/json
successbooleanrequired
Example: true
messagestringrequired
Example: "OK"
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
dataany or nullrequired

Полезная нагрузка (может быть null)

Response
application/json
{ "success": true, "message": "If the address is available for binding, we will send a code to it.", "codeError": null, "data": null }

Привязать email к текущему пользователю

Request

Подтверждение email через OTP и привязка к текущему пользователю.

Security
bearerAuth or jwtCookie
Bodyapplication/jsonrequired
emailstring(email)required
Example: "user@example.com"
otpstringrequired
Example: "123456"
curl -i -X PUT \
  https://felmee.com/api/auth/email/add \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "user@example.com",
    "otp": "123456"
  }'

Responses

Email успешно добавлен

Bodyapplication/json
successbooleanrequired
Example: true
messagestringrequired
Example: "OK"
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
dataany or nullrequired

Полезная нагрузка (может быть null)

Response
application/json
{ "success": true, "message": "Email successfully added!", "codeError": null, "data": null }

Обновить access token по refresh token

Request

Обновляет пару токенов (JWT + RT) по refresh token. Refresh token передаётся:

  • header: RT: Bearer <refresh_token> или
  • cookie: RT=<refresh_token>
Security
refreshTokenHeader or refreshTokenCookie
curl -i -X POST \
  https://felmee.com/api/auth/refresh-token \
  -H 'RT: YOUR_API_KEY_HERE'

Responses

Токены успешно обновлены

Bodyapplication/json
dataobject or nullrequired

Полезная нагрузка (может быть null)

data.​JWTstringrequired

Access token (JWT)

data.​RTstringrequired

Refresh token

successbooleanrequired
messagestringrequired
codeErrorstring or nullrequired

Код ошибки (null в случае успеха)

One of:

Код ошибки (null в случае успеха)

string
Response
application/json
{ "success": true, "message": "Token refreshed successfully", "codeError": null, "data": { "JWT": "<new_access_token>", "RT": "<new_refresh_token>" } }

API работы с файлами

Загрузка и получение файлов

Operations