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

# Manage Participants

> Add, remove, promote, demote, approve, or reject participants in a group

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no

## Description

Single endpoint for 6 actions on participants, set the operation in the `action` field. Each participant gets an individual result (`success: bool`), so **partial operations are possible**: the call may return `200` with some members failing.

## Examples

### Add to Group

Adds 2 numbers to the group `120363406289005073@g.us` in a single call (`action: "add"`). Failures from privacy settings or numbers without WhatsApp are isolated as `success: false` in the `participants` array.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "add",
      "identifier": "120363406289005073@g.us",
      "participants": ["5511999999999", "5521988888888"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "add",
      identifier:   "120363406289005073@g.us",
      participants: ["5511999999999", "5521988888888"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "add",
          "identifier":   "120363406289005073@g.us",
          "participants": ["5511999999999", "5521988888888"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "add",
          "identifier": "120363406289005073@g.us",
          "participants": ["5511999999999", "5521988888888"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Promote to Admin

Promotes the number `5511999999999` to admin via `action: "promote"`. Requires that you are super-admin of the group (creator or promoted by another super-admin).

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "promote",
      "identifier": "120363406289005073@g.us",
      "participants": ["5511999999999"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "promote",
      identifier:   "120363406289005073@g.us",
      participants: ["5511999999999"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "promote",
          "identifier":   "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "promote",
          "identifier": "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Demote to Member

Removes the admin role from the number `5511999999999` via `action: "demote"`, returning them to plain member status. Also requires super-admin privilege.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "demote",
      "identifier": "120363406289005073@g.us",
      "participants": ["5511999999999"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "demote",
      identifier:   "120363406289005073@g.us",
      participants: ["5511999999999"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "demote",
          "identifier":   "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "demote",
          "identifier": "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Approve Group Join (pending request)

Approves a pending join request by passing the LID `199789077627112@lid` in `participants` with `action: "approve"`. Only works in groups with `requireAdminApproval=true`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "approve",
      "identifier": "120363406289005073@g.us",
      "participants": ["199789077627112@lid"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "approve",
      identifier:   "120363406289005073@g.us",
      participants: ["199789077627112@lid"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "approve",
          "identifier":   "120363406289005073@g.us",
          "participants": ["199789077627112@lid"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "approve",
          "identifier": "120363406289005073@g.us",
          "participants": ["199789077627112@lid"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Reject Group Join (pending request)

Rejects a pending request from the number `5511999999999` via `action: "reject"`. The service automatically resolves the equivalent LID when you pass only the phone number.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "reject",
      "identifier": "120363406289005073@g.us",
      "participants": ["5511999999999"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "reject",
      identifier:   "120363406289005073@g.us",
      participants: ["5511999999999"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "reject",
          "identifier":   "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "reject",
          "identifier": "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Remove from Group

Removes the number `5511999999999` from the group via `action: "remove"`. The ex-member can rejoin via the invite link unless you generate a new link with [`/reset-link`](/en/api/groups/reset-link).

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/participants/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "action": "remove",
      "identifier": "120363406289005073@g.us",
      "participants": ["5511999999999"]
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/participants/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      action:       "remove",
      identifier:   "120363406289005073@g.us",
      participants: ["5511999999999"]
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/group/participants/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "action":       "remove",
          "identifier":   "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "action": "remove",
          "identifier": "120363406289005073@g.us",
          "participants": ["5511999999999"]
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/participants/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

Each participant receives an individual result with `success: true|false` in the `participants` array. **Partial operations are possible**, the call may return `200` even with some members failing (number without WhatsApp, privacy blocks add, already a member, etc.). Always inspect each entry to detect isolated errors; the `error` field carries the reason when `success=false`.

```json 200 OK (partial) theme={null}
{
  "success": true,
  "message": "Successfully added 2 participant(s)",
  "groupJid": "120363406289005073@g.us",
  "action": "add",
  "participants": [
    {
      "jid": "5511999999999@s.whatsapp.net",
      "isAdmin": false,
      "isSuperAdmin": false,
      "success": true
    },
    {
      "jid": "5521988888888@s.whatsapp.net",
      "isAdmin": false,
      "isSuperAdmin": false,
      "success": false,
      "error": "user not on whatsapp"
    }
  ]
}
```

<Warning>
  Individual failures (`success: false`) **do not** abort processing of the remaining participants. Always inspect each entry to detect partial errors (e.g., number without WhatsApp, already a member, privacy blocks add).
</Warning>

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="action" type="string" required>
  One of: `add`, `remove`, `promote`, `demote`, `approve`, `reject`.
</ParamField>

<ParamField body="identifier" type="string" required>
  Group JID, invite code, or link.
</ParamField>

<ParamField body="participants" type="string[]" required>
  Numbers or JIDs targeted by the operation. At least **1** item.
</ParamField>

### Action table

| `action`  | Permission  | Timeout | Use                     |
| --------- | ----------- | ------- | ----------------------- |
| `add`     | Admin       | 60s     | Add numbers / JIDs      |
| `remove`  | Admin       | 60s     | Remove members          |
| `promote` | Super-admin | 60s     | Make admin              |
| `demote`  | Super-admin | 60s     | Remove admin            |
| `approve` | Admin       | 90s     | Approve pending request |
| `reject`  | Admin       | 90s     | Reject pending request  |

## Notes

<Note>
  * `promote` / `demote` require you to be **super-admin** (group creator or promoted by a super-admin).
  * `approve` / `reject` only work for groups with `requireAdminApproval=true` and have a longer timeout (90s) since they depend on responses from WhatsApp.
  * For `approve`/`reject`, prefer to pass the **LID** returned by [`/requests`](/en/api/groups/requests); if you only have the phone number, the service tries to resolve the equivalent LID automatically.
</Note>

## Errors

| HTTP | Message                                                                         |
| ---- | ------------------------------------------------------------------------------- |
| 400  | `Invalid action. Must be one of: add, remove, promote, demote, approve, reject` |
| 400  | `At least one participant is required`                                          |
| 400  | `Identifier is required`                                                        |
| 403  | `Not authorized to perform this action (must be admin)`                         |
| 404  | `Group not found or you are not a member of this group`                         |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "Invalid action. Must be one of: add, remove, promote, demote, approve, reject" }
}
```
