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

# Create group

> Use when organizing entities into a group (e.g. for filtering prices or plans by product line or region).



## OpenAPI

````yaml /api-reference/openapi.json post /groups
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /groups:
    post:
      tags:
        - Groups
      summary: Create group
      description: >-
        Use when organizing entities into a group (e.g. for filtering prices or
        plans by product line or region).
      operationId: createGroup
      requestBody:
        description: Group
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGroupRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateGroupRequest:
      required:
        - entity_type
        - lookup_key
        - name
      type: object
      properties:
        entity_type:
          type: string
        lookup_key:
          type: string
        name:
          type: string
    GroupResponse:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        entity_ids:
          type: array
          items:
            type: string
        entity_type:
          type: string
        id:
          type: string
        lookup_key:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        name:
          type: string
        status:
          type: string
        updated_at:
          type: string
          format: date-time
    errors.ErrorResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - not_found
            - already_exists
            - version_conflict
            - validation_error
            - invalid_operation
            - permission_denied
            - http_client_error
            - database_error
            - system_error
            - internal_error
            - service_unavailable
        details:
          type: object
          additionalProperties:
            type: object
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````