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

# List virtual accounts

> List accessible balance-bearing virtual accounts for the selected legal entity across all of its Accounts. Use `accountId` to select one Account. Virtual accounts in eligible bank Accounts can be used as `fromAccount` or `toAccount`; Global USD virtual accounts are read-only on API v2 transfer endpoints.



## OpenAPI

````yaml /openapi-v2.json get /v2/virtual-accounts
openapi: 3.1.0
info:
  title: Slash Public API V2
  description: >-
    Send money for a Slash legal entity. Every request uses an API key. Transfer
    creation returns a Transfer that links its resulting transactions.
  version: 0.0.1
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
paths:
  /v2/virtual-accounts:
    parameters:
      - name: x-legal-entity
        in: header
        required: true
        description: >-
          The legal entity to act on. Required on every request; a user API key
          can act on any legal entity its user has access to.
        schema:
          type: string
          pattern: ^le_[a-zA-Z0-9]+$
    get:
      summary: List virtual accounts
      description: >-
        List accessible balance-bearing virtual accounts for the selected legal
        entity across all of its Accounts. Use `accountId` to select one
        Account. Virtual accounts in eligible bank Accounts can be used as
        `fromAccount` or `toAccount`; Global USD virtual accounts are read-only
        on API v2 transfer endpoints.
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Pass the opaque value returned in `metadata.nextCursor` without
            changing the other query parameters.
          schema:
            type: string
        - name: accountId
          in: query
          required: false
          description: Return virtual accounts in one accessible Account.
          schema:
            type: string
        - name: includeClosed
          in: query
          required: false
          description: Include closed virtual accounts. Defaults to false.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A page of virtual accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/virtual-account'
                  metadata:
                    $ref: '#/components/schemas/pagination-metadata'
                required:
                  - items
                  - metadata
                additionalProperties: false
              example:
                items:
                  - id: subaccount_operating
                    name: Operating
                    accountId: sa_group_primary
                    accountType: primary
                    status: open
                    balance:
                      amount: 250000
                      currency: USD
                metadata:
                  count: 1
        '400':
          $ref: >-
            #/components/responses/PublicApiV2Error400InvalidRequestShapeVirtualAccountsList
        '401':
          $ref: '#/components/responses/PublicApiV2Error401Unauthorized'
        '403':
          $ref: >-
            #/components/responses/PublicApiV2Error403ForbiddenLegalEntityUserApiKeyRequired
        '404':
          $ref: '#/components/responses/PublicApiV2Error404NotFoundNotEnabled'
        '429':
          $ref: '#/components/responses/PublicApiV2RateLimited'
        '500':
          $ref: '#/components/responses/PublicApiV2Error500Internal'
