Build with the AI Skill
Trade ItTrade ItDocs
Actions

Read accounts

Fetch the user's connected brokerage accounts from your server using their OAuth access token.

Scopes: brokerage:read tool:execute.

Server side: fetch accounts

const response = await fetch('https://api.tradeit.app/api/tool/execute', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${accessToken}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ tool_name: 'get_accounts', params: {} }),
});
if (!response.ok) throw new Error(`Account request failed: ${response.status}`);
const accounts = await response.json();

Returns: Account[], each wrapped with its brokerage_metadata and connection. See Get accounts for a sample response.

To remove a brokerage login, pass its connection.id to Delete connection. This currently deletes the entire connection and its accounts across Trade It and all partners.

On this page