Skip to content

Unban#

Method under development#

The method is designed to lift the lock from a WhatsApp account. This method can only be used for numbers that have previously been connected to the instance. An error will be issued for numbers that have not been connected to the instance.

Request#

To send a request to unban, you have to execute a request at:

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

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

Request parameters#

Selective specification of parameters is allowed. At least one parameter must be specified.

Parameter Type Mandatory Description
phoneNumber integer Yes Phone number in international format without + or 00
description string Yes Description of the request to unblock the number and specify the blocked phone number

Request body example#

{
    "phoneNumber": 441234567890,
    "description":"Good afternoon! I would like to request to remove the blocking of the number 441234567890. The number is used in WhatsApp-business by our company to communicate with customers. Thank you!"
}

Response#

Response parameters#

Parameter Type Description
status string Account unlock request status
NO_APPEAL_OPEN - No unlock request was received
UNBANNED - Account is unblocked
IN_REVIEW - Request to remove the ban is being processed, a new request to unblock is not required
PERMANETLY_BANNED - Permanent ban, unbanning an account is impossible, you need to request
reason string Reason for refusal

Response body example#

{
    "status": "UNBANNED",
    "reason": "",
}

Unban errors#

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

Request examples#

import requests

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

payload = "{\r\n\t\"phoneNumber\": 441234567890\r\n,
"description":"Good afternoon! I would like to request to remove the blocking of the number 441234567890. The number is used in WhatsApp-business by our company to communicate with customers. Thank you!\"}"
headers = {
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/unban/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data '{
    "delaySendMessagesMilliseconds": 15000
}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/unban/")
    .append({{apiTokenInstance}});

var headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);

var jsonBody = "{\"phoneNumber\": 441234567890}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.POST, requestEntity, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/unban/")
    .append({{apiTokenInstance}});

var response = Unirest.post(requestUrl.toString())
    .header("Content-Type", "application/json")
    .body("{\"phoneNumber\": 441234567890}")
    .asString();

System.out.println(response);