For AI agents: the complete documentation index is available at https://docs.snaptrade.com/llms.txt, and the full documentation text is available at https://docs.snaptrade.com/llms-full.txt. Markdown versions of documentation pages are available by appending .md to the URL path.
View as Markdown
Connections

List accounts for a connection (discriminated union)

BETA
get
https://api.snaptrade.com/connections/{connectionId}/accounts

Returns the accounts that belong to the specified connection for the authenticated user, using the kind-discriminated account shape.

Each item in the response carries a kind field (investment, deposit, and line_of_credit are implemented) that determines which additional fields are present -- see the ConnectionAccount schema.

On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (net_value) live from the institution on each call, along with funding date for investment accounts.

On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the manual refresh endpoint.

Check your API key on the Customer Dashboard billing page to see whether your plan includes real-time data.

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.listConnectionAccounts(
15
{
16
connectionId:
17
"87b24961-b51e-4db8-9226-f198f6518a89",
18
userId: "USER_ID",
19
userSecret: "USER_SECRET",
20
},
21
);
22
console.log(response.data);

Response fields

array of any

List of accounts under the specified connection.

object

A single account under a connection, from the kind-discriminated union used by Connections_listConnectionAccounts. Use kind to determine which schema is present.

investment, deposit, and line_of_credit are implemented today.

1
[
2
{
3
"kind": "investment",
4
"id": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
5
"connection_id": "87b24961-b51e-4db8-9226-f198f6518a89",
6
"display_name": "Robinhood Individual",
7
"masked_account_number": "****8443",
8
"institution_account_id": "54953432",
9
"institution_id": "b6e1a9f0-6e2a-4c37-9b0a-6f1e2d3c4b5a",
10
"opening_date": "2024-07-20T09:30:00.000Z",
11
"funding_date": "2024-07-25T12:00:00.000Z",
12
"sync_status": {
13
"transactions": {
14
"initial_sync_completed": true,
15
"last_successful_sync": "2022-01-24T00:00:00.000Z",
16
"first_transaction_date": "2022-01-24T00:00:00.000Z"
17
},
18
"orders": "2024-06-28T18:42:46.561Z",
19
"positions": "2024-06-28T18:42:46.561Z",
20
"balances": "2024-06-28T18:42:46.561Z"
21
},
22
"raw_type": "Margin",
23
"is_paper": false,
24
"net_value": {
25
"amount": 84213.55,
26
"currency": "USD"
27
}
28
}
29
]