Who should use multi-tenant?
Agencies
Managing Knock2 on behalf of multiple clients. Provision a dedicated, isolated workspace for each client so their data never mingles.
SaaS Platforms
Embedding visitor identification directly into your own product. Each of your customers gets their own Knock2 workspace under the hood.
Resellers
Distributing Knock2 under your own brand. Use the API to create and manage workspaces without your clients ever interacting with Knock2 directly.
Multi-Product Developers
Building stacks that span multiple products or domains. Keep visitor data scoped to the right product with separate tenants per project.
Key concepts
Understanding three core concepts will help you design your multi-tenant integration correctly before you write a single line of code.Parent tenant
Your parent tenant is the top-level Knock2 account. It acts as the provisioning authority — every child tenant you create is owned by and associated with your parent. You authenticate all tenant management operations using your master API key: creating, updating, deactivating, and reactivating tenants require thetenants:write scope; listing tenants and reading their allocations/usage require tenants:read.
Child tenant (product_slug)
Each child tenant is a fully self-contained Knock2 workspace. Once created, a child tenant operates independently: its tracking script is installed on the target domain, its API key authenticates its own data queries, and its visitor records are stored in isolation. Child tenants cannot access or affect one another’s data — except that a parent key can deliberately read one child’s data at a time via the X-Knock-Tenant header, and a parent-level webhook subscription automatically also receives events from every child (see the Webhooks guide).
product_slug
The product_slug is derived automatically, not assigned by you: Knock2 cleans the domain you provide and namespaces it under your own account’s slug. This guarantees a child’s slug can never collide with a future direct signup for that same domain under a different account, and makes provisioning idempotent per domain per parent — retrying POST /v1/tenants for the same domain always resolves to the same slug rather than creating a duplicate.
Tenant isolation
Every child tenant you provision is completely isolated from every other tenant. The table below summarises what each child tenant owns exclusively.Required scope
Tenant management endpoints (create, update, deactivate, reactivate, set limits) require your parent API key to carry thetenants:write scope. Tenant visibility endpoints (list, get, read limits, read usage) require tenants:read instead. If your key lacks the required scope, the API returns 403 Forbidden. Check your account settings to confirm the scope is enabled on your master key before proceeding.
Next steps
Managing Tenants
Step-by-step guide to creating, configuring, and deactivating sub-tenants via the API, including script installation.
API Reference: Create Tenant
Full request/response schema for the
POST /v1/tenants endpoint.