Production-like test data without real customer data
"Just grab a real order from production and use it as the example body." It's tempting: real data has the odd shapes, long names and missing fields that made-up data never does. It also puts a real customer's name, address and email into a shared collection, a data file in Git, CI logs and the run history, for as long as those exist.
Where real data ends up
A real record pasted into a request travels further than you'd think:
- the request body, synced to everyone in the workspace, and to Git if the collection is synced,
- shared docs and request share links, which can be public,
- CI logs and reports, when the response echoes the body,
- saved runs, which keep the bodies of failed requests,
- a CSV data file committed to the repository.
Under GDPR, each of those is a copy you're responsible for.
Take the shape, invent the values
Look at real records to learn what's possible, then write invented ones that have the same features:
| Real data has | Invented test value |
|---|---|
| a 70-character company name | Very Long Company Name GmbH & Co. KG International Holdings Europe |
| an apostrophe and accents | Zoë O'Connor-Łukasiewicz |
| no phone number | "phone": null |
| a PO box address | "street": "PO Box 1234" |
| an order with 120 lines | a script that builds 120 lines |
| an emoji in a note | "note": "Leave at the door 📦" |
That list is worth more than a random real record: it's the edge cases, written down, every run.
Reserved values
Use values that are guaranteed not to belong to anyone:
- Emails:
@example.com,@example.org,@example.net(reserved for documentation), or your own test domain. - Phone numbers: the fictional ranges your country reserves, such as
+1 555-0100to555-0199in North America. - Cards: your payment provider's test card numbers, only in its sandbox.
- IP addresses:
192.0.2.0/24,198.51.100.0/24,203.0.113.0/24(reserved for documentation). - Names: dynamic variables such as
{{$randomFullName}}generate invented ones.
If you need volume
For load-like or large data-driven runs, generate a data file instead of exporting one:
node -e '
const rows = ["name,email,country"];
for (let i = 0; i < 500; i++) rows.push(`Test User ${i},qa+${i}@example.com,${["DE","PL","FR","US"][i % 4]}`);
console.log(rows.join("\n"));
' > users.csvA --data file can have up to 10,000 rows.
A check before sharing
Before you publish docs, share a request or commit a data file, search it for things that look real: @gmail.com, @outlook.com, your company's customer domains, phone numbers outside reserved ranges. A real address in an example body is the most common way personal data leaks from an API team.