---
url: /apidocs/auth.md
---
## Authorization API

| Endpoint | Method | Description |
|-----|-----|-----|
| ~~[/auth/signout](#logout)~~ | webRequest | Logout |
| [/api/v1/auth/signout](#logout) | webRequest | Logout |
| ~~[/auth/isEmailVerified](#check-email-is-verified)~~ | webRequest | Check email is verified |
| [/api/v1/auth/isEmailVerified](#check-email-is-verified) | webRequest | Check email is verified |
| [/auth/link/openid-connect/{providerId}](#link-social-network-account-to-user-using-open-id-connect-oidc-protocol) | webRequest | Link social network account to user using Open Id Connect (OIDC) protocol |
| [/auth/link/apple](#link-apple-account-to-user) | webRequest | Link Apple account to user |
| [/auth/link/facebook](#link-facebook-account-to-user) | webRequest | Link Facebook account to user |
| [/auth/link/verus/idLogin](#link-account-with-verus) | webRequest | Link account with Verus |
| [/auth/link/verus/idLoginV2](#link-account-with-verus-v2-) | webRequest | Link account with Verus (v2) |
| [/auth/link/verus/idLogin/testnet](#link-account-with-verus-testnet-) | webRequest | Link account with Verus (TESTNET) |
| [/auth/link/verus/checkChallenge](#check-verus-challenge-for-link-account) | webRequest | Check Verus challenge for link account |
| ~~[/auth/check](#check-if-user-is-authorized)~~ | webRequest | Check if user is authorized |
| [/api/v1/auth/check](#check-if-user-is-authorized) | webRequest | Check if user is authorized |
| ~~[/auth/requestEmailVerification](#request-email-verification)~~ | webRequest | Request email verification |
| [/api/v1/auth/requestEmailVerification](#request-email-verification) | webRequest | Request email verification |
| ~~[/auth/isEmailAvailable](#check-email-availability)~~ | webRequest | Check email availability |
| [/api/v1/auth/isEmailAvailable](#check-email-availability) | webRequest | Check email availability |
| ~~[/auth/isEmailTaken](#check-email-is-taken)~~ | webRequest | Check email is taken |
| [/api/v1/auth/isEmailTaken](#check-email-is-taken) | webRequest | Check email is taken |
| [/auth/getRedirectUrlForOP](#get-redirect-url-for-openid-provider-authorization) | webRequest | Get redirect url for OpenID Provider authorization |
| [/auth/openid-connect/{providerId}](#authorize-user-using-open-id-connect-oidc-protocol) | webRequest | Authorize user using Open Id Connect (OIDC) protocol |
| [/auth/apple](#authorize-using-apple-code) | webRequest | Authorize using Apple code |
| [/auth/verus/idLogin](#authorize-user-with-verus) | webRequest | Authorize user with Verus |
| [/auth/verus/idLoginV2](#authorize-user-with-verus-v2-) | webRequest | Authorize user with Verus (v2) |
| [/auth/verus/idLogin/testnet](#authorize-user-with-verus-testnet-) | webRequest | Authorize user with Verus (TESTNET) |
| [/auth/verus/idLogin/testnetExt](#authorize-user-with-verus-testnet-) | webRequest | Authorize user with Verus (TESTNET) |
| [/auth/verus/idLoginResponseMobile](#send-verus-login-response-from-mobile-to-crypto-server) | webRequest | Send Verus login response from mobile to crypto server |
| [/auth/verus/idLoginResponseMobileTestnet](#send-verus-login-response-from-mobile-to-crypto-server-testnet-) | webRequest | Send Verus login response from mobile to crypto server (TESTNET) |
| [/auth/verus/checkChallenge](#check-verus-challenge-for-authorization) | webRequest | Check Verus challenge for authorization |
| ~~[/auth/signin](#regular-login)~~ | webRequest | Regular login |
| [/api/v1/auth/signin](#regular-login) | webRequest | Regular login |
| ~~[/auth/signup](#regular-registration)~~ | webRequest | Regular registration |
| [/api/v1/auth/signup](#regular-registration) | webRequest | Regular registration |
| ~~[/auth/registerByToken](#register-by-token)~~ | webRequest | Register by token |
| [/api/v1/auth/registerByToken](#register-by-token) | webRequest | Register by token |
| [/auth/requestPasswordRestore](#request-password-restore) | webRequest | Request password restore |
| ~~[/auth/sendRestorePasswordCode](#send-restore-password-code)~~ | webRequest | Send restore password code |
| [/api/v1/auth/sendRestorePasswordCode](#send-restore-password-code) | webRequest | Send restore password code |
| ~~[/auth/checkRestorePasswordCode](#check-restore-password-code)~~ | webRequest | Check restore password code |
| [/api/v1/auth/checkRestorePasswordCode](#check-restore-password-code) | webRequest | Check restore password code |
| ~~[/auth/restorePasswordByCode](#restore-password-by-code)~~ | webRequest | Restore password by code |
| [/api/v1/auth/restorePasswordByCode](#restore-password-by-code) | webRequest | Restore password by code |
| [/api/v1/auth/getOneTimeAuthToken](#get-one-time-auth-token) | webRequest | Get one time auth token |
| [/api/v1/auth/checkOneTimeAuthToken/{token}](#check-one-time-auth-token) | webRequest | Check one time auth token |
| [auth:verusIdLogin](#verus-id-login) | websocket | Verus ID Login |
| [auth:verusIdLoginTestnet](#verus-id-login-valuverse-testnet-) | websocket | Verus ID Login (VALUVERSE TESTNET) |
| [auth:verusIdLoginTestnetExt](#verus-id-login-verus-testnet-) | websocket | Verus ID Login (VERUS TESTNET) |
| [auth:verusLinkIdLogin](#link-verus-account-with-verus-id-login) | websocket | Link Verus account with Verus ID Login |
| [auth:verusLinkIdLoginTestnet](#link-verus-account-with-verus-id-login-valuverse-testnet-) | websocket | Link Verus account with Verus ID Login (VALUVERSE TESTNET) |
| [auth:verusLinkIdLoginTestnetExt](#link-verus-account-with-verus-id-login-verus-testnet-) | websocket | Link Verus account with Verus ID Login (VERUS TESTNET) |
| [auth:verusLinkPersonaAccount](#link-valuverse-persona-using-verus-id-login) | websocket | Link Valuverse persona using Verus ID Login |
| [auth:verusSimulateVerusIdLoginResponse](#simulate-verus-id-login-response-valuverse-testnet-) | websocket | Simulate Verus Id login response (VALUVERSE TESTNET) |
| [auth:testChabadUniverseCredentials](#test-chabad-universe-credentials) | websocket | Test chabad universe credentials |
| [auth:verusAuthSuccess](#verus-authorization-success-event) | websocketEvent | Verus authorization success event |
| [auth:verusAuthError](#verus-authorization-error-event) | websocketEvent | Verus authorization error event |
| [auth:verusLinkSuccess](#verus-link-account-success-event) | websocketEvent | Verus link account success event |
| [auth:verusLinkError](#verus-link-account-error-event) | websocketEvent | Verus link account error event |

### Logout

**HTTP Method:** POST

**Path:** /auth/signout

**DEPRECATED**

**Description:** Api drops users session.

**Headers:**

X-Session-Id: sessionId

**Request:**

**Response:**

### Logout

**HTTP Method:** POST

**Path:** /api/v1/auth/signout

**Description:** Api drops users session.

**Headers:**

X-Session-Id: sessionId

**Request:**

**Response:**

### Check email is verified

**HTTP Method:** POST

**Path:** /auth/isEmailVerified

**DEPRECATED**

**Request:**

**Response:**

### Check email is verified

**HTTP Method:** POST

**Path:** /api/v1/auth/isEmailVerified

**Request:**

**Response:**

### Link social network account to user using Open Id Connect (OIDC) protocol

**HTTP Method:** GET

**Path:** /auth/link/openid-connect/{providerId}

**Description:** API redirects to provider authorization page. API requires valid **redirect_uri** to client.

* On success provider redirects to valuverse server with authorization code. Then valuverse server validates authorization code with provider, fetches user info, links social account to user and redirects to **redirect_uri**.

* On failure, server redirects to **redirect_uri** with `error={error}` in query params.

Available providers:

* `google`
* `facebook`
* `apple`
* `epam`
* `epam.social`
* `merkos302`

In case when `epam.social` provider is selected, client must also select one of epam social networks (**socialId**): `google`, `facebook`, `linkedin`

**Parameters:**

redirect_uri: string

socialId: string (used only for `epam.social` provider)

**Request:**

**Response:**

### Link Apple account to user

**HTTP Method:** POST

**Path:** /auth/link/apple

**Request:**

**Response:**

### Link Facebook account to user

**HTTP Method:** POST

**Path:** /auth/link/facebook

**Request:**

**Response:**

### Link account with Verus

**HTTP Method:** POST

**Path:** /auth/link/verus/idLogin

**Description:** Verus link account for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/link/verus/checkChallenge` endpoint for checking Verus link account result.

**Request:**

**Response:**

### Link account with Verus (v2)

**HTTP Method:** POST

**Path:** /auth/link/verus/idLoginV2

**Description:** Verus link account for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/link/verus/checkChallenge` endpoint for checking Verus link account result.

**Request:**

**Response:**

### Link account with Verus (TESTNET)

**HTTP Method:** POST

**Path:** /auth/link/verus/idLogin/testnet

**Description:** Verus link account for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/link/verus/checkChallenge` endpoint for checking Verus link account result.

**Request:**

**Response:**

### Check Verus challenge for link account

**HTTP Method:** POST

**Path:** /auth/link/verus/checkChallenge

**Description:** Checks Verus link account result after `/auth/link/verus/idLogin`.

**Request:**

**Response:**

### Check if user is authorized

**HTTP Method:** GET

**Path:** /auth/check

**DEPRECATED**

**Description:** Api returns 200 Ok if user is authorized, and 401 Unauthorized if not.

**Request:**

**Response:**

### Check if user is authorized

**HTTP Method:** GET

**Path:** /api/v1/auth/check

**Description:** Api returns `401: Unauthorized` error in case if user is not authorized.

**Request:**

**Response:**

### Request email verification

**HTTP Method:** POST

**Path:** /auth/requestEmailVerification

**DEPRECATED**

**Description:** Returns http status 429 (StatusTooManyRequests) in case if email verification requests are more frequent than 1 per minute.

**Request:**

**Response:**

### Request email verification

**HTTP Method:** POST

**Path:** /api/v1/auth/requestEmailVerification

**Description:** Api returns `705: Too frequent request` error in case if email verification requests are more frequent than 1 per minute.

**Request:**

**Response:**

### Check email availability

**HTTP Method:** POST

**Path:** /auth/isEmailAvailable

**DEPRECATED**

**Request:**

**Response:**

### Check email availability

**HTTP Method:** POST

**Path:** /api/v1/auth/isEmailAvailable

**Request:**

**Response:**

### Check email is taken

**HTTP Method:** POST

**Path:** /auth/isEmailTaken

**DEPRECATED**

**Request:**

**Response:**

### Check email is taken

**HTTP Method:** POST

**Path:** /api/v1/auth/isEmailTaken

**Request:**

**Response:**

### Get redirect url for OpenID Provider authorization

**HTTP Method:** GET

**Path:** /auth/getRedirectUrlForOP

**Parameters:**

opAuthReqId: string

sessionId: string

**Request:**

**Response:**

### Authorize user using Open Id Connect (OIDC) protocol

**HTTP Method:** GET

**Path:** /auth/openid-connect/{providerId}

**Description:** API redirects to provider authorization page. API requires valid **redirect_uri** to client.

* On success provider redirects to valuverse server with authorization code. Then valuverse server validates authorization code with provider, fetches user info, creates new user if needed, creates user session and redirects to **redirect_uri** with `sessionId={sessionId}` and `isNew={true/false}` in query params.

* On failure, server redirects to **redirect_uri** with `error={error}` in query params.

Available providers:

* `google`
* `facebook`
* `apple`
* `epam`
* `epam.social`
* `merkos302`
* `merkos302new`
* `merkos302staging`

In case when `epam.social` provider is selected, client must also select one of epam social networks (**socialId**): `google`, `facebook`, `linkedin`

**Parameters:**

redirect_uri: string

networkId: string

deviceId: string

socialId: string (used only for `epam.social` provider)

**Request:**

**Response:**

### Authorize using Apple code

**HTTP Method:** POST

**Path:** /auth/apple

**Headers:**

X-Network: networkId

X-Device-Id: deviceId

**Request:**

**Response:**

### Authorize user with Verus

**HTTP Method:** POST

**Path:** /auth/verus/idLogin

**Description:** Verus authorization for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/verus/checkChallenge` endpoint for checking Verus authorization result.

**Request:**

**Response:**

### Authorize user with Verus (v2)

**HTTP Method:** POST

**Path:** /auth/verus/idLoginV2

**Description:** Verus authorization for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/verus/checkChallenge` endpoint for checking Verus authorization result.

**Request:**

**Response:**

### Authorize user with Verus (TESTNET)

**HTTP Method:** POST

**Path:** /auth/verus/idLogin/testnet

**Description:** Verus authorization for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/verus/checkChallenge` endpoint for checking Verus authorization result.

**Request:**

**Response:**

### Authorize user with Verus (TESTNET)

**HTTP Method:** POST

**Path:** /auth/verus/idLogin/testnetExt

**Description:** Verus authorization for mobile platforms. Endpoint creates Verus challenge and returns `challengeId` and `deeplink`. Client opens Verus application with deeplink and authorizes with Verus account. After successful authorization, Verus application redirects client to `redirectUrl`. When client returned to Valuverse application it should call `/auth/verus/checkChallenge` endpoint for checking Verus authorization result.

**Request:**

**Response:**

### Send Verus login response from mobile to crypto server

**HTTP Method:** POST

**Path:** /auth/verus/idLoginResponseMobile

**Request:**

**Response:**

### Send Verus login response from mobile to crypto server (TESTNET)

**HTTP Method:** POST

**Path:** /auth/verus/idLoginResponseMobileTestnet

**Request:**

**Response:**

### Check Verus challenge for authorization

**HTTP Method:** POST

**Path:** /auth/verus/checkChallenge

**Description:** Checks Verus authorization result after `/auth/verus/idLogin`.

**Request:**

**Response:**

### Regular login

**HTTP Method:** POST

**Path:** /auth/signin

**DEPRECATED**

**Description:** Api returns 400 HTTP error in case of login failure.

**Headers:**

X-Network: networkId  // creates session within provided network (alternatively use url param networkId)

X-Socket-Id: socketId // send anonymousAuthorized event after login (alternatively use url param socketId)

**Request:**

**Response:**

### Regular login

**HTTP Method:** POST

**Path:** /api/v1/auth/signin

**Headers:**

X-Network: networkId  // creates session within provided network (alternatively use url param networkId)

X-Socket-Id: socketId // send anonymousAuthorized event after login (alternatively use url param socketId)

**Request:**

**Response:**

### Regular registration

**HTTP Method:** POST

**Path:** /auth/signup

**DEPRECATED**

**Description:** Api returns 400 HTTP error in case of registration failure. If verificationToken provided in request, api will try to register verified user. It will return error in case if verificationToken is invalid or mismatches with provided email.

**Headers:**

X-Network: networkId // Creates session within provided network

**Request:**

**Response:**

### Regular registration

**HTTP Method:** POST

**Path:** /api/v1/auth/signup

**Description:** If verificationToken provided in request, api will try to register verified user. It will return error in case if verificationToken is invalid or mismatches with provided email.

**Headers:**

X-Network: networkId // Creates session within provided network

**Request:**

**Response:**

### Register by token

**HTTP Method:** POST

**Path:** /auth/registerByToken

**DEPRECATED**

**Description:** returns 400 HTTP error in case of registration failure. If verificationToken provided in request, api will try to register verified user. It will return error in case if verificationToken is invalid or mismatches with provided email.

**Headers:**

X-Network: networkId // Creates session within provided network

**Request:**

**Response:**

### Register by token

**HTTP Method:** POST

**Path:** /api/v1/auth/registerByToken

**Description:** If verificationToken provided in request, api will try to register verified user. It will return error in case if verificationToken is invalid or mismatches with provided email.

**Headers:**

X-Network: networkId // Creates session within provided network

**Request:**

**Response:**

### Request password restore

**HTTP Method:** POST

**Path:** /auth/requestPasswordRestore

**Description:** returns 400 HTTP error in case of request error

**Request:**

**Response:**

### Send restore password code

**HTTP Method:** POST

**Path:** /auth/sendRestorePasswordCode

**DEPRECATED**

**Description:** Api sends an email message with 6-digit code that should be used in order to restore user password. Restore password code lives for 20 minutes and becomes invalid after that time.

* Api returns `1021: User not found` error in case when invalid email provided.

**Request:**

**Response:**

### Send restore password code

**HTTP Method:** POST

**Path:** /api/v1/auth/sendRestorePasswordCode

**Description:** Api sends an email message with 6-digit code that should be used in order to restore user password. Restore password code lives for 20 minutes and becomes invalid after that time.

* Api returns `1021: User not found` error in case when invalid email provided.

**Request:**

**Response:**

### Check restore password code

**HTTP Method:** POST

**Path:** /auth/checkRestorePasswordCode

**DEPRECATED**

**Description:** Api checks if provided restore password code is valid.

* Api returns `1021: User not found` error in case when invalid email provided.

* Api returns `705: Too frequent request` error in case when user tries to check code more than 5 times in 2 minutes.

* Api returns `1051: Verification token not found` error in case when invalid code provided.

**Request:**

**Response:**

### Check restore password code

**HTTP Method:** POST

**Path:** /api/v1/auth/checkRestorePasswordCode

**Description:** Api checks if provided restore password code is valid.

* Api returns `1021: User not found` error in case when invalid email provided.

* Api returns `705: Too frequent request` error in case when user tries to check code more than 5 times in 2 minutes.

* Api returns `1051: Verification token not found` error in case when invalid code provided.

**Request:**

**Response:**

### Restore password by code

**HTTP Method:** POST

**Path:** /auth/restorePasswordByCode

**DEPRECATED**

**Description:** Api changes user password using restore password code.

* Api returns `1021: User not found` error in case when invalid email provided.

* Api returns `705: Too frequent request` error in case when user tries to restore password more than 5 times in 2 minutes.

* Api returns `1006: Invalid password` error in case when invalid new password provided.

* Api returns `1051: Verification token not found` error in case when invalid code provided.

* Api returns `1054: Verification token is already used` error in case when restore code have already been used.

**Request:**

**Response:**

### Restore password by code

**HTTP Method:** POST

**Path:** /api/v1/auth/restorePasswordByCode

**Description:** Api changes user password using restore password code.

* Api returns `1021: User not found` error in case when invalid email provided.

* Api returns `705: Too frequent request` error in case when user tries to restore password more than 5 times in 2 minutes.

* Api returns `1006: Invalid password` error in case when invalid new password provided.

* Api returns `1051: Verification token not found` error in case when invalid code provided.

* Api returns `1054: Verification token is already used` error in case when restore code have already been used.

**Request:**

**Response:**

### Get one time auth token

**HTTP Method:** POST

**Path:** /api/v1/auth/getOneTimeAuthToken

**Request:**

**Response:**

### Check one time auth token

**HTTP Method:** POST

**Path:** /api/v1/auth/checkOneTimeAuthToken/{token}

**Request:**

**Response:**

### Verus ID Login

**Method:** websocket

**Endpoint:** auth:verusIdLogin

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusAuthSuccess` or `auth:verusAuthError` event.

**Request:**

**Response:**

### Verus ID Login (VALUVERSE TESTNET)

**Method:** websocket

**Endpoint:** auth:verusIdLoginTestnet

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusAuthSuccess` or `auth:verusAuthError` event.

**Request:**

**Response:**

### Verus ID Login (VERUS TESTNET)

**Method:** websocket

**Endpoint:** auth:verusIdLoginTestnetExt

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusAuthSuccess` or `auth:verusAuthError` event.

**Request:**

**Response:**

### Link Verus account with Verus ID Login

**Method:** websocket

**Endpoint:** auth:verusLinkIdLogin

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusLinkSuccess` or `auth:verusLinkError` event.

**Request:**

**Response:**

### Link Verus account with Verus ID Login (VALUVERSE TESTNET)

**Method:** websocket

**Endpoint:** auth:verusLinkIdLoginTestnet

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusLinkSuccess` or `auth:verusLinkError` event.

**Request:**

**Response:**

### Link Verus account with Verus ID Login (VERUS TESTNET)

**Method:** websocket

**Endpoint:** auth:verusLinkIdLoginTestnetExt

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusLinkSuccess` or `auth:verusLinkError` event.

**Request:**

**Response:**

### Link Valuverse persona using Verus ID Login

**Method:** websocket

**Endpoint:** auth:verusLinkPersonaAccount

**Description:** Endpoint returns deeplink that should be used for Verus authorization. After Verus authorization is finished, server sends `auth:verusLinkPersonaAccountResult` event.

**Request:**

**Response:**

### Simulate Verus Id login response (VALUVERSE TESTNET)

**Method:** websocket

**Endpoint:** auth:verusSimulateVerusIdLoginResponse

**Request:**

**Response:**

### Test chabad universe credentials

**Method:** websocket

**Endpoint:** auth:testChabadUniverseCredentials

**Description:** Test Chabad Universe credentials by sending a test request to the Chabad Universe API. This endpoint requires the user to have superadmin permissions.

**Request:**

**Response:**

### Verus authorization success event

**Event:** auth:verusAuthSuccess

**Description:** Event is emitted after Verus login have been completed and crypto server verifies challengeId. Client should be reconnected with new session id (new socket connection required).

**Data:**

### Verus authorization error event

**Event:** auth:verusAuthError

**Description:** Event is emitted in case if Verus login fails or challengeId verification fails.

**Data:**

### Verus link account success event

**Event:** auth:verusLinkSuccess

**Description:** Event is emitted after Verus link account have been completed and crypto server verifies challengeId.

**Data:**

### Verus link account error event

**Event:** auth:verusLinkError

**Description:** Event is emitted in case if Verus link account fails or challengeId verification fails.

**Data:**
