WhatsApp API icon

WhatsApp API

Integração com WhatsApp API para envio de mensagens e gerenciamento

Overview

This node integrates with a WhatsApp API to manage WhatsApp sessions and send messages. Specifically, the "Session - Create" operation allows users to create a new WhatsApp session instance. This is useful for initializing a new WhatsApp connection that can later be started, managed, or deleted through other operations.

Practical scenarios include:

  • Automating the setup of multiple WhatsApp instances for different business units.
  • Programmatically creating sessions before starting them to handle messaging workflows.
  • Managing WhatsApp connections in bulk via automation platforms like n8n.

Properties

Name Meaning
Session Name The name of the WhatsApp instance to create. It identifies the new session being created.

Output

The output JSON contains the response from the WhatsApp API after attempting to create the session. This typically includes details about the newly created session such as its ID, status, and any metadata returned by the API.

No binary data is output by this operation.

Example output structure (simplified):

{
  "id": "123",
  "name": "My WhatsApp Session",
  "status": "DISCONNECTED",
  "type": "baileys"
}

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the WhatsApp API.
  • The node uses the base URL and instance ID from the credentials to construct API endpoints.
  • The WhatsApp API service must support session management endpoints.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Providing an empty or invalid session name may result in API errors.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:

    • Authentication errors usually indicate invalid or expired API keys; verify and update credentials.
    • Validation errors from the API may indicate missing required fields like the session name.
    • Unexpected errors should be checked against the API documentation or logs for more details.

Links and References

  • Refer to your WhatsApp API provider's official documentation for session management endpoints.
  • n8n documentation on credentials and HTTP Request node for understanding API integrations.

Discussion