The Chunkr API uses API keys to authenticate requests. All API endpoints underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lumina-ai-inc/chunkr/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1 require authentication.
Authentication Methods
Chunkr supports two authentication methods:- API Key Authentication (Recommended)
- Bearer Token Authentication (OAuth/Keycloak)
API Key Authentication
Getting Your API Key
API keys can be generated and managed through your Chunkr account dashboard. Each API key is associated with your user account and inherits your permissions.Using API Keys
Include your API key in theAuthorization header of every request:
API Key Requirements
For API key authentication to succeed:- The API key must exist in the database
- The API key must be marked as
active = true - The API key must not be marked as
deleted = true - The key must be associated with a valid user account
Bearer Token Authentication
For applications using OAuth/Keycloak authentication, you can use Bearer tokens:Token Validation
Bearer tokens are validated using RS256 algorithm against the Keycloak JWKS endpoint. The token must:- Be a valid JWT signed with RS256
- Contain a
sub(subject) claim with the user ID - Be issued by the configured Keycloak realm
Token Claims
The following JWT claims are extracted and used:sub- User ID (required)email- User email addressgiven_name- User’s first namefamily_name- User’s last name
CORS and Pre-flight Requests
OPTIONS requests (CORS pre-flight) are automatically allowed and do not require authentication.
Authentication Errors
Missing Authorization Header
Status Code:401 Unauthorized
Response:
Authorization header in your request.
Invalid API Key
Status Code:401 Unauthorized
Response:
- The API key doesn’t exist
- The API key is marked as inactive
- The API key has been deleted
Invalid Bearer Token
Status Code:401 Unauthorized
Response:
- The JWT token is malformed
- The token signature is invalid
- The token is expired
- The token is not signed with RS256
Missing API Key
Status Code:401 Unauthorized
Response:
Security Best Practices
- Rotate Keys Regularly: Generate new API keys periodically and revoke old ones
- Use Environment Variables: Never hardcode API keys in your application
- Limit Key Scope: Use different API keys for different environments (dev, staging, production)
- Monitor Usage: Regularly review your API key usage for unusual activity
- Secure Storage: Store API keys in secure secret management systems
User Context
Once authenticated, the API attaches user information to the request context, including:- User ID
- Email address
- First and last name
- API key used (if applicable)
- Task ownership and isolation
- Usage tracking and billing
- Audit logging
Next Steps
Error Handling
Learn about error responses and how to handle them
Create a Task
Start processing documents with the Task API