DEV Community

Amna Abbas
Amna Abbas

Posted on

Twilio API on Zapier (Error: Invalid Phone Number)

I’ve been working with the Twilio API on Zapier to send WhatsApp messages and have hit a persistent issue. Despite extensive troubleshooting, I’m still getting the following error:

Data Message:

The 'To' number whatsapp: 923002459677 is not a valid phone number.

What I’ve tried:
Verified that the phone number is in the correct format: +countrycodephonenumber

Ensured the receiver is opted in to receive messages via WhatsApp.

Confirmed that the phone number works perfectly when using the same API on Postman (messages are successfully sent).

Tested this on the live environment and double-checked all API details, including Account SID, Auth Token, and the request body.

Verified the Content Variables match those in my approved Twilio content template.

Confirmed the endpoint URL for production use (not sandbox): https://api.twilio.com/2010-04-01/Accounts//Messages.json

Used Base64 encoding for Authorization headers and confirmed its accuracy.

Checked that the sender is verified, my Twilio account is upgraded to live status, and the content template is approved.

Cross-checked my Zapier setup to ensure it mirrors the successful Postman request, including all variables and headers:

Content-Type: application/x-www-form-urlencoded

Authorization: Basic

What I expected:
I expected the message to send successfully via Zapier, just as it did in Postman.

What actually happened:
Zapier returned the following error:

The 'To' number whatsapp: 923002459677 is not a valid phone number.

This error persists even though:

The same number works perfectly in Postman.

The recipient is opted in and correctly configured to receive WhatsApp messages.

Additional Details:
The phone number is verified as valid.

My Twilio account is upgraded to live, and the sender is verified.

The Content Variables match the approved Twilio template.

The same API request is successful on Postman but consistently fails on Zapier.

I’m attaching screenshots of my API setup in Zapier for reference.

Why Zapier might be rejecting the request while Postman works fine, and how to resolve this?

API SS)

API SS

API SS

Error

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay