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, the Instance - Update operation allows users to update an existing WhatsApp instance's configuration such as phone number, app version, authentication method, call handling preferences, missed call message, and webhook URL.

Typical use cases include:

  • Updating the phone number or authentication settings of a WhatsApp instance.
  • Changing how incoming calls are handled (e.g., auto-rejecting calls).
  • Modifying the message sent automatically when a call is missed.
  • Updating the webhook URL to receive event notifications from the WhatsApp instance.

For example, if you have a WhatsApp instance running and want to change its phone number or update the webhook URL for receiving notifications, this operation enables you to do so programmatically within an n8n workflow.

Properties

Name Meaning
Phone Number ID The unique identifier of the WhatsApp instance to update.
Phone Number The new phone number associated with the WhatsApp instance (including country code).
App Version The WhatsApp application version to use; currently only "Latest" is supported.
Authentication Method The method used to authenticate with WhatsApp; currently only "QR Code" is supported.
Auto Reject Call Boolean flag indicating whether incoming calls should be automatically rejected.
Answer Missed Call Message Text message sent automatically when a call is missed.
Webhook URL URL to which the WhatsApp instance will send event notifications (webhooks).
Bearer Token Authentication token (API key) required to authorize the update request.

Output

The output JSON contains the response from the SmileAPI server after attempting to update the WhatsApp instance. This typically includes details about the updated instance or confirmation of the update action.

Example structure (simplified):

{
  "id": "instance-id",
  "phoneNumber": "5511987654321",
  "appVersion": "latest",
  "authenticationMethod": "QRCode",
  "autoRejectCall": false,
  "answerMissedCall": "Olá, não posso atender ligações no momento",
  "webhook": "https://webhook.site/your-unique-url",
  "status": "updated"
}

No binary data output is produced by this operation.

Dependencies

  • Requires an active SmileAPI account and a valid API bearer token for authentication.
  • The node makes HTTP requests to the SmileAPI endpoint https://api.smileapi.com.br.
  • The user must provide the API bearer token in the node credentials or input properties.
  • Network connectivity to SmileAPI servers is necessary.

Troubleshooting

  • Invalid Bearer Token: If the provided bearer token is incorrect or expired, the API will reject the request. Ensure the token is valid and has appropriate permissions.
  • Phone Number ID Not Found: Providing an incorrect or non-existent phone number ID will cause the update to fail. Verify the ID corresponds to an existing instance.
  • Missing Required Fields: All required fields (phone number ID, phone number, bearer token) must be provided; otherwise, the node will throw an error.
  • Network Issues: Connectivity problems can cause request failures. Check your network and proxy settings.
  • Unsupported App Version or Authentication Method: Currently, only "latest" app version and "QR Code" authentication method are supported. Using other values may cause errors.
  • Error Handling: If the node is set to continue on failure, errors will be returned in the output JSON under an error field for each failed item.

Links and References

Discussion