# List accounts for a connection

GET https://api.snaptrade.com/authorizations/{authorizationId}/accounts

Returns all brokerage accounts that belong to the specified connection for the authenticated user.

On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.

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 brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).

Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.


Reference: https://docs.snaptrade.com/reference/Connections/Connections_listBrokerageAuthorizationAccounts

## Code Examples

### TypeScript

```typescript

import { Snaptrade } from "snaptrade-typescript-sdk";

const snaptrade = new Snaptrade({
  clientId: "PARTNER_CLIENT_ID",
  consumerKey: "CONSUMER_KEY",
});

const response =
  await snaptrade.connections.listBrokerageAuthorizationAccounts(
    {
      authorizationId:
        "87b24961-b51e-4db8-9226-f198f6518a89",
      userId: "snaptrade-user-123",
      userSecret:
        "adf2aa34-8219-40f7-a6b3-60156985cc61",
    },
  );
console.log(response.data);

```

### Python

```python

from pprint import pprint
from snaptrade_client import SnapTrade

snaptrade = SnapTrade(
    client_id="PARTNER_CLIENT_ID",
    consumer_key="CONSUMER_KEY"
)

response = snaptrade.connections.list_brokerage_authorization_accounts(
    authorization_id="87b24961-b51e-4db8-9226-f198f6518a89",
    user_id="snaptrade-user-123",
    user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61"
)
pprint(response.body)

```

## OpenAPI Specification

```yaml

openapi: 3.0.0
info:
  description: Connect brokerage accounts to your app for live positions and trading
  version: 1.0.0
  title: SnapTrade
  termsOfService: N/A
  contact:
    email: api@snaptrade.com
  x-konfig-ignore:
    potential-incorrect-type: true
  x-readme:
    explorer-enabled: false
paths:
  /authorizations/{authorizationId}/accounts:
    get:
      tags:
        - Connections
      summary: List accounts for a connection
      description: >
        Returns all brokerage accounts that belong to the specified connection
        for the authenticated user.


        On Pay as you Go / Real-time, this endpoint refreshes each account's
        opening date, funding date, and total value live from the brokerage on
        each call.


        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
        brokerage. To force a refresh, use the [manual refresh
        endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).


        Check your API key on the [Customer Dashboard billing
        page](https://dashboard.snaptrade.com/settings/billing) to see whether
        your plan includes real-time data.
      operationId: Connections_listBrokerageAuthorizationAccounts
      parameters:
        - in: path
          name: authorizationId
          required: true
          schema:
            description: >-
              Unique identifier for the connection (brokerage_authorization_id).
              This is the UUID used to reference the connection in SnapTrade.
            type: string
            format: uuid
            example: 87b24961-b51e-4db8-9226-f198f6518a89
        - in: query
          required: true
          name: userId
          schema:
            description: >-
              SnapTrade User ID. This is chosen by the API partner and can be
              any string that is a) unique to the user, and b) immutable for the
              user. It is recommended to NOT use email addresses for this
              property because they are usually not immutable.
            type: string
            example: snaptrade-user-123
        - in: query
          required: true
          name: userSecret
          schema:
            description: >-
              SnapTrade User Secret. This is a randomly generated string and
              should be stored securely. If compromised, please rotate it via
              the [rotate user secret
              endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
            type: string
            example: adf2aa34-8219-40f7-a6b3-60156985cc61
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: List of brokerage accounts under the specified connection.
                type: array
                items:
                  description: A single account at a brokerage.
                  type: object
                  required:
                    - id
                    - brokerage_authorization
                    - name
                    - number
                    - institution_name
                    - created_date
                    - sync_status
                    - balance
                    - is_paper
                  properties:
                    id:
                      description: >-
                        Unique identifier for the connected brokerage account.
                        This is the UUID used to reference the account in
                        SnapTrade. This ID should not change for as long as the
                        connection stays active. If the connection is deleted
                        and re-added, a new account ID will be generated.
                      allOf:
                        - description: >-
                            Unique identifier for the connected brokerage
                            account. This is the UUID used to reference the
                            account in SnapTrade.
                          type: string
                          format: uuid
                          example: 917c8734-8470-4a3e-a18f-57c3f2ee6631
                    brokerage_authorization:
                      description: >-
                        Unique identifier for the connection
                        (brokerage_authorization_id). This is the UUID used to
                        reference the connection in SnapTrade.
                      type: string
                      format: uuid
                      example: 87b24961-b51e-4db8-9226-f198f6518a89
                    name:
                      type: string
                      description: >-
                        A display name for the account. Either assigned by the
                        user or by the brokerage itself. For certain brokerages,
                        SnapTrade appends the brokerage name to the account name
                        for clarity.
                      example: Robinhood Individual
                      nullable: true
                    number:
                      type: string
                      example: Q6542138443
                      description: >-
                        The account number assigned by the brokerage. For some
                        brokerages, this field may be masked for security
                        reasons.
                    institution_account_id:
                      type: string
                      example: '54953432'
                      nullable: true
                      description: >-
                        A stable and unique account identifier provided by the
                        institution. Will be set to null if not provided. When
                        present, can be used to check if a user has connected
                        the same brokerage account across multiple connections.
                    institution_name:
                      type: string
                      description: The name of the brokerage that holds the account.
                      example: Robinhood
                    created_date:
                      description: >-
                        Timestamp in [ISO
                        8601](https://en.wikipedia.org/wiki/ISO_8601) format
                        indicating when the account was created in SnapTrade.
                        This is _not_ the account opening date at the brokerage.
                      type: string
                      format: date-time
                      example: '2024-07-23T22:50:22.761Z'
                    funding_date:
                      description: >-
                        Timestamp in [ISO
                        8601](https://en.wikipedia.org/wiki/ISO_8601) format
                        indicating when the account was funded.
                      type: string
                      format: date-time
                      nullable: true
                      example: '2024-07-25T12:00:00.000Z'
                    opening_date:
                      description: >-
                        Timestamp in [ISO
                        8601](https://en.wikipedia.org/wiki/ISO_8601) format
                        indicating when the account was opened at the brokerage.
                      type: string
                      format: date-time
                      nullable: true
                      example: '2024-07-20T09:30:00.000Z'
                    sync_status:
                      description: >-
                        Contains status update for the account sync process
                        between SnapTrade and the brokerage.
                      properties:
                        transactions:
                          description: >
                            Status of account transaction sync. SnapTrade syncs
                            transactions from the brokerage under the following
                            conditions:

                            1. Initial connection - SnapTrade syncs all
                            transactions from the brokerage account as far back
                            as the brokerage allows. Check [our integrations
                            doc](https://support.snaptrade.com/brokerages-table?v=6fab8012ade6441fa0c6d9af9c55ce3a)
                            for details on how far back we sync for each
                            brokerage.

                            2. Daily sync - Once a day SnapTrade syncs new
                            transactions from the brokerage.

                            3. Manual sync - You can trigger an incremental sync
                            of transactions with the [transactions
                            sync](/reference/Experimental%20endpoints/Connections_syncBrokerageAuthorizationTransactions)
                            endpoint.
                          properties:
                            initial_sync_completed:
                              description: >-
                                Indicates if the initial sync of transactions
                                has been completed. For accounts with a large
                                number of transactions, the initial sync may
                                take a while to complete.
                              type: boolean
                              example: true
                            last_successful_sync:
                              description: >-
                                All transactions up to this date have been
                                successfully synced. Please note that this is
                                not the date of the last transaction, nor the
                                last time SnapTrade attempted to sync
                                transactions.
                              nullable: true
                              allOf:
                                - description: Date in YYYY-MM-DD format or null
                                  type: string
                                  example: '2022-01-24'
                                  format: date
                                  nullable: true
                            first_transaction_date:
                              description: >-
                                The date of the first transaction in the account
                                known to SnapTrade. It's possible that the
                                account has transactions before this date, but
                                they are not known to SnapTrade.
                              nullable: true
                              allOf:
                                - description: Date in YYYY-MM-DD format or null
                                  type: string
                                  example: '2022-01-24'
                                  format: date
                                  nullable: true
                        holdings:
                          description: >
                            Status of account holdings sync. SnapTrade syncs
                            holdings from the brokerage under the following
                            conditions:

                            1. Initial connection - SnapTrade syncs all holdings
                            (positions, balances, recent orders, and
                            transactions) immediately after the connection is
                            established.

                            2. Daily sync - Once a day SnapTrade refreshes all
                            holdings from the brokerage.

                            3. Manual sync - You can trigger a refresh of
                            holdings with the [manual
                            refresh](/reference/Connections/Connections_refreshBrokerageAuthorization)
                            endpoint.
                          properties:
                            initial_sync_completed:
                              description: >-
                                Indicates if the initial sync of holdings has
                                been completed. For accounts with a large number
                                of positions/orders/transactions, the initial
                                sync may take a while to complete.
                              type: boolean
                              example: true
                            last_successful_sync:
                              description: >-
                                The last time holdings were successfully synced
                                by SnapTrade.
                              nullable: true
                              allOf:
                                - description: >-
                                    Date in ISO 8601 format or null (YYYY-MM-DD
                                    HH:MM:SS.mmmmmmTZ)
                                  type: string
                                  example: '2024-06-28 18:42:46.561408+00:00'
                                  format: date-time
                                  nullable: true
                    balance:
                      description: Contains balance related information for the account.
                      properties:
                        total:
                          description: >-
                            Total market value of this account (includes cash,
                            equity, fixed income, etc). This value is directly
                            obtained from the brokerage and should reflect the
                            most accurate value of the account.
                          nullable: true
                          properties:
                            amount:
                              type: number
                              description: >-
                                Total value denominated in the currency of the
                                `currency` field.
                              example: 15363.23
                            currency:
                              type: string
                              description: The ISO-4217 currency code for the amount.
                              example: USD
                    status:
                      type: string
                      description: >-
                        The current status of the account. Can be either "open",
                        "closed", "archived" or null if the status is unknown or
                        not provided by the brokerage.
                      enum:
                        - open
                        - closed
                        - archived
                        - unavailable
                      nullable: true
                      example: open
                    raw_type:
                      type: string
                      description: The account type as provided by the brokerage
                      example: Margin
                      nullable: true
                    account_category:
                      type: string
                      description: >
                        The category of the account, normalized across
                        institutions.

                        Returns `null` if the category could not be determined.
                        Use this field to filter out non-investment accounts if
                        your integration only supports trading / holdings flows.
                        See [Filtering Accounts by
                        Category](https://docs.snaptrade.com/docs/filtering-accounts-by-category)
                        for more information.

                        - `INVESTMENT`: A brokerage / investment account
                        (equities, options, crypto, etc.).

                        - `DEPOSIT`: A bank deposit account (checking, savings).

                        - `LOC`: A line of credit account.
                      enum:
                        - INVESTMENT
                        - DEPOSIT
                        - LOC
                      nullable: true
                      example: INVESTMENT
                    meta:
                      type: object
                      deprecated: true
                      description: >-
                        Additional information about the account, such as
                        account type, status, etc. This information is specific
                        to the brokerage and there's no standard format for this
                        data. This field is deprecated and subject to removal in
                        a future version.
                      example:
                        type: Margin
                        status: ACTIVE
                        institution_name: Robinhood
                    portfolio_group:
                      description: >-
                        Portfolio Group ID. Portfolio Groups have been
                        deprecated. Please contact support if you have a use
                        case for it.
                      deprecated: true
                      type: string
                      format: uuid
                      nullable: true
                      example: 2bcd7cc3-e922-4976-bce1-9858296801c3
                    cash_restrictions:
                      deprecated: true
                      description: This field is deprecated.
                      type: array
                      items:
                        type: string
                      example: []
                    is_paper:
                      type: boolean
                      description: >-
                        Indicates whether the account is a paper (simulated)
                        trading account.
                      example: false
        '401':
          description: Unauthorized, invalid credentials for this resource
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: Unable to verify signature sent
                  default_code:
                    example: 1076
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: The requested resource does not exist.
                  default_code:
                    example: 1011

```