User management

This section describes the User creation process with a minimal required set of parameters.

circle-check

The newly created user should be assigned at least one trading account, so the request body contains user details and a section for specifying the account details. Please note that creating a user with minimal parameters requires only a name for your trading account. If a trader should have multiple accounts with different rules it is worth considering the account preset entity. If this is the case, during the account creation you need to specify the preset ID and it will automatically be applied to a newly created account.

You can check the list of all presets created on a server using the GET/accountPresets method or refer to a corresponding section of this doc for a more detailed description.

Also, the user should be allocated to a specific user group, please note that in this case, the user and his accounts inherit all settings from it.

The account is created with a server currency by default (Configuration > Settings > General) and is in an Active state (ready for trade after the deposit). New currency settings will be applied if they are overridden on the higher level.

In response, you will receive the ID of the newly created user/account, keep it on your side, because the account ID will be used in your following requests, i.e. to perform deposit or other account operations. Remember, that you can always get the account ID and other user details by User ID.

Create User

POST /users

The method is used to create a new user. This example describes a minimal set of parameters required for this process. For the full set of parameters available for a new user, please refer to Swagger.

Body

Name
Type
Description

email

string

Email of new user

firstName

string

Name of new user

lastName

string

Last name of new user

login

string

Login of new user

password

string

Password for new user

userGroup

integer

ID of the user group to which this user will be assigned

accounts

Section with account details

accountName

string

Name of the account that will be created for this user

Request body

CURL

Response

As a result, you will get a user ID, login name, account ID, and account name in response. Standard errors can be received as well.

Find user (by login, e-mail, etc.)

GET/users

This method is used to get the names of available users and their IDs. All users can be filtered using various parameters like brandingId, email, userGroupId. The required parameter should be simply specified in the query.

Query

Name
Type
Description

brandingId

string

Branding identifier.

email

string

Filter users by e-mail.

login

string

Filter records by user login. Several logins can be specified using comma separator.

offset

string

Defines the initial index number of outputting records.

planId

string

Identifier of the plan. Any type of plan can be set here (Risk plan, Swap plan, etc.).

userGroupId

string

Identifier of the user group.

CURL example (users are filtered by userGroupId)

Response

As a result, you will get a user ID and login name of the users assigned to the group specified in the request (ID 570789). Standard errors can be received as well.

circle-check

Move user between groups

PATCH /users/{id}

The PATCH method is used to update specific user settings by his ID. This section describes moving users between groups. Transferring a user to another group can be useful in that the user will inherit the trading rules of this group or another scheduler tasks set will be applied to him.

circle-check

Request example

Please note that the request body contains the ID of the user group to which this user will be moved (so in the example our user will be moved to the group whose ID is 42495). The ID of the user, who will be transferred to another group, should be specified in the path, see CURL.

CURL

Response

You will get a 204 message in response. This means that the user is moved successfully.

User status management

PATCH /users/{id}

The PATCH method is used to update specific user settings by his ID. This section describes the updating status of certain users. The following statuses are available: Locked, Unlocked, Locked after brute force, Need activation and Expired.

Path

Name
Type
Description

id

integer

Identifier of the user whose status is changed.

Body

CURL

The following values are available for the ruleValue parameter:

  • 0 - Unlocked

  • 1 - Locked

  • 2 - Locked after brute force

  • 3 - Need activation

  • 4 - Expired

Response

In case the status is changed successfully, you will simply receive the 204 code in the response.

circle-check

Change password

PATCH/users/{id}/changePassword

This API call is used to change passwords. The new password will be updated with the specified value for the user whose ID is added to the request path.

Path

Name
Type
Description

id

string

Identifier of the user for whom the password is changed.

Body

CURL

Response

You will get a 200 (OK) response in case all the passwords are changed successfully.

circle-check

Get user groups

GET/userGroups

This method is used to get a list of all user groups available on this server. All groups can be filtered using various parameters like brandingId, name, etc. The required parameter should be simply specified in the query.

Query

Name
Type
Description

brandingId

string

Branding identifier.

name

string

Filter user groups by name.

limit

string

Number of records to retrieve. Default is 1000, maximum is 1000.

offset

string

Defines the initial index number of outputting records.

planId

string

Identifier of the plan. Any type of plan can be set here (Risk plan, Swap plan, etc.).

serverId

string

Identifier of the server (cluster node).

CURL example (all groups are returned, no filtering is applied)

Response

circle-check

Trading Webhooks

The Trading Webhooks keys methods allows generating and managing API keys used for trading via webhooks. These keys are used for authentication when sending webhook requests to the TE server.

An authorized user can generate, retrieve, and remove webhook keys only for their own account.

Generate Webhooks keys

POST /webhookskeys

This method is used to generate a new webhook API and secret keys. The request may include an optional key name. If the name is not provided, the system will generate one automatically.

Body parameter

Name
Type
Description

name

string/body

Optional name of the webhook key. Maximum length is 32 characters.

Request body

Response

Get Webhooks keys

GET/webhooksKeys

This method returns a list of webhook keys generated by the authorized user. The response contains all keys created by the user, except the secret key value.

Response

In the response an array with keys and additional information is sent.

Delete Webhooks keys

DELETE/webhooksKeys/{webhookskeyId}

This method allows removing webhook keys. Webhook key ID that need to be deleted must be specified in the path parameters.

Path parameter

Name
Type
Description

webhookskeyId

integer/path

Unique identifier of the webhook key.

In the response the 200 OK status will be sent if the webhook key was deleted successfully.

Last updated