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

# Demote Participant to Member

> Demotes the given admins back to regular members. Returns a per-participant outcome map.



## OpenAPI

````yaml api-reference/openapi-generated.json POST /v1/chats/{chat_id}/demote
openapi: 3.0.3
info:
  title: Periskope API
  version: 1.0.0
  description: >-
    Periskope external API.


    Responses use a flat, unwrapped shape: most endpoints return the resource at
    the top level, and list endpoints return a wrapper object with pagination
    inline (e.g. `{ from, to, count, chats: [...] }`). The documented response
    schemas describe these shapes directly.
servers:
  - url: https://api.periskope.app
security:
  - bearerAuth: []
paths:
  /v1/chats/{chat_id}/demote:
    post:
      tags:
        - Chats
      summary: Demote group admins to member
      description: >-
        Demotes the given admins back to regular members. Returns a
        per-participant outcome map.
      operationId: demoteGroupParticipants
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Unique id of the group chat, ending with @g.us. This endpoint only
              works on group chats — ids not ending with @g.us are rejected.
            example: 120363000000000000@g.us
          required: true
          description: >-
            Unique id of the group chat, ending with @g.us. This endpoint only
            works on group chats — ids not ending with @g.us are rejected.
          name: chat_id
          in: path
        - schema:
            type: string
            example: '919876543210'
            description: >-
              Optional. Phone to act with: country code + number without symbols
              or spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx).
              Omit to let the API select an eligible phone automatically —
              within the token's phone scopes and connected; chat actions use a
              phone that has the chat (a group admin where required), message
              actions use the phone the message belongs to.
          required: false
          description: >-
            Optional. Phone to act with: country code + number without symbols
            or spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx).
            Omit to let the API select an eligible phone automatically — within
            the token's phone scopes and connected; chat actions use a phone
            that has the chat (a group admin where required), message actions
            use the phone the message belongs to.
          name: x-phone
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                participants:
                  type: array
                  items:
                    type: string
                    nullable: true
                    minLength: 1
                    description: >-
                      Phone number of the participant, as country code + number
                      without symbols or spaces
                    example: '922222222222'
                  minItems: 1
                  description: >-
                    Phone numbers of the participants (country code + number,
                    e.g. 922222222222)
                  example:
                    - '922222222222'
              required:
                - participants
      responses:
        '200':
          description: Outcome per participant, keyed by contact_id
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/GroupParticipantOperationStatus'
                description: >-
                  Outcome per participant, keyed by the participant contact_id
                  (<countrycode><number>@c.us)
                example:
                  922222222222@c.us:
                    is_success: true
                    message: Invite sent to participant
              examples:
                default:
                  summary: Response body
                  value:
                    922222222222@c.us:
                      is_success: true
                      message: Invite sent to participant
        '400':
          description: The phone is disconnected or its server is off/unreachable
          content:
            application/json:
              examples:
                error:
                  summary: The phone is disconnected or its server is off/unreachable
                  value:
                    code: ERROR
                    message: The phone is disconnected or its server is off/unreachable
                    status: 400
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ERROR
                  message:
                    type: string
                    example: The phone is disconnected or its server is off/unreachable
                  status:
                    type: integer
                    example: 400
                example:
                  code: ERROR
                  message: The phone is disconnected or its server is off/unreachable
                  status: 400
        '401':
          description: Invalid, expired or missing API token
          content:
            application/json:
              examples:
                error:
                  summary: Invalid, expired or missing API token
                  value:
                    code: UNAUTHORIZED_ERROR
                    message: Invalid bearer auth token
                    status: 401
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNAUTHORIZED_ERROR
                  message:
                    type: string
                    example: Invalid bearer auth token
                  status:
                    type: integer
                    example: 401
                example:
                  code: UNAUTHORIZED_ERROR
                  message: Invalid bearer auth token
                  status: 401
        '422':
          description: Request validation failed
          content:
            application/json:
              examples:
                error:
                  summary: Request validation failed
                  value:
                    code: VALIDATION_ERROR
                    message: Request validation failed
                    status: 422
                    fields:
                      body.chat_id:
                        message: chat_id is required
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                  message:
                    type: string
                    example: Request validation failed
                  status:
                    type: integer
                    example: 422
                  fields:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        message:
                          type: string
                        value: {}
                    example:
                      body.chat_id:
                        message: chat_id is required
                example:
                  code: VALIDATION_ERROR
                  message: Request validation failed
                  status: 422
                  fields:
                    body.chat_id:
                      message: chat_id is required
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              examples:
                error:
                  summary: Rate limit exceeded
                  value:
                    code: RATE_LIMIT_ERROR
                    message: You can only make 100 requests per second
                    status: 429
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: RATE_LIMIT_ERROR
                  message:
                    type: string
                    example: You can only make 100 requests per second
                  status:
                    type: integer
                    example: 429
                example:
                  code: RATE_LIMIT_ERROR
                  message: You can only make 100 requests per second
                  status: 429
        '500':
          description: Internal server error
          content:
            application/json:
              examples:
                error:
                  summary: Internal server error
                  value:
                    code: UNKNOWN_ERROR
                    message: Internal server error
                    status: 500
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNKNOWN_ERROR
                  message:
                    type: string
                    example: Internal server error
                  status:
                    type: integer
                    example: 500
                example:
                  code: UNKNOWN_ERROR
                  message: Internal server error
                  status: 500
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |-
            import { PeriskopeApi } from '@periskope/periskope-client';

            const client = new PeriskopeApi({
              authToken: 'YOUR_API_KEY',
              phone: '919876543210', // the phone to act with (x-phone)
            });

            async function main() {
              const response = await client.chats.demoteGroupParticipants({
                chat_id: '120363000000000000@g.us',
                participants: [
                  '922222222222',
                ],
              });
              console.log(response);
            }

            main();
        - lang: bash
          label: cURL
          source: >-
            curl -X POST
            'https://api.periskope.app/v1/chats/120363000000000000@g.us/demote'
            \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -H 'x-phone: 919876543210' \
              -H 'Content-Type: application/json' \
              -d '{
                "participants": [
                  "922222222222"
                ]
              }'
components:
  schemas:
    GroupParticipantOperationStatus:
      type: object
      properties:
        is_success:
          type: boolean
          description: Whether the operation succeeded for this participant
          example: true
        message:
          type: string
          description: >-
            Detail on the outcome, e.g. 'Invite sent to participant' when the
            participant could not be added directly. Absent when there is
            nothing to add.
          example: Invite sent to participant
        code:
          type: number
          description: WhatsApp status code of a failed operation, when available
          example: 403
        isInviteV4Sent:
          type: boolean
          description: >-
            Present on add operations: true when a private group invite was sent
            instead of adding the participant directly
          example: true
      description: >-
        Outcome of a group participant operation (add/promote/demote/remove) for
        a single participant.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Periskope API token, sent as `Authorization: Bearer <token>`.
        Generate one from the Periskope dashboard under **Settings → API &
        Webhooks**. API access requires an active Pro or Enterprise plan.

````

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