DeleteInstanceAccount#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method is used to delete an instance on a partner account.
Attention
Deleting an instance does not log it out of the Instagram account: the session of the instance remains active. We recommend deleting only non-authorized instances or calling the Logout method before deleting an instance.
The session may remain in the list of logins of the Instagram account - end it in the Instagram app if needed.
Request#
To delete an account instance on behalf of the partner, you have to execute a POST request at:
{{partnerApiUrl}}/partner/deleteInstanceAccount/{{partnerToken}}
The
partnerApiUrlparameter can be seen in the console.The
partnerTokenrequest parameter is obtained via GREEN-API technical support by requesting a partnership API key.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
idInstance | integer | mandatory parameter | The identifier of the account instance. A uint64 value, 10 digits |
Request body example#
{
"idInstance": 5100000000
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
deleteInstanceAccount | boolean | The flag of the account instance being deleted |
Response body example#
In case of success, a JSON string of the following form is returned in response to the request with the HTTP status 200:
{
"deleteInstanceAccount": true
}
DeleteInstanceAccount errors#
For a list of errors common to all methods, refer to the Common errors section
| HTTP code | Error ID | Description |
|---|---|---|
| 200 | "code": 404,"description": "Not found" | The instance does not exist or has already been deleted |
| 200 | "code": 401,"description": "Unauthorized" | A problem with authorization, check the correctness of the partnerToken |
Request examples#
import requests
url = "https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}"
payload = {
"idInstance": 5100000000
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location --globoff 'https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}' \
--header 'Content-Type: application/json' \
--data '{
"idInstance": 5100000000
}
'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.green-api.com/partner/deleteInstanceAccount/{{partnerToken}}")
.header("Content-Type", "application/json")
.body("""
{
"idInstance": 5100000000
}
""")
.asString();