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

# List registered sub-tenants

> Retrieves a paginated list of registered sub-tenants for the tenant. Accepts both public and secret keys.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/triglit/openapi.documented.yml get /v1/gateway/sub-tenants
openapi: 3.0.0
info:
  title: Triglit
  description: Documentação da API do Triglit
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/gateway/sub-tenants:
    get:
      tags:
        - Sub-Tenants
      summary: List registered sub-tenants
      description: >-
        Retrieves a paginated list of registered sub-tenants for the tenant.
        Accepts both public and secret keys.
      operationId: publicsubtenants_listSubTenants_v1
      parameters:
        - name: pageSize
          required: false
          in: query
          description: Number of sub-tenants per page
          schema:
            example: 20
            type: number
        - name: page
          required: false
          in: query
          description: Page number (zero-based)
          schema:
            example: 0
            type: number
        - name: X-API-Key
          in: header
          description: Chave de API do tenant (publishable key ou secret key)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of registered sub-tenants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubTenantListResponseDto'
        '401':
          description: API key não fornecida, inválida ou não encontrada.
        '403':
          description: Tipo de chave não permitido para este endpoint.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Triglit from 'triglit';

            const client = new Triglit({
              apiKey: 'My API Key',
            });

            // Automatically fetches more pages as needed.
            for await (const subTenant of client.subTenants.list()) {
              console.log(subTenant.id);
            }
components:
  schemas:
    SubTenantListResponseDto:
      type: object
      properties:
        data:
          description: List of registered sub-tenants
          type: array
          items:
            $ref: '#/components/schemas/SubTenantResponseDto'
        page:
          type: number
          description: Current page number (zero-based)
          example: 0
        lastPage:
          type: number
          description: Last page number available (zero-based)
          example: 2
      required:
        - data
        - page
        - lastPage
    SubTenantResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique registration identifier
          example: st_abc123def456
        tenantId:
          type: string
          description: Tenant identifier
          example: tenant_123
        subTenantId:
          type: string
          description: The actual sub-tenant identifier used in workflows/runs/metrics
          example: production
        name:
          type: string
          description: Display name for the sub-tenant
          example: Production Environment
        description:
          type: string
          description: Optional description
          example: Main production environment for customer workflows
        isRegistered:
          type: boolean
          description: Whether this sub-tenant is registered (always true for this DTO)
          example: true
        createdAt:
          type: string
          description: Creation timestamp
          example: '2024-01-15T10:30:00.000Z'
        updatedAt:
          type: string
          description: Last update timestamp
          example: '2024-01-15T10:30:00.000Z'
      required:
        - id
        - tenantId
        - subTenantId
        - name
        - isRegistered
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave de API do tenant (publishable key ou secret key)

````