components:
  schemas:
    virtual-account:
      title: VirtualAccount
      description: >-
        A balance-bearing virtual account. Virtual accounts in eligible bank
        Accounts can source or receive API v2 transfers; Global USD virtual
        accounts are readable but cannot be used by the API v2 transfer
        endpoints.
      type: object
      properties:
        id:
          type: string
          description: Virtual account id with the `subaccount_` prefix.
        name:
          type: string
        accountId:
          type: string
          description: Parent Account id with the `sa_group_` prefix.
        accountType:
          type: string
          enum:
            - primary
            - default
        status:
          type: string
          enum:
            - open
            - closed
        balance:
          allOf:
            - $ref: '#/components/schemas/Money'
          description: Current ledger balance. Zero for a newly created virtual account.
        commission:
          $ref: '#/components/schemas/virtual-account-commission'
      required:
        - id
        - name
        - accountId
        - accountType
        - status
        - balance
      additionalProperties: false
    pagination-metadata:
      title: PaginationMetadata
      type: object
      properties:
        nextCursor:
          type: string
          description: Opaque cursor for the next page. Omitted on the final page.
        count:
          type: integer
          minimum: 0
          description: Number of items in this page.
      required:
        - count
      additionalProperties: false
    Money:
      type: object
      description: A signed monetary amount expressed in minor units.
      properties:
        amount:
          type: integer
          description: Amount in the currency's minor units.
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: Uppercase ISO 4217 currency code.
      required:
        - amount
        - currency
      additionalProperties: false
      title: Money
    virtual-account-commission:
      title: VirtualAccountCommission
      description: Funds diverted to the Account's primary virtual account.
      oneOf:
        - title: Flat fee
          type: object
          properties:
            id:
              type: string
              description: Commission configuration id.
            type:
              type: string
              enum:
                - flat_fee
            amount:
              allOf:
                - $ref: '#/components/schemas/UsdMoney'
              description: Fixed USD amount collected each period.
            frequency:
              type: string
              enum:
                - monthly
                - yearly
            startsAt:
              type: string
              format: date-time
              description: RFC 3339 date and time when collection begins.
          required:
            - id
            - type
            - amount
            - frequency
          additionalProperties: false
        - title: Take rate
          type: object
          properties:
            id:
              type: string
              description: Commission configuration id.
            type:
              type: string
              enum:
                - take_rate
            rate:
              type: number
              minimum: 0
              maximum: 1
              description: Fraction of incoming funds diverted. `0.1` means 10%.
          required:
            - id
            - type
            - rate
          additionalProperties: false
    PublicApiV2ErrorInvalidRequestShape:
      title: PublicApiV2ErrorInvalidRequestShape
      description: >-
        The body, query, or headers failed validation, or a required header is
        missing. `details` has one entry per failing location, keyed by JSON
        pointer or header name.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - invalid_request
            details:
              type: object
              properties: {}
              additionalProperties:
                type: string
          required:
            - code
            - details
    PublicApiV2ErrorUnauthorized:
      title: PublicApiV2ErrorUnauthorized
      description: API key authentication is missing or invalid.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbiddenLegalEntity:
      title: PublicApiV2ErrorForbiddenLegalEntity
      description: The credential is not permitted to act for the selected legal entity.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorUserApiKeyRequired:
      title: PublicApiV2ErrorUserApiKeyRequired
      description: >-
        The API key is scoped to a legal entity rather than a user. Every v2
        request needs a user API key, created under Settings → API keys in the
        Slash dashboard, together with the `x-legal-entity` header.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - user_api_key_required
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotFoundNotEnabled:
      title: PublicApiV2ErrorNotFoundNotEnabled
      description: Public API v2 is not enabled for the selected legal entity.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInternal:
      title: PublicApiV2ErrorInternal
      description: >-
        Slash could not complete the request. Quote `referenceId` when
        contacting Slash support.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - internal
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    UsdMoney:
      type: object
      description: A positive USD amount expressed in cents.
      properties:
        amount:
          type: integer
          minimum: 1
          description: Amount in cents. For example, `1250` represents USD 12.50.
          example: 1250
        currency:
          type: string
          enum:
            - USD
      required:
        - amount
        - currency
      additionalProperties: false
      title: UsdMoney
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable reason; branch on this, not on `message`. Every
            code an endpoint can return is listed on its reference page; the
            ones shared by all endpoints are explained in the Errors guide.
          example: invalid_request
        message:
          type: string
          description: >-
            Human-readable explanation, safe to show to an operator. Wording may
            change; use `code` and `details` programmatically.
        details:
          type: object
          description: >-
            The values behind `message`, keyed per `code`. For example
            `insufficient_funds` carries `available` and `requested`;
            `invalid_request` from contract validation carries one entry per
            failing field, keyed by JSON pointer. Empty when the code has no
            variable data.
          additionalProperties:
            type: string
          example:
            available: $120.00
            requested: $500.00
        referenceId:
          type: string
          description: Unique id of this failure. Quote it when contacting Slash support.
          example: 4001-2alj5if
      required:
        - code
        - message
        - details
        - referenceId
      additionalProperties: false
      title: Error
  responses:
    PublicApiV2Error400InvalidRequestShapeVirtualAccountsList:
      description: >-
        - `invalid_request (request shape)` — The body, query, or headers failed
        validation, or a required header is missing. `details` has one entry per
        failing location, keyed by JSON pointer or header name.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInvalidRequestShape'
          examples:
            invalid_request_request_shape:
              summary: invalid_request (request shape)
              value:
                code: invalid_request
                message: >-
                  Invalid `accountId`: Expected a valid ID beginning with
                  "sa_group_".
                details:
                  /accountId: Expected a valid ID beginning with "sa_group_".
                referenceId: 4001-2alj5if
    PublicApiV2Error401Unauthorized:
      description: '- `unauthorized` — API key authentication is missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorUnauthorized'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                code: unauthorized
                message: API key authentication is missing or invalid.
                details: {}
                referenceId: 4011-2alj5if
    PublicApiV2Error403ForbiddenLegalEntityUserApiKeyRequired:
      description: >-
        - `forbidden (legal entity)` — The credential is not permitted to act
        for the selected legal entity.

        - `user_api_key_required` — The API key is scoped to a legal entity
        rather than a user. Every v2 request needs a user API key, created under
        Settings → API keys in the Slash dashboard, together with the
        `x-legal-entity` header.
      content:
        application/json:
          schema:
            anyOf:
              - title: forbidden (legal entity)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbiddenLegalEntity'
              - title: user_api_key_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorUserApiKeyRequired'
          examples:
            forbidden_legal_entity:
              summary: forbidden (legal entity)
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            user_api_key_required:
              summary: user_api_key_required
              value:
                code: user_api_key_required
                message: >-
                  Public API v2 requires a user API key. Create one under
                  Settings → API keys in the Slash dashboard.
                details: {}
                referenceId: 4031-2alj5if
    PublicApiV2Error404NotFoundNotEnabled:
      description: >-
        - `not_found (API not enabled)` — Public API v2 is not enabled for the
        selected legal entity.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorNotFoundNotEnabled'
          examples:
            not_found_not_enabled:
              summary: not_found (API not enabled)
              value:
                code: not_found
                message: The requested resource was not found.
                details: {}
                referenceId: 4041-2alj5if
    PublicApiV2RateLimited:
      description: >-
        The request exceeded the applicable rate limit. The response body is
        plain text; clients must not depend on a response-body schema for this
        status.
    PublicApiV2Error500Internal:
      description: >-
        - `internal` — Slash could not complete the request. Quote `referenceId`
        when contacting Slash support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInternal'
          examples:
            internal:
              summary: internal
              value:
                code: internal
                message: >-
                  An unexpected error occurred. If this keeps happening, contact
                  Slash support with the reference id below.
                details: {}
                referenceId: 5001-2alj5if
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        User API key authentication. Create a key under Settings → API keys in
        the Slash dashboard (https://app.slash.com/global-settings/api-keys) and
        send the `x-legal-entity` header naming the legal entity to act on with
        every request. Keys scoped to a legal entity are rejected with `403
        user_api_key_required`.

````