> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anthid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List trading accounts

> Returns trading account metadata visible to the caller. Service-account callers with `credential:read` can list across organizations; user callers list accounts in their principal organization. Results can be filtered by broker and environment and paginated with `cursor`.



## OpenAPI

````yaml /api-reference/credentials.openapi.json get /v1/trading-accounts
openapi: 3.1.0
info:
  title: credentials
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Credentials
    description: Trading-account metadata and lifecycle operations
  - name: Credentials
    description: >-
      Broker credential creation, metadata, secret access, and lifecycle
      operations
paths:
  /v1/trading-accounts:
    get:
      tags:
        - Credentials
      summary: List trading accounts
      description: >-
        Returns trading account metadata visible to the caller. Service-account
        callers with `credential:read` can list across organizations; user
        callers list accounts in their principal organization. Results can be
        filtered by broker and environment and paginated with `cursor`.
      operationId: listTradingAccounts
      parameters:
        - name: require_credentials
          in: query
          description: When true, only include trading accounts with credentials
          required: false
          schema:
            type: boolean
        - name: cursor
          in: query
          description: Pagination cursor returned by a previous response
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Trading accounts retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTradingAccountsResponse'
        '400':
          description: Pagination cursor is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Caller cannot read trading-account metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Caller exceeded the request rate limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Unexpected server error while listing trading accounts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - clientCredentials: []
components:
  schemas:
    ListTradingAccountsResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TradingAccount'
        next_cursor:
          type:
            - string
            - 'null'
    Error:
      oneOf:
        - type: object
          required:
            - EncryptionError
          properties:
            EncryptionError:
              type: string
        - type: object
          required:
            - WorkOsError
          properties:
            WorkOsError:
              type: string
        - type: object
          required:
            - KvError
          properties:
            KvError:
              type: string
        - type: object
          required:
            - StreamError
          properties:
            StreamError:
              type: string
        - type: object
          required:
            - InternalError
          properties:
            InternalError:
              type: string
        - type: object
          required:
            - ThirdPartyError
          properties:
            ThirdPartyError:
              type: string
        - type: object
          required:
            - ParseError
          properties:
            ParseError:
              type: string
        - type: object
          required:
            - NotFound
          properties:
            NotFound:
              type: string
        - type: object
          required:
            - AlreadyExists
          properties:
            AlreadyExists:
              type: string
        - type: object
          required:
            - BadRequest
          properties:
            BadRequest:
              type: string
        - type: object
          required:
            - Forbidden
          properties:
            Forbidden:
              type: string
        - type: object
          required:
            - Unauthorized
          properties:
            Unauthorized:
              type: string
        - type: object
          required:
            - Database
          properties:
            Database:
              type: string
        - type: object
          required:
            - TooManyRequests
          properties:
            TooManyRequests:
              type: string
        - type: object
          required:
            - BrokerError
          properties:
            BrokerError:
              type: string
        - type: object
          required:
            - AuthError
          properties:
            AuthError:
              type: string
        - type: object
          required:
            - InvalidInput
          properties:
            InvalidInput:
              type: string
        - type: object
          required:
            - ConnectionLimitExceeded
          properties:
            ConnectionLimitExceeded:
              type: string
    TradingAccount:
      type: object
      required:
        - id
        - organization_id
        - broker
        - environment
        - enabled
        - created_at
        - updated_at
      properties:
        broker:
          $ref: '#/components/schemas/Broker'
        broker_account_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        enabled:
          type: boolean
        environment:
          $ref: '#/components/schemas/BrokerEnvironment'
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        organization_id:
          type: string
          format: uuid
        updated_at:
          type: string
          format: date-time
    Broker:
      type: string
      enum:
        - unspecified
        - lightspeed
        - alpaca
    BrokerEnvironment:
      type: string
      enum:
        - paper
        - live
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    clientCredentials:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Machine bearer token minted via the client_credentials grant.

````