Read holdings
Fetch an account's holdings from your server using the user's OAuth access token and an account.id from Read accounts.
Scopes: brokerage:read tool:execute.
Server side: fetch positions
js
const response = await fetch('https://api.tradeit.app/api/tool/execute', {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
toolName: 'get_holdings',
params: { account_id: accountId },
}),
});
if (!response.ok) throw new Error(`Holdings request failed: ${response.status}`);
const holdings = await response.json();See Get holdings for the sample response and full API reference.