API Key Types
KnoxCall uses API keys to authenticate requests to the Management API. There are three types of keys, each with a distinct prefix:| Key Type | Prefix | Environment | Description |
|---|---|---|---|
| Standard | tk_live_ | Production | Full access to production resources. Available on all plans. |
| Enterprise Access | AKE | Production | Enhanced keys with configurable scopes and expiration. Enterprise plan only. |
| Test | tk_test_ | Sandbox | Full access to sandbox resources. Safe for development and testing. |
Key prefixes make it easy to identify which environment a key belongs to at a glance. This follows the same live/test paradigm used by Stripe and other modern APIs.
Creating API Keys
Via the Dashboard
- Log in to the KnoxCall Dashboard.
- Navigate to Settings in the sidebar.
- Scroll to the API Keys section.
- Click Create API Key.
- Give your key a descriptive name (e.g., “CI/CD Pipeline”, “Backend Server”).
- Copy the key immediately — it will only be shown once.
Via the API
You can also create API keys programmatically:The
key field in the response is the only time the full API key is returned. Store it securely.Production vs. Sandbox
KnoxCall provides completely separate production and sandbox environments, following the same live/test key paradigm popularized by Stripe.Production
Base URL:
https://api.knoxcall.com/v1- Uses
tk_live_orAKEprefixed keys - Routes proxy real traffic to live upstream APIs
- Secrets contain real credentials
- Usage counts against your plan limits
- Changes affect your live integrations immediately
Sandbox
Base URL:
https://sandbox.knoxcall.com/v1- Uses
tk_test_prefixed keys - Routes, secrets, and clients are isolated from production
- Safe for development, testing, and CI/CD
- No impact on production traffic or billing
- Mirrors production API behavior exactly
Using API Keys
Pass your API key in theAuthorization header as a Bearer token, or use the x-api-key header.
Examples
Using the x-api-key Header
If your HTTP client or framework makes it difficult to set theAuthorization header, you can use the x-api-key header instead:
Authentication Errors
When authentication fails, the API returns one of these error types:| Error Type | Status | Cause | Solution |
|---|---|---|---|
authentication_required | 401 | No API key provided | Add the Authorization or x-api-key header to your request |
invalid_api_key | 401 | Key is invalid, revoked, or expired | Check that the key is correct and has not been revoked in the dashboard |
wrong_key_type | 403 | Test key used on production, or live key used on sandbox | Match the key type to the correct base URL |
subscription_inactive | 403 | Tenant subscription is paused or cancelled | Update your billing information in the dashboard |
Security Best Practices
Never expose keys in client-side code
API keys grant full access to your KnoxCall configuration. Never embed them in frontend JavaScript, mobile apps, or any code that runs in the browser.
Use environment variables
Store API keys in environment variables or a secrets manager. Never hard-code them in source files or commit them to version control.
Rotate keys regularly
Create new keys and revoke old ones on a regular cadence. If a key is compromised, revoke it immediately from the dashboard.
Use the principle of least privilege
On Enterprise plans, use scoped access keys (AKE) to limit what each key can do. For standard plans, create separate keys per service so you can revoke individually.
Environment Variable Setup
Key Rotation Procedure
- Create a new API key in the dashboard or via the API.
- Update your application’s environment variables with the new key.
- Deploy the updated configuration.
- Verify that requests succeed with the new key.
- Revoke the old key in the dashboard.
Both the old and new keys will work simultaneously until you revoke the old one. This allows zero-downtime rotation.