Managing API Keys
Create, rotate, and revoke API keys for secure access to your flows.
Environments
Each key is scoped to an environment:
| Environment | Purpose | Prefix |
|---|---|---|
live | Production traffic | nk_live_... |
test | Development and testing | nk_test_... |
Both environments have identical functionality. The separation helps you track usage and revoke keys independently.
Creating Keys
- Navigate to Project Settings → API Keys
- Click Create Key
- Choose: name, environment, optional expiration
- Copy the full key immediately
Maximum 10 active keys per project. Revoke unused keys to make room.
Rotation Strategy
Recommended approach for zero-downtime key rotation:
- Create a new key (now you have 2 active)
- Update your deployment with the new key
- Verify the new key works
- Revoke the old key
Revoking Keys
In Project Settings → API Keys, click Revoke on any key. The key becomes invalid within 30 seconds (due to cache TTL).
Per-Environment Usage
Security Checklist
- Keys stored in environment variables, never in code
-
.envfiles added to.gitignore - Separate
testandlivekeys - Keys rotated quarterly (or after team member departures)
- Unused keys revoked promptly