SmileAPI icon

SmileAPI

Interact with SmileAPI WhatsApp

Actions6

Overview

This node integrates with the SmileAPI WhatsApp service to manage WhatsApp instances and send messages. Specifically, for the Instance - Delete operation, it deletes a WhatsApp instance identified by its phone number ID. This is useful when you want to remove an existing WhatsApp instance from your SmileAPI account, for example, when decommissioning a phone number or cleaning up unused instances.

Practical scenarios include:

  • Automating the removal of WhatsApp instances that are no longer needed.
  • Managing lifecycle of WhatsApp integrations programmatically.
  • Cleaning up test or temporary WhatsApp instances in bulk workflows.

Properties

Name Meaning
Phone Number ID The unique identifier of the WhatsApp instance (phone number ID) to delete.
Bearer Token Your SmileAPI Bearer Token used for authenticating the API request.

Output

The output JSON contains the response from the SmileAPI after attempting to delete the specified WhatsApp instance. Typically, this will be a confirmation of deletion or an error message if the operation failed.

Example output structure (simplified):

{
  "status": "success",
  "message": "Instance deleted successfully"
}

If the API returns an error, the output will contain error details instead.

No binary data is produced by this operation.

Dependencies

  • Requires a valid SmileAPI account.
  • Needs an API key credential (Bearer Token) for authentication.
  • The node makes HTTP DELETE requests to the SmileAPI endpoint:
    https://api.smileapi.com.br/{username}/v1/{phoneNumberId}/instance
  • The username part of the URL is retrieved from the node credentials (an API key credential).

Troubleshooting

  • Common issues:

    • Invalid or expired Bearer Token causing authentication failures.
    • Incorrect Phone Number ID leading to "instance not found" errors.
    • Network connectivity problems preventing API calls.
  • Error messages:

    • "Unauthorized" or "Authentication failed": Check that the Bearer Token is correct and has not expired.
    • "Instance not found": Verify the Phone Number ID is accurate and corresponds to an existing instance.
    • "Request failed" or timeout errors: Ensure network access to the SmileAPI endpoint is available.
  • Resolution tips:

    • Double-check input parameters for typos.
    • Refresh or regenerate the Bearer Token if authentication fails.
    • Test API connectivity outside n8n to isolate network issues.

Links and References

Discussion