What a test key does
Create one in the dashboard under Developers, API keys, with the mode set to Test. It starts cc_test_. Requests made with it go through the same checks as live ones: the body is validated, numbers are checked and de-duplicated, opted-out numbers are refused, and you get the same response shapes back. The difference is that every message has test set to true, uses no credit, and never reaches a phone.
{
"data": {
"batch_id": "bat_01J9Z8X7W6V5T4S3R2Q1P0N9M7",
"messages": [{ "id": "msg_01J9Z8X7W6V5T4S3R2Q1P0N9M8", "status": "queued", "credits": 0, "test": true }],
"rejected": []
},
"meta": { "credits": 0, "replayed": false, "test": true }
}A test key can send test texts to numbers you type (POST /messages with to, and POST /messages/bulk), price a send with POST /messages/quote, check a number with POST /lookup, read and cancel the test texts and batches it sent, and set up webhooks. Test keys work while your account is still waiting to be checked, so you don't have to wait for approval to start building.
What a test key cannot see
Test keys often end up in places live keys don't: a laptop, a test server, a CI job, a contractor's project. So since 7 November 2026 a test key can't read anything about real people. Contacts, lists, opt-outs, conversations, tracked link clicks and live texts all answer 403 with test_key_live_data, and so does a send that names contact_ids or a list_id, because the texts would carry your contacts' details back in the response.
For the same reason a test text is never matched to a contact, so merge fields such as {first_name} are left empty. Put the values in the text, or pass them as vars on each item of a bulk send. GET /messages with a test key lists only the test texts that key sent, and the simulated replies to them; asking for a live text by id answers test_key_live_data.
A test key can't change anything either, beyond its own test texts and webhooks: contacts, lists, keywords, opt-outs, templates, sender names and campaigns are refused with 403 test_mode_not_supported. That includes creating a campaign draft. Test the text itself with POST /messages instead.
The simulated timeline
About a second after you send, each test text moves to sent, and about two seconds after that to delivered. Each step records a timeline entry and fires message.sent and then message.delivered to your webhooks, signed exactly as live events are, so your signature check gets a proper workout.
Test texts show in the dashboard's message history with a test label, which keeps them easy to tell apart from real ones.
Numbers that act out other outcomes
Ofcom keeps 07700 900000 to 07700 900999 for drama and never gives those numbers to a real phone. With a test key you can send to any of them, and four of them do something on purpose, so you can write your failure, reply and opt-out handling against real events. A live key refuses the whole range as invalid_number.
| Number | What happens |
|---|---|
07700 900001 | Delivered, about three seconds after you send. Every other number does the same. |
07700 900002 | Comes back undelivered: status undelivered, error_code undelivered, and message.failed to your webhooks. |
07700 900003 | Delivered, then a few seconds later a reply, "Thanks, see you then", which raises message.received. |
07700 900004 | Delivered, then a reply of STOP, which raises message.received and opt_out.created with test set to true. |
The replies are test texts like any other: they show up in GET /messages for the key that sent the original, with direction inbound. The STOP reply never touches your real opt-out list, so later test texts to 07700 900004 still go.
Webhooks in test mode
A webhook created with a test key is marked test_only. It only ever receives events about test texts, never live ones, so pointing it at a test server can't leak a real customer's reply. A test key only sees, changes and deletes its own test webhooks; endpoints you set up in the dashboard or with a live key are invisible to it and receive every event, test ones included.
The webhook test button (or POST /webhooks/{id}/test) sends a signed webhook.test event straight away, which shows your endpoint is reachable and checks its signature code. The webhooks guide shows every payload.
Limits
Test texts are free, so they're capped: up to 50 numbers in one request and 300 texts an hour per account. Go over the hourly figure and you get a 429 with a Retry-After header, the same as the live rate limit.
| Test key | Live key | |
|---|---|---|
| Key prefix | cc_test_ | cc_live_ |
| Texts actually sent | No | Yes |
| Credits used | None | One per SMS part |
| Works before your account is approved | Yes | Yes, but each text waits for our check (pending_review) |
| Number checks, opt-outs and rejections | Same as live | Yes |
| Send to typed numbers, bulk sends, quotes and lookups | Yes | Yes |
| Send to contacts or a list | No (403 test_key_live_data) | Yes |
| Read texts | Only the test texts this key sent | All of them |
| Read contacts, lists, opt-outs, conversations and link clicks | No (403 test_key_live_data) | Yes |
| Webhooks | Its own, which get test events only | Every event, test ones included |
| Campaigns | No: creating, sending and cancelling all need a live key | Yes |
| Recipients per request | Up to 50 | Up to 1,000 typed numbers, plus contacts and lists |
| Numbers per hour | Up to 300 | Set by your rate limit and balance |
Switching to live
Once your account is approved and has credit, create a live key and swap it in. Test and live Idempotency-Key values are kept apart, so a key you used in testing can't make a live request return an old test answer. The quickstart walks through the whole thing.