Collective2 General API (v4)

API to automate your trading

Download OpenAPI description
Languages
Servers
https://api4-general.collective2.com/

Schemas

Autotrade

Operations

GetAutotradedStrategies

Request

Request the Autotraded strategies of the person. Paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or null

The Autotrade account (optional)

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradedStrategies?PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradedStrategyDTO)

Result array

paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "account": "string", "scalingPercentage": 0.1, "strategyId": 0, "strategyName": "string", "brokerId": 0, "brokerName": "string", "startDate": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }

GetAutotraders

Request

A list of Autotraders. Paginated endpoint.

Query
StrategyIdinteger or null(int64)

(Optional) StrategyId filter

BrokerIdinteger or null(int32)

(optional) The Autotrade BrokerId

WhiteLabelSiteIdinteger or null(int64)

(optional) The White Label Site Id

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/GetAutotraders \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradedStrategyDTO)

Result array

paginationobject(PaginationProperties)
responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "account": "string", "scalingPercentage": 0.1, "strategyId": 0, "strategyName": "string", "brokerId": 0, "brokerName": "string", "startDate": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z" } ], "pagination": { "prev_cursor": "string", "next_cursor": "string" }, "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }

GetAutotradeSettings

Request

The Autotrade Settings. Non-paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or null

(Optional) Account

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetAutotradeSettings?PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AutotradeSettingsDTO)

Result array

responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "id": 0, "personId": 0, "firstName": "string", "lastName": "string", "email": "string", "country": "string", "state": "string", "language": "string", "siteDomain": "string", "brokerId": 0, "connection": "string", "introducingBrokerId": 0, "introducingBroker": "string", "strategyId": 0, "strategyName": "string", "account": "string", "accountType": 0, "brokerUserID": "string", "currency": "string", "salesRepId": 0, "salesRep": "string", "isTradeLeader": true, "isManualDiscardedPosition": true, "isConfirmationNeeded": true, "isSyncEnabled": true, "isBrokerEnabled": true, "isAutotradeDisabled": true, "isAutotradeDisabledReason": "string", "syncDisabledReason": "string", "firstBrokerActivationDate": "2019-08-24T14:15:22Z", "netLiquidationValue": 0.1, "netLiquidationValueDate": "2019-08-24T14:15:22Z", "virtualLimitOrdersEnabled": true, "scalingPercentage": 0.1, "settingsLastUpdateUTC": "2019-08-24T14:15:22Z", "enabledFutures": true, "futuresLong": true, "futuresShort": true, "minFutures": 0, "maxFutures": 0, "enabledForex": true, "forexEnabledLong": true, "forexEnabledShort": true, "forexLotSize": 0, "minForex": 0, "maxForex": 0, "enabledStocks": true, "stocksLong": true, "stocksShort": true, "maxStocksDollars": 0, "tradeStocksAsCFD": true, "enabledOptions": true, "optionsLong": true, "optionsShort": true, "minOptions": 0, "maxOptions": 0 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }

SetAutotradeSettings

Request

Enable or disable Autotrade or Autosync in the specified account.

Bodyapplication/json
Accountstring or nullrequired

The Autotrade account

PersonIdinteger or null(int64)required

The C2 PersonID

BrokerIdinteger or null(int32)required

The C2 PersonID

IsAutotradeEnabledboolean or null

Set to TRUE if you want to enable the account for Autotrade. The StartAutotrade endpoint will automatically enable this setting. It may be disabled if your account is delinked by the broker, or if we detect rare unexpected activity in your account such as a margin call, pattern day trader, account becomes restricted by the broker, etc.

IsAutoSyncEnabledboolean or null

Set to TRUE if you want to enable or disable AutoSync for the account. AutoSync automatically gets disabled whenever an external (i.e. non-C2) order is executed in the account.

curl -i -X PUT \
  https://api4-general.collective2.com/Autotrade/SetAutotradeSettings \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "Account": "string",
    "PersonId": 0,
    "BrokerId": 0
  }'

Responses

OK

Bodyapplication/json
resultsArray of booleans or null

Result array

responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ true ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }

GetDashBoard

Request

Request the Person's Autotraded strategies and a performance summary. Non-paginated endpoint.

Query
PersonIdinteger or null(int64)required

PersonId

Accountstring or nullrequired

The brokerage Account

curl -i -X GET \
  'https://api4-general.collective2.com/Autotrade/GetDashBoard?Account=string&PersonId=0' \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(DashBoardItemDTO)

Result array

responseStatusobject(ResponseStatus)
Response
application/json
{ "results": [ { "personId": 0, "brokerName": "string", "account": "string", "strategyId": 0, "strategyName": "string", "startDate": "2019-08-24T14:15:22Z", "todayReturn": 0.1, "totalReturn": 0.1 } ], "responseStatus": { "errorCode": "string", "message": "string", "errors": [ { … } ] } }

SearchAccounts

Request

Request a list of Autotrade and Papertrade accounts. Partial matches will be returned. Paginated endpoint. Only visible to the account owner or White-label site owner

Query
Accountstring or null

The Autotrade account (optional)

PersonIdinteger or null(int64)

PersonId (optional)

BrokerIdinteger or null(int32)

The Autotrade BrokerId (optional)

FirstNamestring or null

The FirstName (optional). Not case-sensitive

LastNamestring or null

The FirstName (optional). Not case-sensitive

Emailstring or null

The Email (optional)

WhiteLabelSiteIdinteger or null(int64)

The White Label site Id (optional)

CountryCodestring or null

The person's country code. Not case-sensitive (optional)

IPAddressstring or null

The person's last known IP address (optional)

Phonestring or null

The Phone number (optional)

Cursorstring or null

The Cursor from the previous resultset

Limitinteger(int32)

Result size limit. We will enforce a max size limit for all endpoints. Default is 1000

AscendingOrderboolean

Set to FALSE if you want to get the newest results first. Default is TRUE (oldest results first)

curl -i -X GET \
  https://api4-general.collective2.com/Autotrade/SearchAccounts \
  -H 'Authorization: Bearer <YOUR_Bearer myAPIkey_HERE>'

Responses

OK

Bodyapplication/json
resultsArray of objects or null(AccountDTO)

Result array