Twilio error 21608 unverified number (trial account) in CI
Twilio returns error 21608 "The number ... is unverified. Trial accounts cannot send messages to unverified numbers" when a trial (unupgraded) account tries to alert a recipient that is not on its Verified Caller IDs list. Upgrading the account or verifying the number resolves it.
What this error means
A Twilio message from a trial account fails with error 21608 naming the unverified recipient. Verified numbers still receive the alert.
< HTTP/1.1 400 Bad Request
{"code": 21608, "message": "The number +15558675310 is unverified. Trial accounts cannot send messages to unverified numbers; verify +15558675310 at twilio.com/user/account/phone-numbers/verified, or purchase a Twilio number to send messages to unverified numbers.", "status": 400}Common causes
The account is still a trial
Trial accounts restrict outbound messages to verified caller IDs, so any other recipient is blocked.
The recipient is not a Verified Caller ID
A new on-call number was never added to the trial account Verified Caller IDs list.
How to fix it
Verify the recipient or upgrade
- For quick testing, add the recipient under Verified Caller IDs in the Twilio console.
- For production alerting, upgrade the account so any number can be messaged.
- Re-run the notify step once the recipient is allowed.
# Console -> Phone Numbers -> Verified Caller IDs -> add + confirmUse a purchased Twilio number as From
Upgraded accounts send from a purchased number to any valid recipient without verification.
--data-urlencode "From=$TWILIO_FROM" # a purchased Twilio numberHow to prevent it
- Upgrade the Twilio account before relying on SMS for CI alerts.
- Keep the on-call recipient list current.
- Do not depend on trial verification for production paging.