Skip to contentSkip to navigationSkip to topbar
On this pageProducts used

Test WhatsApp messaging with the Sandbox


(warning)

Testing and discovery purposes only

Use the Twilio Sandbox for WhatsApp for testing and discovery purposes only. Don't use it in a production environment.

The Twilio Sandbox for WhatsApp is a pre-configured environment in the Twilio Console for testing the following functionality:

You don't need a WhatsApp Business Account or a registered WhatsApp sender to use the Sandbox.

Twilio provides the Sandbox with a shared phone number (+14155238886). While all Sandbox users use the same number, only users who have joined your specific Sandbox can receive messages from you.

Watch the following video to learn how to use the Sandbox to send and receive WhatsApp messages.


Sandbox limitations

sandbox-limitations page anchor
  • You can only message end users who have joined your Sandbox. Messaging other users will fail with Error 63015.
  • The Sandbox supports functional testing, but not load testing of profile traffic.
  • The Sandbox number is a Twilio number and displays the Twilio logo.
  • The Sandbox number can only send one message every three seconds.
  • For business-initiated messages from the Sandbox, you can use only pre-approved templates.
  • The Sandbox session expires three days after joining. After this, end users need to rejoin the Sandbox.

There is no limit to the number of messages you can send or how long you can use the Twilio Sandbox for WhatsApp. However, Twilio free trial accounts can send a maximum of 50 messages per day. Sandbox messages are billed at standard Twilio API for WhatsApp pricing(link takes you to an external page).


How to activate and join the Sandbox

how-to-activate-and-join-the-sandbox page anchor

To send or receive WhatsApp messages using the Sandbox, you must activate the Sandbox and have at least one end user join the Sandbox.

  1. Sign up for Twilio(link takes you to an external page).
  2. Activate and connect to the Twilio Sandbox for WhatsApp:
    1. Go to the Try WhatsApp page in the Console(link takes you to an external page), acknowledge the terms, and click Confirm.
    2. Have each end user who wants to join send join <your sandbox code> to the Sandbox number, or scan the QR code with their mobile device and send the pre-populated message. The Sandbox will reply to confirm they have joined.

Once joined, end users receive messages only from the joined Sandbox. To disconnect from the Sandbox, they can reply to the message with stop or switch to a different Sandbox by messaging join <other sandbox keyword>.

Multiple end users can join the same Sandbox, but each must send the join <your sandbox code> message to the Sandbox number to join.


Business-initiated messages and templates

business-initiated-messages-and-templates page anchor

WhatsApp Business Platform requires the use of a message template for business-initiated messages. When a user sends your business a message, it opens a 24-hour customer service window during which you can send free-form outbound messages without a template. If you initiate a message before an end user messages you or if you send a reply outside of the 24-hour window, you can message users only with an approved message template. Learn more about customer service windows.

(information)

Info

Sending join <your sandbox code> to the Sandbox number starts a customer service window.

The Twilio Sandbox for WhatsApp comes with the following pre-approved templates for testing purposes:

  • Appointment Reminders: "Your appointment is coming up on {{1}} at {{2}}"
  • Order Notifications: "Your {{1}} order of {{2}} has shipped and should be delivered on {{3}}. Details: {{4}}"
  • Verification Codes: "Your {{1}} code is {{2}}"

Note: The double-bracketed numbers are placeholders for your custom values. In your code, provide these values as key-value pairs. For example, if you use the Appointment Reminders template, {"1":"2025/7/15","2":"3:00p.m."} will show "Your appointment is coming up on 2025/7/15 at 3:00p.m.".

You can't use custom message templates with the Sandbox. To set up and use custom message templates, you need to register a WhatsApp sender through WhatsApp Self Sign-up (direct customers) or WhatsApp Tech Provider Program (Independent Software Vendors (ISVs)).


User-initiated messages and replies

user-initiated-messages-and-replies page anchor

You can use the Sandbox to explore replying to incoming WhatsApp messages.

When an end user sends you a WhatsApp message, you can reply to that message within the 24-hour customer service window. During the 24-hour window, you can reply with free-form messages.

Webhook URL

webhook-url page anchor

When an end user sends a WhatsApp message, Twilio sends a webhook to your webhook URL. Typically, the webhook URL points to your application. When Twilio receives a message, it makes a request to your URL. You can reply using TwiML, Twilio's markup language for message instructions. Learn more about how to reply with TwiML in the language of your choice.

In the Sandbox, you can set the webhook URL in the When a Message Comes in field under Sandbox settings > Sandbox configuration.


WhatsApp message delivery status

whatsapp-message-delivery-status page anchor

You can receive real-time status updates for WhatsApp messages that you send and receive with the Sandbox.

When you set a status callback URL, you can receive requests from Twilio with information about the delivery status of your WhatsApp message. Twilio sends a request to your status callback URL each time your message status changes to one of the following: queued, failed, sent, delivered, or read. Learn more about tracking the message status of outbound messages.

In the Sandbox, you can set the status callback URL in the Status callback URL field under Sandbox settings > Sandbox configuration.