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

# Unlink groups

> Unlinks groups from the community. The response includes the removed (`removed`) and the failed ones.



## OpenAPI

````yaml /en/api-reference/openapi.json post /communities/remove-groups
openapi: 3.1.0
info:
  title: Zapfy API
  description: >-
    Multi-tenant WhatsApp API. Send messages and manage webhooks through a
    single surface.
  version: 1.0.0
servers:
  - url: https://api.zapfy.io/v1
security:
  - accountToken: []
paths:
  /communities/remove-groups:
    post:
      tags:
        - Communities
      summary: Unlink groups
      description: >-
        Unlinks groups from the community. The response includes the removed
        (`removed`) and the failed ones.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommunityGroupsBody'
      responses:
        '200':
          $ref: '#/components/responses/CommunityGroupsRemoved'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '502':
          $ref: '#/components/responses/Error'
      security:
        - instanceToken: []
components:
  schemas:
    CommunityGroupsBody:
      type: object
      required:
        - id
        - groups
      properties:
        id:
          $ref: '#/components/schemas/CommunityId'
        groups:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/GroupId'
          description: Group ids to link/unlink.
          example:
            - 120363098765432109@g.us
    CommunityId:
      type: string
      description: >-
        Community id: the `...@g.us` `id` returned when creating the community
        (POST /communities/create). Use exactly as received.
      example: 120363012345678901@g.us
    GroupId:
      type: string
      description: the group id (returned by GET /groups).
      example: '120363012345678901'
    CommunityGroupsRemovedResult:
      type: object
      properties:
        removed:
          type: array
          items:
            type: string
          description: Unlinked group ids.
          example:
            - 120363098765432109@g.us
        failed:
          type: array
          items:
            type: string
          description: Group ids that failed.
          example: []
  responses:
    CommunityGroupsRemoved:
      description: Groups unlinked.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/CommunityGroupsRemovedResult'
    Error:
      description: Error.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Instance not found
  securitySchemes:
    accountToken:
      type: http
      scheme: bearer
      description: Account token (`zpfy_acct_...`) — manages instances and webhooks.
    instanceToken:
      type: http
      scheme: bearer
      description: Instance token (`zpfy_inst_...`) — sends messages.

````