Authentication¶
Learn how to authenticate with the Circuit KYC Network API.
API Keys¶
All API requests require authentication using an API key. Include your key in the X-API-Key header:
Key Types¶
| Environment | Use Case |
|---|---|
| Sandbox | Development & testing |
| Production | Live customer data |
Your key type is automatically detected based on its prefix.
Keep Keys Secret
Never expose API keys in client-side code, version control, or logs.
Environments¶
| Environment | Base URL | Purpose |
|---|---|---|
| Sandbox | https://sandbox.circuit-kyc.com |
Testing without real data |
| Production | https://api.circuit-kyc.com |
Live operations |
Sandbox vs Production¶
Sandbox: - Free test credits included - Uses simulated data - No real KYC network access - Perfect for development
Production: - Real network data - Actual credit charges - Subject to compliance requirements - Full rate limits apply
Managing API Keys¶
Creating Keys¶
- Log in to your dashboard
- Navigate to Settings → API Keys
- Click Create New Key
- Choose environment (sandbox/production)
- Copy and store the key securely
Rotating Keys¶
For security, rotate your API keys periodically:
- Create a new key
- Update your application to use the new key
- Test thoroughly
- Delete the old key
Zero-Downtime Rotation
Keep both keys active during transition to avoid service interruption.
Revoking Keys¶
To revoke a compromised key immediately:
- Go to Settings → API Keys
- Find the key to revoke
- Click Revoke
- Confirm the action
The key is invalidated immediately.
SDK Authentication¶
SDKs handle authentication automatically:
Error Handling¶
401 Unauthorized¶
Causes: - Invalid API key - Expired/revoked key - Wrong environment (sandbox key with production URL)
Solution: - Verify your API key is correct - Check you're using the right environment - Generate a new key if compromised
Best Practices¶
-
Use environment variables
-
Separate keys per environment
- Development: sandbox key
- Staging: sandbox key
-
Production: production key
-
Rotate regularly
- Rotate keys every 90 days
-
Rotate immediately if compromised
-
Monitor usage
- Check dashboard for unusual activity
- Set up alerts for failed authentications