PUT
/api/groups/{groupId}/participants/update
Promote or demote one or more participants in a specific group.
Update Group Participants' Roles
This endpoint allows you to change the role of participants within a group. You can either promote a member to an admin or demote an admin back to a regular member.
This action requires that your session has admin privileges in the target group. You can perform the action on multiple participants in a single API call by including their JIDs in the participants
array.
The action
parameter determines the operation to be performed:
promote
: Grants admin privileges to the specified participants.demote
: Revokes admin privileges from the specified participants.
Parameters
Name | Type | Required | Description |
---|---|---|---|
groupId | string | Yes | The JID of the group (e.g., [email protected]). |
action | string | Yes | The action to perform on the participants. Must be either `promote` or `demote`. |
participants | array | Yes | An array of user JIDs (strings) to update. |
Code Examples
curl -X PUT "https://www.wasenderapi.com/api/groups/[email protected]/participants/update"
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"action": "promote",
"participants": ["[email protected]", "[email protected]"]
}'
Response Examples
{
"success": true,
"data": {
"participants": ["[email protected]"]
}
}