Two Factor Auth

GET

Generates a QR code for enabling two-factor authentication.

get
Responses
200
QR code generated successfully
application/json
get
GET /2fa/generate-qr HTTP/1.1
Host: 
Accept: */*
{
  "qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
  "link": "otpauth://totp/AppName:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=AppName"
}

POST

Enables two-factor authentication for the user.

post
Body
codestringRequired

Two-factor authentication code

Example: 123456
Responses
200
Two-factor authentication enabled successfully
application/json
ResponseanyExample: {"message":"Two-factor authentication enabled successfully","description":"Two-factor authentication has been enabled for your account."}
post
POST /2fa/enable-two-factor-auth HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "code": "123456"
}
{
  "message": "Two-factor authentication enabled successfully",
  "description": "Two-factor authentication has been enabled for your account."
}

Disables two-factor authentication for the user.

post
Responses
200
Two-factor authentication disabled successfully
application/json
ResponseanyExample: {"message":"Two-factor authentication disabled successfully","description":"Two-factor authentication has been disabled for your account."}
post
POST /2fa/disable-two-factor-auth HTTP/1.1
Host: 
Accept: */*
{
  "message": "Two-factor authentication disabled successfully",
  "description": "Two-factor authentication has been disabled for your account."
}

Authenticates the user using two-factor authentication code.

post
Body
codestringRequired

Two-factor authentication code

Example: 123456
Responses
200
Authentication successful
application/json
post
POST /2fa/authenticate HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "code": "123456"
}
{
  "accessToken": "access_token",
  "refreshToken": "refresh_token",
  "isTwoFactorEnable": true
}

Impersonates another user using two-factor authentication code. This endpoint is only available for admins of support team.

post
Body
userIdnumberRequiredExample: 1
teamIdnumberRequiredExample: 1
codestringRequiredExample: 123456
Responses
200
Impersonation successful
application/json
post
POST /2fa/impersonate HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "userId": 1,
  "teamId": 1,
  "code": "123456"
}
{
  "accessToken": "access_token",
  "isTwoFactorEnable": false
}

Cancels the impersonation and returns the original user's tokens.

post
Responses
200
Impersonation cancelled successfully
application/json
post
POST /2fa/desimpersonation HTTP/1.1
Host: 
Accept: */*
{
  "accessToken": "access_token",
  "refreshToken": "refresh_token"
}

Last updated