Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Overview
The "Get Contacts" operation of the Green API node retrieves a list of WhatsApp contacts from the connected Green API instance. This operation is useful for workflows that need to access or process contact information, such as syncing contacts with a CRM, filtering contacts for targeted messaging, or managing group memberships.
Typical use cases include:
- Fetching all contacts or only groups from a WhatsApp account.
- Limiting the number of contacts retrieved for performance or pagination.
- Using the contact list to trigger further automated actions like sending messages or updating databases.
Properties
| Name | Meaning |
|---|---|
| Group Only | Boolean flag indicating whether to return only group contacts (true) or all contacts (false). |
| Count | Number specifying how many contacts to return. Use 0 to return all available contacts. |
Output
The output is a JSON array containing the response from the Green API's getContacts endpoint. The structure typically includes details about each contact or group, such as their IDs, names, and possibly other metadata provided by the API.
Example output structure (simplified):
[
{
"id": "contact_id_1",
"name": "Contact Name 1",
"isGroup": false,
...
},
{
"id": "group_id_1",
"name": "Group Name 1",
"isGroup": true,
...
}
]
No binary data is output by this operation.
Dependencies
- Requires an active connection to Green API via an API key credential (instance ID and token).
- The node makes HTTP POST requests to the Green API endpoints.
- Proper configuration of credentials in n8n is necessary for authentication.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Network connectivity problems can prevent successful API calls.
- Requesting too many contacts at once may lead to timeouts or rate limiting.
Error messages:
"Failed to get contacts: <error message>"indicates an issue during the API request. Check credentials, network, and API limits.- Errors including
"Data sent: {...}"show the exact request payload, useful for debugging parameter issues.
Resolutions:
- Verify that the API credentials are correctly set up and valid.
- Reduce the
Countparameter if experiencing timeouts. - Ensure the Green API service is operational and reachable.
Links and References
- Green API Documentation – Official API docs for detailed endpoint info.
- WhatsApp Business API – Background on WhatsApp messaging APIs.
- n8n documentation on HTTP Request Node for understanding underlying request mechanics.