> ## 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.

# Create a workspace group

> Create a new workspace group for the specified organization. Only STATIC type workspace groups are currently supported. Returns the created workspace group ID upon successful creation.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json post /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:
    post:
      tags:
        - Workspace groups
      summary: Create a workspace group
      description: >-
        Create a new workspace group for the specified organization. Only STATIC
        type workspace groups are currently supported. Returns the created
        workspace group ID upon successful creation.
      operationId: createWorkspaceGroup
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspacegroupsCreateRequestV1'
            examples:
              create-static-workspace-group:
                summary: Create a workspace group with minimal required fields
                value:
                  name: Production Workspace Group
              create-workspace-group-with-description:
                summary: Create a workspace group with description
                value:
                  name: Development Workspace Group
                  description: Workspaces for Development Environments
                  type: static
              create-workspace-group-with-location:
                summary: Create a workspace group with location information
                value:
                  name: Madrid Office Workspace Group
                  description: Workspaces for the Madrid Office
                  type: static
                  location:
                    latitude: 40.4168
                    longitude: -3.7038
                    address: Madrid, Spain
                    description: Main Office Location
      responses:
        '201':
          description: >-
            Workspace group successfully created. The response contains the
            created resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceGroupDetailResponseV1'
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Bad Request. Common Causes: - Missing required fields - Invalid
            field values - Invalid type value (only STATIC allowed) - Invalid
            location structure
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Unauthorized - authentication required
        '404':
          $ref: '#/components/responses/NotFound'
          description: Organization not found
        '409':
          $ref: '#/components/responses/Conflict'
          description: 'Conflict: a workspace group with the same name already exists'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    WorkspacegroupsCreateRequestV1:
      type: object
      properties:
        name:
          type: string
          maxLength: 512
        description:
          type: string
          maxLength: 512
        type:
          type: string
          enum:
            - static
          default: static
        location:
          $ref: '#/components/schemas/WorkspaceGroupBaseUpdateLocationInputV1'
      required:
        - name
    WorkspaceGroupDetailResponseV1:
      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 group
        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
        - name
        - organization id
        - create_date
    WorkspaceGroupBaseUpdateLocationInputV1:
      type: object
      properties:
        latitude:
          type: number
        longitude:
          type: number
        address:
          type: string
          maxLength: 512
        description:
          type: string
          maxLength: 512
      required:
        - latitude
        - longitude
        - address
    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
    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'
    Conflict:
      description: Conflict
      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

````