Set group announce mode
curl --request PUT \
--url https://api.wsapi.chat/groups/{id}/settings/announce \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.wsapi.chat/groups/{id}/settings/announce"
payload = { "enabled": True }
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Instance-Id': '<x-instance-id>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.wsapi.chat/groups/{id}/settings/announce', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/groups/{id}/settings/announce");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
request.AddJsonBody("{\n \"enabled\": true\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Groups
Set group announce mode
When enabled, only admins can send messages.
PUT
/
groups
/
{id}
/
settings
/
announce
Set group announce mode
curl --request PUT \
--url https://api.wsapi.chat/groups/{id}/settings/announce \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.wsapi.chat/groups/{id}/settings/announce"
payload = { "enabled": True }
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Instance-Id': '<x-instance-id>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.wsapi.chat/groups/{id}/settings/announce', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/groups/{id}/settings/announce");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
request.AddJsonBody("{\n \"enabled\": true\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Instance or customer-level API key. Either the instance's own API key or the customer's API key is accepted. Must be paired with the X-Instance-Id header to identify the target instance.
Headers
The ID of the WhatsApp instance to use
Path Parameters
Group JID
Body
application/json
Response
Setting updated
⌘I