API Key Authentication
ZKScore API uses Bearer token authentication. All API requests must include your API key in the Authorization header.Getting an API Key
- Visit the Developer Portal
- Connect your wallet
- Navigate to “API Keys”
- Click “Create New API Key”
- Copy and securely store your key
Making Authenticated Requests
Include your API key in theAuthorization header with the Bearer scheme:
Example Requests
API Key Permissions
API keys can have different permission levels:| Permission | Description |
|---|---|
read | Read-only access to public data |
write | Create and update resources |
admin | Full access including deletions |
Security Best Practices
Never Expose Keys Client-Side
Never Expose Keys Client-Side
Always make API calls from your backend server. Never include API keys in:
- Frontend JavaScript code
- Mobile app code
- Public repositories
- Client-side environment variables
Use Environment Variables
Use Environment Variables
Store API keys in environment variables, not in your code:
.env
Rotate Keys Regularly
Rotate Keys Regularly
Rotate your API keys periodically and immediately if compromised:
- Create a new API key
- Update your application
- Revoke the old key
Use Different Keys for Different Environments
Use Different Keys for Different Environments
Create separate API keys for development, staging, and production:
dev-app-namestaging-app-nameprod-app-name
Error Responses
401 Unauthorized
Missing or invalid API key:403 Forbidden
Insufficient permissions:Managing API Keys
Create a New Key
List Your Keys
Revoke a Key
Developer API Reference
View complete API key management documentation