For AI agents: the documentation index is available at https://docs.snaptrade.com/llms.txt, and the comprehensive documentation index is available at https://docs.snaptrade.com/llms-full.txt. The complete public OpenAPI specification is available at https://docs.snaptrade.com/openapi.yaml. Complete public OpenAPI specification with all documented operations, schemas, servers, and authentication requirements. Use it for SDK generation and API tooling; beta operations are marked x-beta. Markdown versions of documentation pages are available by appending .md to the URL path.
Connections

Delete connection

delete
https://api.snaptrade.com/connection/{connectionId}

Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the CONNECTION_DELETED webhook webhook to know when the deletion has been completed and the data has been removed.

Execute an API Request

Authentication Method

Use commercial authentication when acting on behalf of your application and passing end-user credentials with requests that require them.

Credentials
Path
connectionIdstring (format: uuid)required

Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.

Request
Installation
$
npm install snaptrade-typescript-sdk
1
import {
2
Snaptrade,
3
SnaptradeAuth,
4
} from "snaptrade-typescript-sdk";
5
6
const snaptrade = new Snaptrade({
7
auth: SnaptradeAuth.commercialApiKey({
8
consumerKey: "CONSUMER_KEY",
9
clientId: "CLIENT_ID",
10
}),
11
});
12
13
const response =
14
await snaptrade.connections.deleteConnection({
15
connectionId:
16
"87b24961-b51e-4db8-9226-f198f6518a89",
17
userId: "USER_ID",
18
userSecret: "USER_SECRET",
19
});
20
console.log(response.data);

Response fields

object

Confirmation that a task has been scheduled to delete the connection.

detailstring

Connection queued for deletion; please wait for webhook for confirmation.

The ID of the connection (brokerage authorization) that was scheduled for deletion.

1
{
2
"detail": "Connection queued for deletion; please wait for webhook for confirmation.",
3
"connection_id": "0b3ebefb-ed47-43df-cd8f-729a4420b5cf"
4
}