SalesOS.

Two Factor Authentication

Two-factor authentication setup and verification

Get 2FA status for current user

GET
/v1/auth/2fa/status

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X GET "https://api.salesos.org/v1/auth/2fa/status" \
  -H "Authorization: Bearer <token>"

Initialize 2FA setup - returns QR code and secret

POST
/v1/auth/2fa/setup

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X POST "https://api.salesos.org/v1/auth/2fa/setup" \
  -H "Authorization: Bearer <token>"

Verify 2FA setup with TOTP code

POST
/v1/auth/2fa/verify-setup

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

Request Body

application/jsonRequired
codeRequiredstring

TOTP code or backup code

curl -X POST "https://api.salesos.org/v1/auth/2fa/verify-setup" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "123456"
  }'

Verify TOTP code during login

POST
/v1/auth/2fa/verify

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

Request Body

application/jsonRequired
codeRequiredstring

TOTP code or backup code

curl -X POST "https://api.salesos.org/v1/auth/2fa/verify" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "123456"
  }'

Disable 2FA for current user

POST
/v1/auth/2fa/disable

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

Request Body

application/jsonRequired
passwordRequiredstring

Current password for verification

curl -X POST "https://api.salesos.org/v1/auth/2fa/disable" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "password": "string"
  }'

Get backup codes status

GET
/v1/auth/2fa/backup-codes

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X GET "https://api.salesos.org/v1/auth/2fa/backup-codes" \
  -H "Authorization: Bearer <token>"

Regenerate backup codes

POST
/v1/auth/2fa/regenerate-backup-codes

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X POST "https://api.salesos.org/v1/auth/2fa/regenerate-backup-codes" \
  -H "Authorization: Bearer <token>"

Get list of trusted devices

GET
/v1/auth/2fa/trusted-devices

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X GET "https://api.salesos.org/v1/auth/2fa/trusted-devices" \
  -H "Authorization: Bearer <token>"

Add a trusted device

POST
/v1/auth/2fa/trusted-devices

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

Request Body

application/jsonRequired
deviceNameRequiredstring

Device name

deviceTypeRequiredstring

Device type

browserInfostring

Browser information

ipAddressstring

IP address

locationstring

Location

deviceFingerprintRequiredstring

Unique device fingerprint

curl -X POST "https://api.salesos.org/v1/auth/2fa/trusted-devices" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceName": "Chrome on MacBook Pro",
    "deviceType": "desktop",
    "browserInfo": "string",
    "ipAddress": "string",
    "location": "string",
    "deviceFingerprint": "string"
  }'

Remove all trusted devices

DELETE
/v1/auth/2fa/trusted-devices

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

curl -X DELETE "https://api.salesos.org/v1/auth/2fa/trusted-devices" \
  -H "Authorization: Bearer <token>"

Remove a trusted device

DELETE
/v1/auth/2fa/trusted-devices/{deviceId}

Authorization

AuthorizationRequiredBearer <token>

Enter your JWT token

In: header

Path Parameters

deviceIdRequiredstring
curl -X DELETE "https://api.salesos.org/v1/auth/2fa/trusted-devices/<string>" \
  -H "Authorization: Bearer <token>"