> ## 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 workspace groups

> Retrieve a paginated list of workspace groups belonging to the specified organization. Supports filtering and sorting on workspace group properties. Filters are provided as a JSON string following the AST structure of FilterNode. Results are returned in pages with pagination metadata.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json get /v1/organizations/{organization_id}/workspace-groups
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}/workspace-groups:
    get:
      tags:
        - Workspace groups
      summary: List workspace groups
      description: >-
        Retrieve a paginated list of workspace groups belonging to the specified
        organization. Supports filtering and sorting on workspace group
        properties. Filters are provided as a JSON string following the AST
        structure of FilterNode. Results are returned in pages with pagination
        metadata.
      operationId: listWorkspaceGroups
      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
          description: 'Page number (default: 1)'
        - name: sort
          in: query
          required: false
          schema:
            type: string
          description: >-
            Sort field with optional order suffix (:asc or :desc). Valid sort
            fields: id, name, description, create_user, create_date, type,
            location. Ascending order is default if no suffix provided.
        - name: fields
          in: query
          required: false
          schema:
            type: string
            maxLength: 2048
          description: >-
            Comma-separated list of fields to include in each workspace group
            item. Selectable fields: id, name, description, organization_id,
            create_user, create_date, type, filter, location, entra_id_source.
            The id field is always included.
          example: name,type,create_date
        - name: filters
          in: query
          required: false
          schema:
            type: string
            maxLength: 5120
            description: >-
              Filter workspace groups using a JSON object. Specify the field to
              filter, comparison operator, and value. Example: {"field": "name",
              "op": "eq", "value": "workspace groups 1"}
            example: '{"field": "name", "op": "eq", "value": "Workspace Group 1"}'
          description: >-
            Filter workspace groups by one or more criteria. Provide a JSON
            object with filtering conditions. You can filter by: id, name,
            description, create_user, create_date, type, location,
            entra_id_source.resource_id, entra_id_source.resource_type,
            entra_id_source.resource_name. For nested fields like location or
            entra_id_source, use dot notation (e.g., location.latitude,
            entra_id_source.resource_type). 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: Filter by workspace groups' name
              description: Return workspace groups whose name contains the provided text.
              value: '{"field": "name", "op": "contains", "value": "finance"}'
            complex-and:
              summary: Filter by type and location
              description: Return STATIC workspace groups above a latitude threshold.
              value: >-
                {"and": [{"field": "type", "op": "eq", "value": "STATIC"},
                {"field": "location.latitude", "op": "gt", "value": 40}]}
            complex-or-and:
              summary: Combine OR and AND conditions
              description: >-
                Match multiple name patterns and require a specific Entra
                resource type.
              value: >-
                {"and": [{"or": [{"field": "name", "op": "contains", "value":
                "Finance"}, {"field": "name", "op": "contains", "value":
                "HR"}]}, {"field": "entra_id_source.resource_type", "op": "eq",
                "value": "GROUP"}]}
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
            minimum: 1
          description: Number of items per page
      responses:
        '200':
          description: >-
            Paginated list of workspace groups successfully retrieved. The
            response includes pagination metadata and an array of workspace
            group data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceGroupListItemV1ListResponseV1'
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Bad Request. Common Causes: - Invalid pagination parameters -
            Invalid sorting parameter - Invalid filtering 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:
    WorkspaceGroupListItemV1ListResponseV1:
      type: object
      properties:
        has_next:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceGroupListItemV1'
      required:
        - has_next
        - data
    WorkspaceGroupListItemV1:
      type: object
      properties:
        id:
          type: string
          pattern: ^[0-9a-f]{24}$
          description: ID of the workspace group
        name:
          type: string
          description: Name of the workspace group
        description:
          type: string
          nullable: true
          description: Description of the workspace group
        organization_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          description: Organization identifier
        create_user:
          type: string
          nullable: true
          pattern: ^[0-9a-f]{24}$
          description: ID of the user who created the workspace group
        create_date:
          type: string
          format: date-time
          description: Creation timestamp
        type:
          type: string
          nullable: true
          enum:
            - static
            - dynamic
            - entra_id
          description: Type of workspace groups
        filter:
          type: string
          nullable: true
          description: Filter string for dynamic workspace groups
        location:
          $ref: '#/components/schemas/WorkspaceLocationV1'
          nullable: true
          description: Location information of the workspace group
        entra_id_source:
          $ref: '#/components/schemas/WorkspaceGroupEntraIdSourceV1'
          nullable: true
          description: Entra ID source information for the workspace group
      required:
        - id
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
    WorkspaceLocationV1:
      type: object
      properties:
        latitude:
          type: number
          description: Latitude coordinate
        longitude:
          type: number
          description: Longitude coordinate
        address:
          type: string
          description: Address string
        description:
          type: string
          nullable: true
          description: Location description
      required:
        - latitude
        - longitude
        - address
    WorkspaceGroupEntraIdSourceV1:
      type: object
      properties:
        resource_id:
          type: string
          description: Entra ID resource ID
        resource_type:
          type: string
          enum:
            - group
            - administrative_unit
          description: Entra ID resource type
        resource_name:
          type: string
          description: Entra ID resource name
      required:
        - resource_id
        - resource_type
        - resource_name
  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

````