Overview
The Cred Protocol API uses Bearer token authentication. You must include your API key in theAuthorization header of every request.
Getting Your API Key
1
Sign In
Log in to your account at app.credprotocol.com.
2
Navigate to API Keys
Go to the Dashboard and find the API Keys section.
3
Create a Key
Click Create API Key and give it a descriptive name (e.g., “Production”, “Development”).
4
Copy Your Key
Copy the API key immediately. For security reasons, you won’t be able to view it again.
Using Your API Key
Include your API key in theAuthorization header using the Bearer scheme:
Authentication Errors
401 Unauthorized
If your API key is missing, invalid, or expired, you’ll receive a401 error:
- Missing
Authorizationheader - Typo in the API key
- Using
API_KEYinstead ofBearer API_KEY - Revoked or deleted API key
403 Forbidden
If your API key doesn’t have permission for the requested resource:Best Practices
Never expose your API key in client-side code
Never expose your API key in client-side code
API keys should be kept on your server. Never include them in frontend JavaScript, mobile apps, or public repositories.
Use environment variables
Use environment variables
Store your API key in environment variables, not in code:
Use different keys for different environments
Use different keys for different environments
Create separate API keys for development, staging, and production. This makes it easy to rotate keys without affecting other environments.
Rotate keys regularly
Rotate keys regularly
Periodically rotate your API keys, especially if you suspect they may have been compromised.
Monitor your usage
Monitor your usage
Regularly check your API usage in the Dashboard to detect unusual activity.
Key Management
Viewing Your Keys
You can view all your API keys (but not the key values) in the Dashboard. Each key shows:- Name: The name you gave the key
- Created: When the key was created
- Last Used: The most recent API request using this key
- Status: Active or revoked
Revoking a Key
If you need to revoke an API key:- Go to the API Keys section in your Dashboard
- Find the key you want to revoke
- Click Revoke