Skip to Content
Won.dev
DocumentationAPI reference

Testing

A test key is the sandbox of the API. Every endpoint answers with sample data, cold email sends nothing, and nothing is ever charged.

Build and test with a test key, a key that starts with won_test_. It is the sandbox of the API: every endpoint and every MCP tool is there, with the same parameters, validation, response shapes and rate limit as with a live key, but nothing real happens and nothing is charged. Code written against a test key works with a live one: change the key and nothing else.

Get a test key

In the console, open the API keys page, choose Create key and pick the Test mode. A new organization is offered one during onboarding. A test key has no budget, since it costs nothing.

curl https://api.won.dev/v1/trade/companies/search \
  -H "Authorization: Bearer won_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "role": "importer", "hs_code": "940161", "importer_country": "US", "limit": 10 }'

The answer has the shape of a real one, says in notice that it is sample data, and ends with usage at a cost of 0.

What a test key does

ProductWith a test key
Trade dataThe same made-up companies, shipments, contacts and numbers, whatever you ask. Every name carries "SAMPLE" and every domain ends in .example.
EnrichmentThe same made-up company and people, with work emails, phone numbers in the range kept for fiction, and job postings.
SignalsSample signals of the sample companies, whatever you ask.
Cold emailA sandbox with the same endpoints, checks and events that sends nothing. A day between steps takes a minute, and the first part of an address, such as reply@ or bounce@, decides what happens.
TasksEvery part runs with the test key, on sample data.
AccountThe organization's balance and charges, for reference. A test key never adds to them.

Kept apart from live data

  • A test key sees only what test keys made: its own senders, campaigns, recipients, suppression list, webhooks and tasks. A live key never sees them, and a test key never sees the live ones.
  • What the sandbox simulates never reaches a real webhook, and its events carry test: true.
  • A request tried with a test key is never the answer to the same request made with a live key: repeats and Idempotency-Keys are kept apart.
  • dry_run and max_cost work as they do with a live key, so you can check the most a call would cost before you go live.

Going live

Swap the test key for a won_live_ key, with a budget of its own: see Authentication. The live key returns real data and spends the organization's balance. Send dry_run: true first to see the most a call can cost, and max_cost to cap it.

Last updated on

On this page