All templates
Messaging
Mock the Twilio SMS API
Send SMS in your tests without sending SMS to anyone.
2 routes · live immediately · no account needed
Every test run that hits Twilio for real costs money and puts a message on someone's phone. These routes return Twilio's Messages resource shape — the SM-prefixed sid, the RFC 2822 date_created, the numeric fields Twilio returns as strings — so your sending code can run in CI as often as you like without a single real message leaving the building.
What you get
POST
/2010-04-01/Accounts/{AccountSid}/Messages.jsontemplated201 CreatedGET
/2010-04-01/Accounts/{AccountSid}/Messages.json200 OKResponse template
POST /2010-04-01/Accounts/{AccountSid}/Messages.json
Values in double braces are rendered per request.
{
"sid": "SM{{ uuid4() }}",
"account_sid": "{{ request.path_params.AccountSid }}",
"api_version": "2010-04-01",
"to": "{{ request.body.To }}",
"from": "{{ request.body.From }}",
"body": "{{ request.body.Body }}",
"status": "queued",
"direction": "outbound-api",
"num_media": "0",
"num_segments": "1",
"price": null,
"price_unit": null,
"error_code": null,
"error_message": null,
"date_created": "Thu, 30 Jul 2024 20:12:31 +0000"
}Good for
- Test SMS sending in CI without per-message charges
- Develop a notification flow without a verified phone number
- Assert on the exact request your code sends, in the Inspector
Response payloads are representative examples using this API's real field names and object shapes, not an exhaustive replica of its schema. MockBase is an independent tool and is not affiliated with, endorsed by, or sponsored by Twilio.