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

# Create group

> Creates a group with the given participants

## Overview

Method that creates a group with its participants. You cannot send the image when creating the group: add it afterwards with [Update group photo](https://developer.omni.z-api.io/en/z-api/groups/update-group-photo.md).

Do not include the connected number in the participants list. As on WhatsApp Web, at least one contact is required to create the group.

Use phone numbers only. The `@lid` identifier is not supported for group creation: if sent, the group is created, but the participant with `@lid` is not added and the identifier comes back in `phonesNotAdded`.

> [!WARNING]
>
> On WhatsApp Official, **nobody is added at creation**: the numbers in `phones` come back in `phonesNotAdded`, because [Meta does not allow adding participants manually](https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference#create-group), and entry is only through the `invitationLink`. The group has at most [8 participants](https://developers.facebook.com/documentation/business-messaging/whatsapp/groups). To require [join approval](https://developers.facebook.com/documentation/business-messaging/whatsapp/groups/reference#groups-with-join-requests), send `requireAdminApproval` `true`.

> [!NOTE]
>
> The response structure is identical to Z-API. Your existing code that processes these returns will continue working without changes.


## OpenAPI

````yaml en/z-api/openapi.json POST /create-group
openapi: 3.1.0
info:
  title: Omni Z-API - Z-API Compatibility
  description: Z-API compatible API to facilitate migration to Omni Z-API
  version: 1.0.0
servers:
  - url: https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}
    variables:
      channel_id:
        description: Channel ID (equivalent to Z-API instance_id)
        default: YOUR_CHANNEL
      channel_token:
        description: Channel token (equivalent to Z-API token)
        default: YOUR_TOKEN
security:
  - bearerAuth: []
paths:
  /create-group:
    post:
      tags:
        - Groups
      summary: Create group
      description: Creates a group with the given participants.
      operationId: createGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreateRequest'
            example:
              autoInvite: true
              groupName: Grupo Z-API
              phones:
                - '5544999999999'
                - '5544888888888'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupCreateResponse'
              example:
                phone: 120363019502650977-group
                phonesNotAdded:
                  - 2111897971174599@lid
                  - '5544777777777'
                invitationLink: https://chat.whatsapp.com/GONwbGGDkLe8BifUWwLgct
        '400':
          $ref: '#/components/responses/GroupBadRequest'
        '422':
          $ref: '#/components/responses/GroupUnprocessable'
        '500':
          $ref: '#/components/responses/GroupInternalError'
        '502':
          $ref: '#/components/responses/GroupBadGateway'
        '503':
          $ref: '#/components/responses/GroupUnavailable'
components:
  schemas:
    GroupCreateRequest:
      type: object
      required:
        - autoInvite
        - groupName
        - phones
      properties:
        autoInvite:
          type: boolean
          description: >-
            If the participant cannot be added, sends a private invitation with
            the group link. Ignored on WhatsApp Official
        groupName:
          type: string
          description: Group name
          example: Grupo Z-API
        phones:
          type: array
          items:
            type: string
          description: List of the participants' phone numbers
        requireAdminApproval:
          type: boolean
          description: >-
            Requires administrator approval to join the group. Exists only on
            WhatsApp Official
    GroupCreateResponse:
      type: object
      properties:
        phone:
          type: string
          description: Group ID/Phone
        phonesNotAdded:
          type: array
          items:
            type: string
          description: Identifiers that were not added to the group
        invitationLink:
          type: string
          description: Group invitation link
    GroupError:
      type: object
      properties:
        error:
          type: string
          description: Error message
  responses:
    GroupBadRequest:
      description: >-
        Invalid request: parameter or field outside the rules. See the common
        errors in the Groups introduction.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GroupError'
          example:
            error: invalid path parameter
    GroupUnprocessable:
      description: >-
        Route unavailable for the channel type, inactive subscription or refusal
        by Meta. See the common errors in the Groups introduction.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GroupError'
          example:
            error: instance subscription is not active
    GroupInternalError:
      description: Unexpected internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GroupError'
          example:
            error: internal server error
    GroupBadGateway:
      description: The channel did not answer.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GroupError'
          example:
            error: failed to reach the META_WHATSAPP channel
    GroupUnavailable:
      description: >-
        Internal Omni Z-API failure that the request did not cause. Try again
        later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GroupError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generated in the Omni Z-API Security panel

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.