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

# List a company's financial accounts

> A company's financial accounts (balances). Requires the `accounts:read` scope and an approved data-access grant from the company. The company must belong to the API key's portfolio; otherwise the API returns 404 with code `company_not_found` (it does not disclose whether a company outside the portfolio exists). Returns an empty list if accessible but no accounts exist.




## OpenAPI

````yaml /openapi.yaml get /v1/companies/{id}/accounts
openapi: 3.1.0
info:
  title: Vein Public API
  version: 1.0.0
  description: >
    Phase 1 of the Vein public API. Read-only access to verified portfolio
    company data with full source attribution. See PHASE_1_DESIGN.md.
servers:
  - url: https://api.vein.finance
    description: >-
      Production (key selects live vs test via vein_sk_live_/vein_sk_test_
      prefix)
security:
  - bearerAuth: []
paths:
  /v1/companies/{id}/accounts:
    get:
      summary: List a company's financial accounts
      description: >
        A company's financial accounts (balances). Requires the `accounts:read`
        scope and an approved data-access grant from the company. The company
        must belong to the API key's portfolio; otherwise the API returns 404
        with code `company_not_found` (it does not disclose whether a company
        outside the portfolio exists). Returns an empty list if accessible but
        no accounts exist.
      operationId: listCompanyAccounts
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The portfolio company id.
      responses:
        '200':
          description: A list of financial accounts.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ListEnvelope'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/AuthError'
        '403':
          $ref: '#/components/responses/MetricsPermissionError'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimit'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ListEnvelope:
      type: object
      required:
        - object
        - data
        - has_more
        - url
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items: {}
        next_cursor:
          type:
            - string
            - 'null'
        has_more:
          type: boolean
        url:
          type: string
    Account:
      type: object
      required:
        - id
        - object
        - name
        - balance
        - currency
        - source
        - as_of
      description: A financial account belonging to a portfolio company.
      properties:
        id:
          type: string
          example: acct_01jxyz
        object:
          type: string
          enum:
            - account
        name:
          type: string
          example: Business Checking
          description: The account's display name.
        mask:
          type:
            - string
            - 'null'
          example: '4242'
          description: Last four digits of the account number
          if available.: null
        type:
          type:
            - string
            - 'null'
          example: depository
          description: Account type, e.g. depository, credit, loan, investment.
        subtype:
          type:
            - string
            - 'null'
          example: checking
          description: Account subtype, e.g. checking, savings, credit_card.
        balance:
          type: number
          example: 357000
          description: Current balance in the account's native currency.
        currency:
          type: string
          example: USD
        source:
          type: string
          example: plaid
          description: The integration/provider the account was synced from.
        as_of:
          type: string
          format: date-time
          description: Timestamp at which the balance was last confirmed.
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - documentation_url
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - permission_error
                - invalid_request_error
                - not_found_error
                - rate_limit_error
                - idempotency_error
                - api_error
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
            request_id:
              type: string
            documentation_url:
              type: string
              format: uri
  responses:
    AuthError:
      description: Authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    MetricsPermissionError:
      description: >
        Access to this endpoint was denied. Branch on `error.code` to determine
        the reason: `insufficient_scope` means the API key lacks the required
        scope for this endpoint (`metrics:read`, `accounts:read`, or
        `sources:read` depending on the path); `access_required` means no
        data-access grant exists for this company yet (submit `POST
        /v1/access-requests`); `access_pending` means a grant has been requested
        and is awaiting company approval; `access_revoked` means a previously
        approved grant was revoked by the company.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: >
        The requested resource was not found, or is outside the API key's
        portfolio (existence is not disclosed for companies outside scope).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimit:
      description: >
        Too many requests. The public API is rate limited per API key. Every
        response (not just 429s) carries the RateLimit-* headers below; on a 429
        the Retry-After header gives the seconds to wait before retrying.
      headers:
        RateLimit-Limit:
          description: Requests allowed per window for this key.
          schema:
            type: integer
            example: 120
        RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
            example: 0
        RateLimit-Reset:
          description: Seconds until the current window resets.
          schema:
            type: integer
            example: 42
        Retry-After:
          description: Seconds to wait before retrying (present on 429 only).
          schema:
            type: integer
            example: 42
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ServerError:
      description: An unexpected server-side error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vein_sk
      description: 'Authorization: Bearer vein_sk_live_... or vein_sk_test_...'

````