> ## 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 all sub-tenants (registered and arbitrary)

> Retrieves a combined paginated list of both registered sub-tenants and arbitrary sub-tenant IDs found in runs. Accepts both public and secret keys.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/triglit/openapi.documented.yml get /v1/gateway/sub-tenants/combined
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/combined:
    get:
      tags:
        - Sub-Tenants
      summary: List all sub-tenants (registered and arbitrary)
      description: >-
        Retrieves a combined paginated list of both registered sub-tenants and
        arbitrary sub-tenant IDs found in runs. Accepts both public and secret
        keys.
      operationId: publicsubtenants_listCombinedSubTenants_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: Combined list of all sub-tenants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CombinedSubTenantListResponseDto'
        '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 subTenantListCombinedResponse of
            client.subTenants.listCombined()) {
              console.log(subTenantListCombinedResponse.id);
            }
components:
  schemas:
    CombinedSubTenantListResponseDto:
      type: object
      properties:
        data:
          description: List of all sub-tenants (both registered and arbitrary/unregistered)
          type: array
          items:
            $ref: '#/components/schemas/CombinedSubTenantDto'
        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
    CombinedSubTenantDto:
      type: object
      properties:
        subTenantId:
          type: string
          description: The sub-tenant identifier
          example: production
        name:
          type: string
          description: Display name (only present if registered)
          example: Production Environment
        description:
          type: string
          description: Description (only present if registered)
          example: Main production environment
        isRegistered:
          type: boolean
          description: Whether this sub-tenant is registered
          example: true
        id:
          type: string
          description: Registration ID (only present if registered)
          example: st_abc123def456
        createdAt:
          type: string
          description: Creation timestamp (only present if registered)
          example: '2024-01-15T10:30:00.000Z'
        updatedAt:
          type: string
          description: Last update timestamp (only present if registered)
          example: '2024-01-15T10:30:00.000Z'
      required:
        - subTenantId
        - isRegistered
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave de API do tenant (publishable key ou secret key)

````