Client permissions

Use these methods to manage permission levels that are used to indicate the operations that clients are allowed to make in the B2Core UI.

The permission levels are associated with verification levels. When clients obtain a particular verification level, they are granted the permissions associated with this level.

GET[host]/api/v2/clients/roles

Get a list of permission levels

GET[host]/api/v2/clients/roles/{roleId}

Get permission level details

POST[host]api/v2/clients/roles

Create a new permission level

PATCH[host]/api/v2/clients/roles/{roleId}

Update a permission level

DELETE[host]/api/v2/clients/roles/{roleId}

Delete a permission level

Use these methods to manage permissions granted to a specific client.

GET[host]/api/v2/clients/{clientId}/permissions

Get client permissions

PUT[host]/api/v2/clients/{clientId}/permissions

Update client permissions

Get a list of permission levels

Use this method to obtain a list of permission levels configured in the Back Office.

To obtain the detailed information about a specific permission level, use a separate method to get permission level details.

Request

Header parameters:

  • Authorization: Bearer <token>

GET[host]/api/v2/clients/roles

curl --location --request GET 'https://host.name/api/v2/clients/roles' \
--header 'Authorization: Bearer <token>'

Response

A response includes an array of Permission Level objects providing information about the permission levels configured in the Back Office.

Get permission level details

Use this method to obtain the detailed information about a specific permission level.

To obtain a list of available permission levels configured in the Back Office, use a separate method to get a list of permission levels.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

roleId required

The identifier of a permission level.

GET[host]/api/v2/clients/roles/{roleId}

curl --location --request GET 'https://host.name/api/v2/clients/roles/1' \
--header 'Authorization: Bearer <token>'

Response

A response includes a Permission Level object providing the information about a specified permission level.

Create a new permission level

Use this method to create a new permission level.

Request

Header parameters:

  • Authorization: Bearer <token>

Body:

Specify the following parameters for a permission level:

name string required

The permission level name.

title string required

The permission level name used in the Back Office.

parentId integer required

The identifier of a previous permission level that clients must obtain before they can get this level.

permissions array required

An array of string values specifying the operations that clients are allowed to make in the B2Core UI. Possible values:

  • verification — clients can obtain a higher verification level

  • converter — clients can exchange funds

  • deposits — clients can deposit funds to their wallets or trading accounts

  • withdrawals — clients can withdraw funds from their wallets or trading accounts

  • internal_transfers — clients can transfer funds to the wallets and trading accounts of other clients registered on the same B2Core UI instance

POST[host]api/v2/clients/roles

curl --location --request POST 'https://host.name/api/v2/clients/roles' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "Level 1",
  "title": "Level 1",
  "parentId": 1,
  "permissions": [
    "verification",
    "deposits"
  ]
}'

Response

A response includes a Permission Level object providing the information about the created level.

Update a permission level

Use this method to update a specified permission level.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

roleId required

The identifier of a permission level that you want to update.

Body:

The following field values can be updated:

name string

The permission level name.

title string

The permission level name used in the Back Office

parentId integer

The identifier of a previous permission level that clients must obtain before they can get this level.

permissions array

An array of string values specifying the operations that clients are allowed to make in the B2Core UI. Possible values:

  • verification — clients can obtain a higher verification level

  • converter — clients can exchange funds

  • deposits — clients can deposit funds to their wallets or trading accounts

  • withdrawals — clients can withdraw funds from their wallets or trading accounts

  • internal_transfers — clients can transfer funds to the wallets and trading accounts of other clients registered on the same B2Core UI instance

PATCH[host]/api/v2/clients/roles/{roleId}

curl --location --request PATCH 'https://host.name/api/v2/clients/roles/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "Level 2",
  "title": "Level 2",
  "parentId": 1,
  "permissions": [
    "verification",
    "deposits",
    "withdrawals"
  ]
}'

Response

A response includes a Permission Level object providing the information about the updated level.

Delete a permission level

Use this method to remove a specified permission level.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

roleId required

The identifier of a permission level

DELETE[host]/api/v2/clients/roles/{roleId}

curl --location --request DELETE 'https://host.nameg/api/v2/clients/roles/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.

Get client permissions

Use this method to get the data about the permissions granted to a specific client.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The client identifier.

GET[host]/api/v2/clients/{clientId}/permissions

curl --location --request GET 'https://host.name/api/v2/clients/1/permissions' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of objects providing the data about the operations that a specified client is allowed to make in the B2Core UI:

name string

The operation name. Possible values:

  • verification — a client can obtain a higher verification level

  • converter — a client can exchange funds

  • deposits — a client can deposit funds to their wallets or trading accounts

  • withdrawals — a client can withdraw funds from their wallets or trading accounts

  • internal_transfers — a client can transfer funds to the wallets and trading accounts of other clients registered on the same B2Core UI instance

isEnabled boolean

If true, a client is allowed to make an operation; otherwise, false.

RESPONSE EXAMPLE
[
  {
    "name": "verification",
    "isEnabled": true
  },
  {
    "name": "converter",
    "isEnabled": true
  },
  {
    "name": "deposits",
    "isEnabled": true
  },
  {
    "name": "withdrawals",
    "isEnabled": false
  },
  {
    "name": "internal_transfers",
    "isEnabled": false
  }
]

Update client permissions

Use this method to change the permissions granted to a specific client.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

clientId required

The client identifier.

Body:

Specify the permissions that you want to grant to a specified client:

permissions array required

An array of string values specifying the operations that a client is allowed to make in the B2Core UI. Possible values:

  • verification — a client can obtain a higher verification level

  • converter — a client can exchange funds

  • deposits — a client can deposit funds to their wallets or trading accounts

  • withdrawals — a client can withdraw funds from their wallets or trading accounts

  • internal_transfers — a client can transfer funds to the wallets and trading accounts of other clients registered on the same B2Core UI instance

PUT[host]/api/v2/clients/{clientId}/permissions

curl --location --request PUT 'https://host.name/api/v2/clients/1/permissions' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "permissions": [
    "verification",
    "deposits",
    "withdrawals"    
  ]
}'

Response

A response contains an array of objects providing the data about the operations that a specified client is allowed to make in the B2Core UI:

name string

The operation name.

isEnabled boolean

If true, a client is allowed to make an operation; otherwise, false.

RESPONSE EXAMPLE
[
  {
    "name": "verification",
    "isEnabled": true
  },
  {
    "name": "converter",
    "isEnabled": false
  },
  {
    "name": "deposits",
    "isEnabled": true
  },
  {
    "name": "withdrawals",
    "isEnabled": true
  },
  {
    "name": "internal_transfers",
    "isEnabled": false
  }
]