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

# Remove group participants

> Removes one or more participants from a WhatsApp group.

The request is processed asynchronously. Use webhooks to receive the final participants update result.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml post /whatsapp/groups/{groupId}/participants/remove
openapi: 3.0.0
info:
  description: >-
    The [YCloud](https://ycloud.com) API is organized around
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our
    API is designed to have predictable, resource-oriented URLs, return
    [JSON](https://www.json.org) responses, and use standard HTTP response codes
    and verbs.
  version: v2
  title: YCloud API
  termsOfService: https://ycloud.com/terms-service
  contact:
    email: service@ycloud.com
servers:
  - url: https://api.ycloud.com/v2
    description: Base URL
security:
  - api_key: []
tags:
  - name: Balance
  - name: Contacts
  - name: Custom Events
  - name: Emails
  - name: SMS
  - name: Unsubscribers
  - name: Verify
  - name: Voices
  - name: Webhook Endpoints
  - name: WhatsApp Business Accounts
  - name: WhatsApp Inbound Messages
  - name: WhatsApp Media
  - name: WhatsApp Messages
  - name: WhatsApp Blocked Users
  - name: WhatsApp Groups
  - name: WhatsApp Calling
  - name: WhatsApp Phone Numbers
  - name: WhatsApp Templates
  - name: WhatsApp Flows
  - name: Meta Business Agent
  - name: WhatsApp Group Messages
externalDocs:
  description: Homepage
  url: https://ycloud.com
paths:
  /whatsapp/groups/{groupId}/participants/remove:
    post:
      tags:
        - WhatsApp Groups
      summary: Remove group participants
      description: >-
        Removes one or more participants from a WhatsApp group.


        The request is processed asynchronously. Use webhooks to receive the
        final participants update result.
      operationId: whatsapp_group-remove-participants
      parameters:
        - $ref: '#/components/parameters/groupId-in_path'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappGroupRemoveParticipantsRequest'
            example:
              participants:
                - user: '16315551111'
        required: true
      responses:
        '200':
          description: The participant removal request is successfully accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappGroupAsyncResponse'
        '400':
          description: Bad request. Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: curl
          label: Remove by WhatsApp user ID
          source: |
            curl --request POST \
              --url https://api.ycloud.com/v2/whatsapp/groups/{groupId}/participants/remove \
              --header 'Content-Type: application/json' \
              --header 'X-API-Key: <api-key>' \
              --data '{"participants":[{"user":"16315551111"}]}'
        - lang: python
          label: Remove by WhatsApp user ID
          source: |
            import requests

            response = requests.post(
                "https://api.ycloud.com/v2/whatsapp/groups/{groupId}/participants/remove",
                headers={"X-API-Key": "<api-key>"},
                json={"participants": [{"user": "16315551111"}]},
            )
            response.raise_for_status()
        - lang: javascript
          label: Remove by WhatsApp user ID
          source: |
            const response = await fetch(
              "https://api.ycloud.com/v2/whatsapp/groups/{groupId}/participants/remove",
              {
                method: "POST",
                headers: {
                  "Content-Type": "application/json",
                  "X-API-Key": "<api-key>",
                },
                body: JSON.stringify({
                  participants: [{ user: "16315551111" }],
                }),
              },
            );
components:
  parameters:
    groupId-in_path:
      name: groupId
      in: path
      description: WhatsApp group ID.
      required: true
      schema:
        type: string
        example: 120363345678901234@g.us
  schemas:
    WhatsappGroupRemoveParticipantsRequest:
      type: object
      required:
        - participants
      properties:
        participants:
          type: array
          description: >-
            Participants to remove. Up to 8 participants are supported in one
            request.
          maxItems: 8
          items:
            $ref: '#/components/schemas/WhatsappGroupRemoveParticipant'
      example:
        participants:
          - user: '16315551111'
    WhatsappGroupAsyncResponse:
      type: object
      description: Response for asynchronous WhatsApp group operations.
      properties:
        requestId:
          type: string
          description: The request ID for tracking the asynchronous operation in webhooks.
          example: REQ_1
        status:
          type: string
          description: The asynchronous request status.
          enum:
            - pending
          example: pending
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
          description: >-
            Contains the error code and human-readable message for the API
            error.
    WhatsappGroupRemoveParticipant:
      type: object
      description: >-
        Participant identifier for a group removal request. Provide exactly one
        of `user`, `fromUserId`, or its compatibility alias `userId`.
      allOf:
        - not:
            allOf:
              - not:
                  required:
                    - user
              - not:
                  required:
                    - fromUserId
              - not:
                  required:
                    - userId
        - not:
            anyOf:
              - required:
                  - user
                  - fromUserId
              - required:
                  - user
                  - userId
              - required:
                  - fromUserId
                  - userId
      properties:
        user:
          type: string
          description: WhatsApp user ID to remove.
          example: '16315551111'
        fromUserId:
          type: string
          description: Business-scoped user ID to remove.
          pattern: ^[A-Z]{2}\.[A-Za-z0-9]{1,128}$
          example: US.1234
        userId:
          type: string
          description: >-
            Compatibility alias of `fromUserId` for the business-scoped user ID
            to remove.
          pattern: ^[A-Z]{2}\.[A-Za-z0-9]{1,128}$
          example: US.1234
    Error:
      type: object
      required:
        - status
        - code
      properties:
        status:
          type: integer
          format: int32
          pattern: '[45]\d{2}'
          description: >-
            HTTP status code, [RFC 7231, Section
            6](https://datatracker.ietf.org/doc/html/rfc7231#section-6). It
            conveys the HTTP status code used for the convenience of the
            consumer.
          example: 404
        code:
          type: string
          description: >-
            One of a server-defined error codes. Some `4xx` errors that could be
            handled programmatically include an error code that briefly explains
            the error reported.
          example: NOT_FOUND
        message:
          type: string
          description: >-
            A human-readable representation of the error. It is intended as an
            aid to developers and is not suitable for exposure to end users.
          example: The requested resource does not exist.
        target:
          type: string
          description: The target of the error.
          example: ''
        docUrl:
          type: string
          description: A URL to more information about the error.
          example: ''
        requestId:
          type: string
          description: >-
            Each API request has an associated request ID. It conveys the
            response header `YCloud-Request-ID` used for the convenience of the
            consumer.
          example: req_1KjtKI80IKoaJNa6n6p
        whatsappApiError:
          $ref: '#/components/schemas/WhatsappApiError'
          description: >-
            The original error object returned by WhatsApp. See [Handling
            Errors](https://developers.facebook.com/docs/graph-api/guides/error-handling),
            [Cloud API Error
            Codes](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes).


            Note: This field is returned if we tried to request the WhatsApp
            Business API and got an error response.
        metaBusinessAgentApiError:
          $ref: '#/components/schemas/MetaBusinessAgentApiError'
          description: >-
            Sanitized upstream details returned when a Meta Business Agent
            request fails.
    WhatsappApiError:
      type: object
      description: >-
        The original error object returned by WhatsApp. See [Handling
        Errors](https://developers.facebook.com/docs/graph-api/guides/error-handling),
        [Cloud API Error
        Codes](https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes).
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: A human-readable description of the error.
          example: HSM Template creation failed
        code:
          type: string
          description: An error code.
          example: 200002
        type:
          type: string
          description: Error type.
          example: OAuthException
        is_transient:
          type: boolean
          description: Whether the error is transient.
          example: false
        error_subcode:
          type: string
          description: Additional code about the error.
          example: 2388109
        error_user_msg:
          type: string
          description: >-
            The message to display to the user. The language of the message is
            based on the locale of the API request.
          example: This message template cannot be created.
        error_user_title:
          type: string
          description: >-
            The title of the dialog, if shown. The language of the message is
            based on the locale of the API request.
          example: Message Cannot Be Submitted
        fbtrace_id:
          type: string
          description: >-
            Internal support identifier. When reporting a bug related to a Graph
            API call, include the fbtrace_id to help us find log data for
            debugging.
          example: AVGjJ7ia2zJkrHG
        error_data:
          description: >-
            Additional data about the error. A string or map.

            - For template APIs, this field is a string describing the reason
            for the error.

            - For message APIs, this field is a map with property `details`
            describing the reason for the error.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
    MetaBusinessAgentApiError:
      type: object
      description: Sanitized details from a failed Meta Business Agent upstream request.
      properties:
        title:
          type: string
        detail:
          type: string
        type:
          type: string
        status:
          type: integer
          format: int32
        requestId:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````

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