Skip to content

SetGroupAdmin#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method makes a participant of a group an admin.

The method uses the limits on the number of requests per second.

Request#

To set an admin, you have to execute a request at:

POST
{{apiUrl}}/waInstance{{idInstance}}/setGroupAdmin/{{apiTokenInstance}}

For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.

Request parameters#

Parameter Type Mandatory Description
chatId string Yes The identifier of the group chat
participantChatId string Yes The numeric identifier of the group participant or a username with the @ prefix

Request body example#

{
    "chatId": "340282366841710300949128174631143137232",
    "participantChatId": "25025320"
}

Response#

Response parameters#

Field Type Description
setGroupAdmin boolean The flag of the admin being set

Response body example#

{
    "setGroupAdmin": true
}

SetGroupAdmin errors#

For a list of errors common to all methods, refer to the Common errors section

HTTP code Error ID Description
400 Bad Request
Validation failed
Validation error
200 "setGroupAdmin": false The participant is not made an admin: Instagram rejected the request.
Possible reasons:
- the group is not found
- the participantChatId account is not found in Instagram, is deactivated or blocked
- the instance account has no rights for this action in the group

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/setGroupAdmin/{{apiTokenInstance}}"

payload = {
    "chatId": "340282366841710300949128174631143137232",
    "participantChatId": "25025320"
}
headers = {'Content-Type': 'application/json'}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/setGroupAdmin/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": "340282366841710300949128174631143137232",
    "participantChatId": "25025320"
}'