API Keys
Create and manage API keys to authenticate your applications and integrations with CredVault.
What are API Keys?
API keys are secure credentials that allow:
- Your applications to connect to CredVault
- External tools to integrate with your platform
- Automated scripts to access your data
- Team members to use the API programmatically
An API key proves "I am authorized to access this" without sharing passwords.
Creating an API Key
Generate New Key
- Click API Keys in sidebar
- Click Create New Key
- Give it a name: "Mobile App", "Data Pipeline", "AI Integration"
- Choose permissions (see "Scopes" below)
- Set expiration (optional):
- Never expires
- 30 days
- 90 days
- 1 year
- Custom date
- Click Generate
Key Information
Your key shows:
Key Name: Production API Key
Created: 2024-06-12 10:30 UTC
Status: Active
Permissions: Read databases, Run queries
Expires: 2025-06-12
Last Used: 2024-06-12 14:22 UTC
Last Rotated: Never
Understanding Scopes
Scopes limit what each key can do. Choose carefully:
Available Scopes
Read
database:read- Read data from databasesmetadata:read- View data cataloglogs:read- View activity logs
Write
database:write- Insert/update/delete datanotebook:create- Create new notebooksexperiment:write- Create ML experiments
Execute
query:execute- Run queriesfunction:invoke- Call serverless functionsorchestration:execute- Trigger pipelines
Admin
team:manage- Add/remove team memberssettings:modify- Change configurationbilling:manage- Modify billing
Best Practices for Scopes
- Principle of least privilege - Only grant needed permissions
- Read-only keys - For data analysis and dashboards
- Write keys - Only for data ingestion
- Separate keys - Different key for each application
Example scopes:
Mobile app: database:read, notebook:read
Data pipeline: database:write, query:execute
Public dashboard: database:read only
Admin tool: all permissions
Using Your API Key
In Code
Include your key in the Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.credvault.io/v1/databases
import credvault
client = credvault.Client(api_key="YOUR_API_KEY")
databases = client.list_databases()
const credvault = require('credvault-js');
const client = new credvault.Client({
apiKey: 'YOUR_API_KEY'
});
const databases = await client.listDatabases();
In Integrations
Many tools let you paste your API key:
- Open integration settings (Zapier, Make, etc.)
- Find "API Key" or "Authentication" field
- Paste your CredVault API key
- Test connection
Testing API Keys
Test Connection
- Click your API key
- Click Test Connection
- System verifies the key works
- Shows success/failure with error details
Test Specific Permission
After creating a key, test individual permissions:
# Test database read
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.credvault.io/v1/databases
# Should return: List of databases
# If denied: {"error": "Insufficient permissions"}
Usage History
See what your key has been used for:
2024-06-12 14:22 - GET /databases (success)
2024-06-12 14:25 - POST /query (success)
2024-06-12 14:27 - GET /experiments (denied - insufficient scope)
2024-06-12 14:30 - POST /notebooks (success)
Click any entry to see:
- Exact request
- Response code
- Timestamp
- Source IP
- User agent
Managing Keys
Rename Key
Change the name anytime:
- Click the key
- Click Edit
- Change name
- Click Save
Pause/Resume
Temporarily disable a key without deleting:
- Click the key
- Click Pause
- Key won't work until resumed
- All data about usage is preserved
Use case: Pause during maintenance or migration
Rotate Key
Create a new key and invalidate the old one:
- Click the key
- Click Rotate
- New key is generated
- Old key stops working
- Update applications to use new key
Recommended: Rotate every 90 days or if exposed
Delete Key
Permanently remove a key:
- Click the key
- Click Delete
- Confirm deletion
- Applications using this key will lose access
- Action is permanent
Warning: Make sure nothing uses this key first
Security Best Practices
Protect Your Keys
- ✅ Store in secure password manager
- ✅ Use environment variables, never hardcode
- ✅ Don't share keys via email or chat
- ✅ Don't commit keys to version control
- ✅ Rotate keys regularly
- ❌ Don't share keys between applications
- ❌ Don't use one key for everything
- ❌ Don't set expiration to "never" for sensitive operations
Secure Storage
In your application:
# Good: Use environment variables
import os
api_key = os.environ['CREDVAULT_API_KEY']
# Bad: Don't hardcode
api_key = "cv_abc123..." # Visible in code!
In configuration files:
# .env file (add to .gitignore!)
CREDVAULT_API_KEY=cv_abc123...
# .gitignore
.env
.env.local
secrets/
Monitoring Access
Check who's using your keys:
- Go to API Keys dashboard
- See all keys and last used time
- Look for unexpected usage
- Delete any suspicious keys
- Check activity logs for unusual access
Troubleshooting
Key doesn't work
- Verify key is not paused
- Check expiration date
- Verify scopes allow the operation
- Test with
Test Connection - Check error message for reason
Permission denied error
Error: "Insufficient permissions for operation"
The key's scopes don't allow this operation:
- Go to the key
- Click Edit Scopes
- Add needed permission
- Save and retry
Key expired
Error: "API key has expired"
Create a new key or rotate the old one:
- Click the expired key
- Click Rotate to replace with new
- Update applications with new key
Lost my key
If you forgot to save your key:
- Create a new key (old one still works)
- Delete the old key when done
- Update applications to new key
Note: Keys shown only once. Save immediately after creation.
Advanced Usage
Rate Limiting
Each key has rate limits:
Free tier: 100 requests/minute
Starter: 500 requests/minute
Pro: 2000 requests/minute
Enterprise: Unlimited (negotiated)
If you hit limit:
Error: "Rate limit exceeded"
Wait: 60 seconds before retrying
Solution: Upgrade plan or use multiple keys
Webhook Signatures
Verify webhooks come from CredVault:
import hmac
# Secret is your API key
secret = "YOUR_API_KEY"
signature = request.headers.get('X-Webhook-Signature')
body = request.get_data()
# Calculate expected signature
expected = hmac.new(
secret.encode(),
body,
'sha256'
).hexdigest()
# Verify
if signature != expected:
raise ValueError("Invalid signature")
Related Topics
- Activity Logs - See API usage
- Database Clusters - Access with APIs
- Orchestration - Run APIs in pipelines