Skip to content

CheckAccount#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method checks whether an account exists in Instagram and returns its numeric identifier and username.

The method uses the limits on the number of requests per second.

Request#

To check an account, you have to execute a request at:

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

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

Request parameters#

Parameter Type Mandatory Description
chatId string No* The numeric account identifier or a username with the @ prefix
username string No* The username of the account to check, the @ prefix is optional

*One of the two is mandatory: chatId or username. If both are passed, chatId takes effect.

Request body example#

A check by the numeric identifier:

{
    "chatId": "49547665464"
}

A check by the username:

{
    "chatId": "@green_api"
}

A check by the username passed as a separate field:

{
    "username": "green_api"
}

Response#

Response parameters#

Field Type Description
exist boolean Whether the account exists in Instagram
chatId string The numeric identifier of the account found. An empty string if there is no account
username string The username of the account found, with the @ prefix. An empty string if there is no account

Response body example#

The account exists:

{
    "exist": true,
    "chatId": "49547665464",
    "username": "@green_api"
}

There is no account:

{
    "exist": false,
    "chatId": "",
    "username": ""
}

CheckAccount errors#

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

HTTP code Error ID Description
400 Bad Request
Validation failed
Validation error

Request examples#

import requests

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

payload = {"chatId": "@green_api"}
headers = {'Content-Type': 'application/json'}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/checkAccount/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"chatId": "@green_api"}'