Authentication
The Shelv API supports two authentication methods: API keys for programmatic access and session cookies for the dashboard.API Keys
API keys are the primary way to authenticate with the Shelv API. They provide full access to all public API endpoints.Creating an API Key
- Sign in to the Shelv dashboard
- Go to Settings > API Keys
- Click Create API Key and give it a name
- Copy the key — it’s only shown once
Using an API Key
Include your API key in theAuthorization header with the Bearer prefix:
Security Best Practices
- Store API keys in environment variables, never in source code
- Rotate keys periodically — you can create multiple keys and delete old ones
- Use separate keys for different environments (development, staging, production)
Error Responses
If authentication fails, you’ll receive a401 response:
Rate Limits
API requests are rate-limited for authenticated users:| Operation | Limit |
|---|---|
| Read operations (GET) | 120 requests/minute |
| Write operations (POST, DELETE) | 20 requests/minute |
Document uploads (POST /shelves) | 10 requests/hour |