DeleteInstanceAccount#
The method is used to deleting an instance of the partners's account.
Warning
Deleting an instance does not log out the linked device. An active session remains in the mobile app. We recommend deleting only unauthorized instances or using the Logout method before deleting an instance.
Request#
To delete an instance on the partner's part you have to execute a POST request at:
POST
{{partnerApiUrl}}/partner/deleteInstanceAccount/{{partnerToken}}
For
partnerApiUrlrequest parameter, you can find it in your console.For
partnerTokenrequest parameter please contact GREEN-API support@green-api.com with a request to get a partnership API-token.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
idInstance | integer | mandatory parameter | Instance Id. The size of the integer is int64. Values range include from 1 to 10 digits |
Request body example#
{
"idInstance": 1101000000
}
Response#
Response parameters#
| Parameter | Type | Description |
|---|---|---|
deleteInstanceAccount | boolean | account instance deletion flag |
Response body example#
If successful, in response to the request, you get a JSON string with HTTP 200 status of the below form:
{
"deleteInstanceAccount": true
}
DeleteInstanceAccount errors#
For a list of errors common to all methods, refer to Common errors section
| HTTP code | Error identifier | Description |
|---|---|---|
| 200 | "code": 404,"description": "Not found" | The instance does not exist or had already been deleted |
| 200 | "code": 401,"description": "Unauthorized" | Problem with authorization, check the correctness of the partnerToken |
Code Examples#
import requests
url = "https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}"
payload = {
"idInstance": 1101000000
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload)
print(response.text.encode('utf8'))
curl --location --globoff 'https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}' \
--header 'Content-Type: application/json' \
--data '{
"idInstance": 1101000000
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}")
.header("Content-Type", "application/json")
.body("{\r\n \"idInstance\": 1101000000 \r\n}\r\n")
.asString();