Skip to main content

API Calls

Get Callback with Notification About Attribution

The cTrader backend sends this request to the broker CRM, which then provides the response.

MethodURL
POSTprovided by the broker

Headers

HeaderDescriptionRequired?
Authorisation headerAuthorisation header containing API token provided by the broker. E.g. Basic ab45da2g34hdb6Yes

Parameters

No parameters.

Request Body

KeyRequired?Data TypeDescription
invitedUserIdYesintegerUnique user ID of the invited trader.
partnerUserIdYesintegerUnique user ID of the partner.
brokerPartnerIdNostringUnique ID of the IB in the broker CRM or partner programme.
brokerNameYesstringUnique name denoting a specific broker or white label with whom the user registered.

Output

KeyRequired?Data TypeDescription
brokerPartnerIdNostringUnique ID of the IB in the broker CRM or partner programme.
brokerResultNoenumStatus of the attribution process. Possible values and their meanings:

- ATTRIBUTED_NEW
The broker successfully attributed a new user to a partner receiving their first attribution with them. A new brokerPartnerId has been generated.

- ATTRIBUTED
The broker successfully attributed a new user to a partner known to them. An existing brokerPartnerId has been returned.

- PENDING_ATTRIBUTION
The attribution process has started but is not yet finished.

- REATTRIBUTED
The broker successfully reattributed a user already attributed to one partner to a different partner.

Request Example

curl -X POST 'attributionWebhookUrl'  -H 'Authorization: Basic ab45da2g34hdb6'  -H 'Content-Type: application/json'  -d '{"invitedUserId ": 4216, "partnerUserId ": 28042, "brokerPartnerId ": "I2333PIOIII", "brokerName ": "BESTBROKER"}'

Expected Response Status Code

200

Response Example

{
"brokerPartnerId ": "I2333PIOIII",
"brokerResult": "ATTRIBUTED_NEW"
}

Get List of Invited Users (Attributions)

The broker CRM sends this request to the cTrader backend, which then provides the response.

MethodURL
GET/v1/social/invitedUsers

Generates the one-time code required for the SSO.

Headers

HeaderDescriptionRequired?
Authorisation BearerAuthorisation header containing the authentication token of the manager. E.g. Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379Yes

Parameters

ParameterParameter TypeRequired?Data TypeDescription
createdFrompathNointegerUnix epoch timestamp (inclusive) in UTC milliseconds for the start of the search interval.
limitpathNointegerNumber of records to return. 100 is the default value.
skippathNointegerNumber of records to skip. 0 is the default value.

Request Body

No request body.

Output

KeyRequired?Data TypeDescription
invitedUsersYesarrayList containing invited users and their details as JSON objects.
invitedUsers.invitedUserIdYesintegerUnique user ID of the invited trader.
invitedUsers.partnerUserIdYesintegerUnique user ID of the partner.
invitedUsers.brokerPartnerIdNostringUnique ID of the IB in the broker CRM or partner programme. Filled if it was previously received from the broker.
invitedUsers.brokerNameNostringUnique name denoting a specific broker or white label for the invitation.
invitedUsers.createTimestampYesintegerUnix epoch timestamp in UTC milliseconds of the attribution event.

Request Example

curl -X GET 'https://HOST:PORT/v1/social/invitedUsers?createdFrom =1735560962458&limit=100&skip=0' -H 'Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379'

Expected Response Status Code

200

Response Example

{
"invitedUsers": [
{
"invitedUserId ": 53324216,
"partnerUserId ": 27951042,
"brokerPartnerId ": "I2333PIOIII",
"brokerName ": "BESTBROKER",
"createTimestamp": 1735560962458
},
{
"invitedUserId ": 42213105,
"partnerUserId ": 38062153,
"brokerPartnerId ": "J122QJ1JJJ",
"brokerName ": "TOPBROKER",
"createTimestamp": 1735560963562
}
]
}

Get Callback with Notification about a New User

The cTrader backend sends this request to the broker CRM.

MethodURL
POSTprovided by the broker

Headers

HeaderDescriptionRequired?
Authorisation headerAuthorisation header containing API token provided by the broker.Yes

Request Body

KeyRequired?Data TypeDescription
userIdYesintegerUnique user ID of the registered trader in cTrader.
brokerNameYesstringUnique name denoting a specific broker or white label with whom the user registered.
emailYesstringEmail address of the registered user.
partnerUserIdYesintegerUnique user ID of the partner.

Request Example

curl -X POST 'userRegistrationWebhookBrokerUrl' -H 'Authorization: Basic ab45da2g34hdb6' -H 'Content-Type: application/json' -d '{"userId": 123, "brokerName": "bestbroker", "email": "test@test.com", "partnerUserId": 345}'

Get List of Registered Users

The broker CRM sends this request to the cTrader backend, which then provides the response.

MethodURL
GET/v1/users

Headers

HeaderDescriptionRequired?Notes
Authorisation bearerAuthorisation header containing the authentication token of the manager. E.g. Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379YesThe manager whose token is used to send the request must have permission to authenticate users.

Parameters

ParameterParameter TypeRequired?Data TypeDescription
createdFrompathNointegerUnix epoch timestamp (inclusive) in UTC milliseconds for the start of the search interval.
limitpathNointegerNumber of records to return. 100 is the default value.
skippathNointegerNumber of records to skip. 0 is the default value.

Request Body

No request body.

Output

KeyRequired?Data TypeDescription
usersYesarrayList containing registered users and their details as JSON objects.
users.userIdYesintegerUnique user ID of the registered trader in cTrader.
users.emailYesstringEmail of the registered user in cTrader.
users.brokerNameYesstringUnique name denoting a specific broker or white label with whom the user registered.
users.utcCreateTimestampYesintegerUnix epoch timestamp in UTC milliseconds for the user registration event.

Request Example

curl -X GET 'https://HOST:PORT/v1/users?createdFrom=1735560962458&limit=1000&skip=0'  -H 'Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379'

Expected Response Status Code

200

Response Example

{
"users": [
{
"userId": 27424389,
"email": "test@test.com",
"brokerName": "BESTBROKER",
"utcCreateTimestamp": 1735560962458
},
{
"userId": 16875243,
"email": "user@email.com",
"brokerName": "TOPBROKER",
"utcCreateTimestamp": 1735560981692
}
]
}