Skip to main content
Want to see what the Knock2 API looks like before installing anything on a real site? The sandbox lets you call every core endpoint immediately with a key you can get yourself in seconds. Every GET returns realistic, fixed dummy data; every write validates your input exactly like production but never touches a real account; and a one-shot webhook test-send lets you prove your receiving endpoint works before you register a real subscription.
The sandbox is for exploration only. Data is static and shared by everyone who uses it — do not build any real integration logic against it. When you’re ready to go live, follow the Quickstart to get your own API key.

Getting a sandbox key

Provision a temporary key (recommended) — POST /v1/sandbox/keys issues a key instantly, locked to your IP address and valid for 30 minutes. No signup, no emailing support:
Pass the returned key exactly like any sandbox key, in the Authorization header. It only works from the IP address that requested it — calling POST /v1/sandbox/keys again from that same IP replaces it with a fresh 30-minute key, so just request a new one whenever yours expires.
There’s also a shared, static sandbox key that never expires and isn’t IP-locked. It isn’t published on this page — the self-serve key above covers every endpoint with no extra step, so start there; contact us if you specifically need the shared key instead.
Pass either kind of key exactly the same way, in the Authorization header:
Every sandbox endpoint lives under the /v1/sandbox/ prefix instead of /v1/ — nothing else about the request shape changes. A request to /v1/sandbox/* with a real kn_live_... key (or vice versa) is rejected with 401 Unauthorized; the two are never interchangeable. A missing, invalid, or expired sandbox key also gets a 401 that points you back to POST /v1/sandbox/keys.
Because sandbox keys are easy to obtain, the sandbox has its own coarse, shared rate limit — separate from the per-key limits described in Authentication — plus its own 5 requests/minute limit on POST /v1/sandbox/keys itself, so provisioning can’t be used as a workaround for that limit. If you’re testing high request volume, do it against a real key instead.

What’s covered

Each one accepts the same parameters and returns the same response shape as its production counterpart in the API Reference — code you write against the sandbox should work unmodified against a real key.
Reseller/child-tenant provisioning (POST /v1/tenants, credit limits, usage, scoring config, script config) isn’t in the sandbox — those actions create real state for a real tenant, which doesn’t fit a shared, no-signup key. Try those with a real key instead.

Dummy data

Every GET returns the same small, fixed dataset every time — two example accounts (“Acme Robotics”, “Rocket Logistics”) and their contacts. List endpoints paginate for real (cursor/next_cursor/has_more behave exactly like production), so you can test your pagination code end to end:
Writes (POST /v1/sandbox/enrich, POST /v1/sandbox/prospect, and the filter-sets endpoints) validate your request body exactly like production — send a malformed body and you’ll get the same 400 you’d get for real — but nothing is saved. A valid request gets back a realistic canned response instead.

Multi-tenant preview

If you manage tenants on behalf of your own customers, the sandbox includes one fixture child tenant so you can see the parent → child delegation pattern (X-Knock-Tenant header or ?product_slug=) without provisioning anything real:
sandbox-child-eu is shown above for a concrete example — call GET /v1/sandbox/tenants if you’d rather look up the fixture child’s product_slug programmatically instead of hardcoding it.

Testing your webhook receiver

The one thing you can’t fully dry-run against fixture data alone is your own webhook endpoint. POST /v1/sandbox/webhooks/test sends a single, real, signed event to a URL you provide — immediately, synchronously — so you can confirm your receiver validates signatures correctly before you register a real subscription:
event_type accepts the same values as a real webhook subscription (account.identified, contact.identified, score.changed, play.triggered, signal.detected, tenant.limit_reached, tenant.limit_approaching). The response tells you whether delivery succeeded:
The payload is signed with HMAC-SHA256 exactly like a real delivery, but there’s no persisted subscription behind a sandbox test — so unlike a real webhook, there’s no signing key to fetch afterward via GET /v1/webhooks/{id}/secret. The signature field above is returned directly in this response so you can compare it byte-for-byte against the X-Knock-Signature header your receiver actually saw. For how signature verification works end to end against a real, persisted subscription, see Receive Real-Time Visitor Event Alerts via Webhooks. Nothing is stored either way: there’s no subscription to list or delete afterward, just the one test delivery.
url must be HTTPS and must be an endpoint you control. Do not point this at a third party’s URL — it triggers one real outbound HTTP request from Knock2’s servers.

Next steps

Quickstart

Ready to go live? Get your own API key and install the tracking script.

API Reference

See the full parameter and response reference for every endpoint the sandbox mirrors.