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

# Listar Subcontas

> Retorna as subcontas da conta.

**Permissão requerida:** `SUBACCOUNT:READ` ou `FULL_ACCESS`

<Note>
  Retorna as subcontas da conta principal, cada uma com o `reference` que você usa no header `X-Sub-Account` para operar nela. Veja [Subcontas](/#subcontas) para o comportamento do header e a tabela completa de erros.
</Note>


## OpenAPI

````yaml openapi.json GET /sub-accounts
openapi: 3.0.0
info:
  title: pague.dev API
  description: pague.dev Payment API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api-gateway.pague.dev/v2
security: []
paths:
  /sub-accounts:
    get:
      tags:
        - External API - Sub-accounts (Subcontas)
      summary: Listar subcontas
      description: |-
        Retorna as subcontas da conta.

        **Permissão requerida:** `SUBACCOUNT:READ` ou `FULL_ACCESS`
      operationId: ExternalSubAccountsController_getAllSubAccounts
      responses:
        '200':
          description: Lista de subcontas
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllSubAccountsOutput'
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '403':
          description: Forbidden - Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    GetAllSubAccountsOutput:
      type: object
      properties:
        data:
          description: Lista de subcontas da conta
          type: array
          items:
            $ref: '#/components/schemas/CreateSubAccountOutput'
      required:
        - data
    UnauthorizedErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Authentication token is required
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
      required:
        - statusCode
        - error
        - message
        - timestamp
    ForbiddenErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: You do not have permission to access this resource
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
      required:
        - statusCode
        - error
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 500
        error:
          type: string
          example: InternalError
        message:
          type: string
          example: An unexpected error occurred
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
          example: 2771463d58840c8e116dc6dda1e1e5d0
      required:
        - statusCode
        - error
        - message
        - timestamp
    CreateSubAccountOutput:
      type: object
      properties:
        id:
          type: string
          description: ID da subconta
          format: uuid
        reference:
          type: string
          description: Reference da subconta
          example: loja-centro
        name:
          type: string
          description: Nome da subconta
          example: Loja Centro
        status:
          type: string
          description: Status da subconta
          example: approved
        createdAt:
          type: string
          description: Data de criação
          format: date-time
      required:
        - id
        - reference
        - name
        - status
        - createdAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token obtido no POST /auth (client_id + client_secret). Válido
        por 300 segundos.

````