Connections
Delete connection
DELETE /api/brokerageConnection/{id}
Deletes the authenticated user's brokerage connection and its associated records in Trade It.
OAuth scope: brokerage:write
Destructive Action
This endpoint currently deletes the entire connection across Trade It. It also deletes all accounts on that connection and their stored trades in Trade It.
Authentication
Use the user's OAuth access token or a user-created API key as a bearer token.
Connection ID
Use account.connection_id from Get accounts. Multiple accounts can share one connection; deleting it removes all of them.
| Parameter | Location | Required | Description |
|---|---|---|---|
id | Path | Yes | The Trade It brokerage connection ID. |
No request body is required.
Example
const response = await fetch(
`https://api.tradeit.app/api/brokerageConnection/:Id}`,
{
method: 'DELETE',
headers: { Authorization: `Bearer ${accessToken}` },
},
);
if (!response.ok) throw new Error(`Connection deletion failed: ${response.status}`);On success, Trade It returns 200:
{ "success": true }Effects
- Deletes the connection, its accounts, and their stored trades from Trade It. The underlying brokerage accounts remain open.
- Sends an ACCOUNT_DELETED webhook for each deleted account to subscribed partners.
- Preserves the user's Trade It account, organization memberships, and OAuth authorization.
To end a user's organization membership and sponsorship instead, use Remove membership.
Errors
| Status | Meaning |
|---|---|
401 | The bearer token is invalid or expired. |
403 | The caller cannot access the connection or lacks brokerage:write permission. |
404 | The connection was not found. |