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
| Field | Type | Required | Description |
|---|---|---|---|
tradingAccountId | string | Yes | Trading account ID to disconnect |
Response
Returns the disconnected trading account object.
| Field | Type | Description |
|---|---|---|
tradingAccountId | string | Trading account identifier |
userId | string | User ID |
venue | string | Exchange venue |
name | string | Trading account name |
status | string | Account status (DISCONNECTED) |
disconnectedAt | integer | Disconnection 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 Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Missing trading account ID |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | Not authorized to disconnect this account |
| 404 | Not found | Trading 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.connectagain - This operation cannot be undone