Twilo CLI to change WhatsApp Webhook URL for incoming messages.
This nodeJS code works on command line.
To manually change the webhook for a Twilio phone number, you need to access painel, and then click -> Edit Sender
To change a webhook from a number on twilio, with this code, you need to pass your credentials (Account SID and Account Token) and the identification string (SID) of the phone number you want to change the url.
Credentials must be written in the project's .env file.
This code accepts the following commands:
Command | Description |
---|---|
sid | list all of phone number sid codes on Twilio account |
url | change the webhook url on Twilio |
node index.js sid
node index.js url {your url here} -p {SID phone number}