API Keys
API keys authenticate requests to the Mulberry API and MCP server. This guide covers creating keys, understanding permissions, and managing key lifecycle.
sk_ Private Key Full read/write access to all resources
- Create, modify, delete crawls
- Manage webhooks and settings
- Manage other API keys
pk_ Public Key Read-only access to crawl data
- List and view crawls
- Download crawl results
- Cannot create or modify
Creating API Keys
Via Dashboard
The full API key is only shown once at creation. If you lose it, you'll need to create a new key.
Key Permissions
| Action | Private (sk_) | Public (pk_) |
|---|---|---|
| List crawls | ✓ | ✓ |
| View crawl details | ✓ | ✓ |
| Download results | ✓ | ✓ |
| Create crawls | ✓ | ✗ |
| Cancel crawls | ✓ | ✗ |
| Manage webhooks | ✓ | ✗ |
| Manage API keys | ✓ | ✗ |
Key Lifecycle
Key Expiration
API keys can optionally have an expiration date. After expiration, the key becomes invalid and requests using it will fail.
Set expiration for contractors or short-term projects
Use short-lived keys and rotate regularly
Long-lived keys are fine with proper security
View last-used timestamps for each key
Revoking Keys
Revoke a key immediately if it's compromised or no longer needed:
Revoking a key is immediate and permanent. Any services using the key will lose access instantly.
Key Rotation
Regularly rotating keys is a security best practice. Here's a safe rotation process:
Automate key rotation in your deployment pipeline. Create a new key, deploy with it, then revoke the old one.
Security Best Practices
Troubleshooting
Check that:
- The key is correctly formatted in the Authorization header
- The key hasn't been revoked
- The key hasn't expired
The key is valid but lacks permission for the action. Check:
- Are you using a public key (
pk_) for a write operation? - Does the key have the required scope?