DeleteInstanceAccount#
The method is intended for deleting an instance on a partner account.
Attention
When an instance is deleted, the linked device is not logged out. An active session remains in the mobile application. We recommend deleting only unauthorized instances or using the Logout method before deleting an instance.
Request#
To delete an account instance on behalf of a partner, you need to execute a POST request at:
POST
{{partnerApiUrl}}/partner/deleteInstanceAccount/{{partnerToken}}
Request parameters
The partnerApiUrl and partnerToken parameters are specified in the Profile section of the console.

Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
idInstance | integer | Yes | Account instance identifier. A uint64 value, 10 digits |
Request body example#
{
"idInstance": 4100000000
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
deleteInstanceAccount | boolean | Flag that the instance is deleted |
Response body example#
{
"deleteInstanceAccount": true
}
DeleteInstanceAccount errors#
For the list of errors common to all methods, see the Common errors section
| HTTP code | Error identifier | Description |
|---|---|---|
| 200 | "code": 404,"description": "Not found" | The instance does not exist or has already been deleted |
| 200 | "code": 401,"description": "Unauthorized" | Authorization problem, check that partnerToken is specified correctly |
Code examples#
import requests
url = "https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}"
payload = {"idInstance": 4100000000}
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": 4100000000
}
'
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\": 4100000000 \r\n}\r\n")
.asString();