LegalStack

Вход сотрудников платформы

Аутентификация сотрудников платформы (staff).

Вход сотрудника поддержки (email + пароль)

POST
/api/v1/security/auth/staff/login

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/login" \  -H "Content-Type: application/json" \  -d '{    "email": "string",    "password": "string"  }'
{
  "accessToken": "string",
  "staff": {
    "createdAt": "string",
    "email": "string",
    "id": "string",
    "isActive": true,
    "lastLoginAt": "string",
    "name": "string",
    "totpEnabled": true
  }
}

Выход сотрудника (отзыв refresh-токена)

POST
/api/v1/security/auth/staff/logout
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/logout"
{
  "ok": true
}

Профиль текущего сотрудника

GET
/api/v1/security/auth/staff/profile
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/security/auth/staff/profile"
{
  "createdAt": "string",
  "email": "string",
  "id": "string",
  "isActive": true,
  "lastLoginAt": "string",
  "name": "string",
  "totpEnabled": true
}

Обновить access-токен сотрудника

POST
/api/v1/security/auth/staff/refresh

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/refresh" \  -H "Content-Type: application/json" \  -d '{}'
{
  "accessToken": "string",
  "refreshToken": "string"
}

Отключить 2FA сотрудника

POST
/api/v1/security/auth/staff/totp/disable
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/totp/disable"
{
  "ok": true
}

Перевыпустить резервные коды сотрудника

POST
/api/v1/security/auth/staff/totp/regenerate-backup
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/totp/regenerate-backup"
{
  "backupCodes": [
    "string"
  ]
}

Подтвердить настройку 2FA первым кодом

POST
/api/v1/security/auth/staff/totp/setup-confirm
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/totp/setup-confirm" \  -H "Content-Type: application/json" \  -d '{    "code": "string",    "setupId": "string"  }'
{
  "ok": true
}

Запустить настройку 2FA сотрудника

POST
/api/v1/security/auth/staff/totp/setup-init
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/totp/setup-init"
{
  "backupCodes": [
    "string"
  ],
  "setupId": "string",
  "totpUri": "string"
}

Подтверждение 2FA при входе сотрудника

POST
/api/v1/security/auth/staff/verify-totp

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/security/auth/staff/verify-totp" \  -H "Content-Type: application/json" \  -d '{    "challengeId": "string",    "code": "string"  }'
{
  "accessToken": "string",
  "staff": {
    "createdAt": "string",
    "email": "string",
    "id": "string",
    "isActive": true,
    "lastLoginAt": "string",
    "name": "string",
    "totpEnabled": true
  }
}