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

Refresh holdings for a connection

post
https://api.snaptrade.com/authorizations/{authorizationId}/refresh

Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.

Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the Customer Dashboard billing page Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the data_freshness_mode field on a connection to determine this.

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

Response fields

object

Confirmation that the syncs have been scheduled.

detailstring

Refresh confirmation details

1
{
2
"detail": "Connection 0b3ebefb-ed47-43df-cd8f-729a4420b5cf scheduled for refresh"
3
}