Skip to content

How to Connect Twilio with an API Key (Pro)

The plugin can talk to Twilio with your Auth Token alone. An API key is the safer way, and Twilio recommends it. If a key leaks, you delete that key and nothing else changes.

This is optional. Do it once the store already works with the Auth Token, so you can tell a key problem from any other.

In the Twilio Console, click Admin at the top right, then Account management. In the left menu, open Keys & Credentials → API keys & tokens.

The page holds credentials, so Twilio asks you to prove it is you. It emails a code to the account’s address and shows Verification code required for access.

The Verification code required for access dialog over the API keys page

Type the code and click Verify. If it does not arrive, wait for Resend code to count down and click it.

The page lists your keys. A new account has none. Click Create API key.

The API keys and tokens page with no keys yet and the Create API key button boxed

Fill in the form:

  1. Friendly name: anything you will recognise later, such as your store’s name.
  2. Key type: Standard. It can send messages and read their status, which is everything the plugin does.

The Create new API key form with Friendly name and Key type boxed

Leave Region on United States - Default. The plugin sends every request to Twilio’s US1 address, so a key made in another region is not recognised.

The form opens on Restricted. A restricted key works only if you tick read and create on Messages yourself, so Standard is the simple choice. Avoid Main, which can also manage keys and the whole account.

Click Create.

Twilio shows the new key’s SID, which starts with SK, and its Secret. Copy both somewhere safe now. The secret is shown only this once. If you lose it, delete the key and make another.

Go to Purchase via WhatsApp → Configuration → Twilio. Paste the SID into API Key SID and the secret into API Key Secret.

The API Key SID field boxed on the Twilio tab, with API Key Secret below it

Keep the Account SID, since the key works inside that account. Keep the Auth Token saved too. Messages go out with the key, but Twilio signs every customer reply with the Auth Token, and the plugin checks that signature.

Click Save Changes. The secret field then shows only its last four characters, and its note starts “Saved.” Leave it empty from then on to keep the saved secret.

Under Test Your Connection, click Run Test with the phone field empty. With a key saved, the result reads “Connected to Twilio with your API Key.”

If it adds “Add your Auth Token as well”, the Auth Token is missing. Customer replies would be refused until you save it.

Clear API Key SID and save. The plugin clears the secret with it and sends with the Auth Token again. Then delete the key in Twilio.