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

# List tenants

> Retrieve a paginated list of tenants who belong to the specified organization. Supports filtering and sorting over tenant properties. Filters are provided as a JSON string following the FilterNode AST structure. Results are returned in pages with pagination metadata.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json get /v1/organizations/{organization_id}/tenants
openapi: 3.0.3
info:
  title: Public Portal API
  version: 1.0.0
  description: Public REST API for portal
servers:
  - url: https://api.staging.flxwvdexternal.com
    description: Staging API server.
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/tenants:
    get:
      tags:
        - Tenants
      summary: List tenants
      description: >-
        Retrieve a paginated list of tenants who belong to the specified
        organization. Supports filtering and sorting over tenant properties.
        Filters are provided as a JSON string following the FilterNode AST
        structure. Results are returned in pages with pagination metadata.
      operationId: listTenants
      parameters:
        - name: organization id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: The unique identifier of the organization
          example: 507f1f77bcf86cd799439011
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
          description: 'Page number (default: 1)'
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
            minimum: 1
          description: Number of items per page
        - name: sort
          in: query
          required: false
          schema:
            type: string
          description: >-
            Sorting field with optional order suffix (:asc or :desc), e.g.,
            "name", "name:asc", "create_date:desc". Use ascending order by
            default if no suffix is provided. Valid fields: id, create_date,
            name, region, product_id, policy_id
        - name: fields
          in: query
          required: false
          schema:
            type: string
            maxLength: 2048
          description: >-
            Comma-separated list of fields to include in each tenant element.
            Selectable fields: id, organization_id, create_date, name, region,
            product_id, policy_id. The field id is always included.
          example: name,region,product_id
        - name: filters
          in: query
          required: false
          schema:
            type: string
            maxLength: 5120
            description: >-
              Filter tenants using a JSON object. Specify the field to filter,
              comparison operator, and value. Example: {"field": "name", "op":
              "eq", "value": "Tenant 1"}
            example: '{"field": "name", "op": "eq", "value": "Tenant 1"}'
          description: >-
            Filter tenants by one or more criteria. Provide a JSON object with
            filter conditions. You can filter by any field returned in the
            response. Use comparison operators (eq, ne, gt, gte, lt, lte, in,
            nin, contains, startsWith, endsWith, between) and combine multiple
            conditions with logical operators (and, or). Maximum length: 5120
            characters.
          examples:
            simple:
              summary: Simple filter
              description: Filter tenants by name containing a text.
              value: '{"field": "name", "op": "contains", "value": "production"}'
            complex-and:
              summary: Complex filter using AND
              description: Filter tenants by region and product at the same time.
              value: >-
                {"and": [{"field": "region", "op": "eq", "value": "us-east"},
                {"field": "product_id", "op": "eq", "value":
                "507f1f77bcf86cd799439030"}]}
            complex-or-and:
              summary: Combine OR and AND conditions
              description: Match multiple regions and apply a name restriction.
              value: >-
                {"and": [{"or": [{"field": "region", "op": "eq", "value":
                "us-east"}, {"field": "region", "op": "eq", "value":
                "eu-west"}]}, {"field": "name", "op": "contains", "value":
                "tenant"}]}
      responses:
        '200':
          description: >-
            Paginated list of tenants successfully retrieved. The response
            includes pagination flag and tenant data array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantListItemV1ListResponseV1'
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Bad Request. Common Causes: - Invalid pagination parameters -
            Invalid sorting parameter - Invalid filter parameters
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Unauthorized - authentication required
        '404':
          $ref: '#/components/responses/NotFound'
          description: Organization not found
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    TenantListItemV1ListResponseV1:
      type: object
      properties:
        has_next:
          type: boolean
          description: Indicates if more pages are available
        data:
          type: array
          items:
            $ref: '#/components/schemas/TenantListItemV1'
      required:
        - has_next
        - data
    TenantListItemV1:
      type: object
      properties:
        id:
          type: string
          description: Tenant ID
        organization_id:
          type: string
          description: Tenant organization ID
        create_date:
          type: string
          format: date-time
          description: Creation date (ISO 8601 date and time)
        name:
          type: string
          description: Tenant name
        region:
          type: string
          description: Region/Region ID
        product_id:
          type: string
          nullable: true
          description: Product identifier (nullable if tenant has no assigned product)
        policy_id:
          type: string
          nullable: true
          description: Policy identifier (nullable if the tenant has no assigned policy)
      required:
        - id
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````