Skip to main content

Disconnect Account

Disconnect a trading account.

Endpoint​

POST /api/v3/tradingAccount/disconnect

Description​

Disconnects a trading account from the platform. All trading functions and event stream notifications will be stopped. The trading account will be archived and no longer available for trading.

Authentication​

Requires Bearer token authentication.

Authorization: Bearer {access_token}

Request Body​

FieldTypeRequiredDescription
tradingAccountIdstringYesTrading account ID to disconnect

Response​

Returns the disconnected trading account object.

FieldTypeDescription
tradingAccountIdstringTrading account identifier
userIdstringUser ID
venuestringExchange venue
namestringTrading account name
statusstringAccount status (DISCONNECTED)
disconnectedAtintegerDisconnection timestamp (milliseconds)

Usage​

import requests

headers = {"Authorization": f"Bearer {access_token}"}

response = requests.post(
"https://cadenza-api-uat.algo724.com/api/v3/tradingAccount/disconnect",
headers=headers,
json={
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000"
}
)

account = response.json()["data"]
print(f"Disconnected: {account['tradingAccountId']} - {account['status']}")
curl -X POST https://cadenza-api-uat.algo724.com/api/v3/tradingAccount/disconnect \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000"}'

Example Response​

{
"data": {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"userId": "user-uuid-here",
"venue": "BINANCE",
"name": "My Binance Account",
"accountType": "SPOT",
"status": "DISCONNECTED",
"createdAt": 1703052635110,
"updatedAt": 1703052700000,
"disconnectedAt": 1703052700000
},
"success": true,
"errno": 0,
"error": null
}

Error Responses​

HTTP CodeErrorDescription
400Invalid requestMissing trading account ID
401UnauthorizedInvalid or expired access token
403ForbiddenNot authorized to disconnect this account
404Not foundTrading account not found

Example Error​

{
"data": null,
"success": false,
"errno": -120002,
"error": "Trading account not found"
}

Notes​

  • Disconnecting cancels all open orders on the exchange
  • All WebSocket subscriptions for this account are terminated
  • API credentials are removed from the system
  • To reconnect the same exchange account, use tradingAccount.connect again
  • This operation cannot be undone