Authorization header.
Authenticating requests
Pass your API key as a Bearer token:How keys are validated
- The gateway receives your key from the
Authorizationheader. - It computes a SHA-256 hash of the raw key.
- The hash is looked up in the database.
- If found and not revoked, the request proceeds.
- Constant-time comparison prevents timing attacks.
Key prefixes
| Prefix | Environment |
|---|---|
tk_live_ | Production |
tk_test_ | Test / development |
Key scopes
Each key has a set of scopes that control what it can do. A request that requires a scope the key doesn’t have returns403 FORBIDDEN.
| Scope | What it controls |
|---|---|
shield:read | Read scan results and detection history |
shield:write | Run scans, tokenize, and rehydrate |
audit:read | Read audit log entries |
fleet:read | View gateway fleet status |
fleet:write | Register and manage gateways |
policy:read | Read policy configurations |
policy:write | Create and update policies |
org:read | Read organization settings |
org:write | Update organization settings, manage members |
shield:write and nothing else.
Rate limit headers
Every response includes rate limit headers, regardless of whether the request succeeded:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait before retrying (only present on 429 responses) |
429 Too Many Requests, stop and wait for the number of seconds specified in Retry-After. See Rate Limits for per-plan limits.
Key rotation
For zero-downtime rotation:- Create a new key with the same scopes.
- Deploy the new key to your tools.
- Verify requests succeed with the new key.
- Revoke the old key.
401 UNAUTHORIZED immediately. There is no undo.
Error responses
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | Missing key, invalid key, expired key, revoked key |
403 | FORBIDDEN | Key lacks required scope, feature not available on your plan |
429 | RATE_LIMITED | Too many requests in the current window |