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

# Create a new group



## OpenAPI

````yaml /api-reference/openapi.json post /api/{session}/groups
openapi: 3.0.3
info:
  title: Polymorfa WhatsApp API
  version: 0.0.0
  description: >-
    Public Polymorfa REST API for sessions, messaging, media, webhooks,
    campaigns, templates, client tokens, widgets, and bridge routing.
  contact:
    name: Polymorfa API
    url: https://docs.polymorfa.com
servers:
  - url: https://api.polymorfa.com
security:
  - BearerAuth: []
paths:
  /api/{session}/groups:
    post:
      tags:
        - Groups
      summary: Create a new group
      operationId: createGroup
      parameters:
        - schema:
            type: string
          required: true
          name: session
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGroupRequest'
      responses:
        '200':
          description: Group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateGroupResponse'
        '400':
          description: Bad request — request body or params failed validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated but not permitted (missing scope or rule violation)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateGroupRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        participants:
          type: array
          items:
            type: string
          minItems: 1
      required:
        - name
        - participants
    CreateGroupResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/Group'
      required:
        - success
        - data
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        docs:
          type: string
          description: URL to the documentation for this error
      required:
        - error
    Group:
      type: object
      properties:
        id:
          type: string
          description: Group JID (e.g. 120363...@g.us)
        name:
          type: string
        description:
          type: string
        ownerLid:
          type: string
        createdAt:
          type: number
          description: Unix timestamp in seconds
        participants:
          type: array
          items:
            $ref: '#/components/schemas/Participant'
      required:
        - id
        - name
        - description
        - ownerLid
        - createdAt
        - participants
    Participant:
      type: object
      properties:
        lid:
          type: string
        phoneNumber:
          type: string
        isAdmin:
          type: boolean
        isSuperAdmin:
          type: boolean
      required:
        - lid
        - isAdmin
        - isSuperAdmin
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa organization key (titan_ prefix), project token (titan_pt_
        prefix), or client token (titan_ct_ prefix), where the operation permits
        that audience.

````