Overview
The Nadoo AI API supports three authentication methods. Choose the one that best fits your integration scenario.JWT Bearer
Token-based auth for user-scoped access. Best for frontend apps and user-facing integrations.
API Key
Static key for server-to-server calls. Best for backend integrations and CI/CD.
Cookie Session
Browser-managed session cookie. Automatically used by the Nadoo AI frontend.
JWT Bearer Token
JWT (JSON Web Token) authentication provides user-scoped access with short-lived access tokens and long-lived refresh tokens.Login Flow
Token Refresh
Access tokens expire after a configurable period (default: 30 minutes). Use the refresh token to obtain a new access token without re-authenticating:Refresh tokens have a longer lifetime (default: 7 days). When a refresh token expires, the user must log in again. Both lifetimes are configurable via environment variables
ACCESS_TOKEN_EXPIRE_MINUTES and REFRESH_TOKEN_EXPIRE_DAYS.API Key
API keys provide a simple authentication method for programmatic access. They are scoped to a specific workspace and do not expire unless manually revoked.Creating an API Key
- Navigate to Workspace Settings > API Keys
- Click Create New Key
- Give the key a descriptive name
- Copy the key immediately — it will not be shown again
Using an API Key
Include the key in theX-API-Key header:
API Key Management
| Operation | Endpoint | Description |
|---|---|---|
| Create | POST /api/v1/api-keys | Generate a new API key |
| List | GET /api/v1/api-keys | List all keys in the workspace |
| Delete | DELETE /api/v1/api-keys/{id} | Revoke a key permanently |
Cookie Session
Cookie-based authentication is used automatically by the Nadoo AI web frontend. When a user logs in through the browser, the server sets an HTTP-only session cookie.- The cookie is set automatically by the
POST /api/v1/auth/loginendpoint when called from a browser - The frontend includes the cookie in all subsequent requests automatically
- The cookie is HTTP-only and Secure (in production), preventing client-side JavaScript access
You do not need to manage cookie authentication manually. It is handled transparently by the browser and the Nadoo AI frontend. Use JWT Bearer or API Key for custom integrations.
Authentication Priority
When multiple authentication methods are present in a request, Nadoo AI evaluates them in the following order:- JWT Bearer token (highest priority)
- API Key
- Cookie Session
401 Unauthorized response (unless the endpoint is public).
Rate Limits
Rate limits are applied per authentication identity:| Scope | Limit | Description |
|---|---|---|
| IP-based | 300 requests/min | Applied to unauthenticated requests and as a baseline for all traffic |
| User-based | 600 requests/min | Applied per authenticated user (JWT or API Key) |
Security Best Practices
Always use HTTPS in production
Always use HTTPS in production
Never transmit tokens or API keys over unencrypted HTTP. Configure TLS in your Nginx reverse proxy or load balancer.
Rotate API keys regularly
Rotate API keys regularly
Set a rotation schedule (e.g., every 90 days). Nadoo AI allows you to create a new key before revoking the old one for zero-downtime rotation.
Use the principle of least privilege
Use the principle of least privilege
Assign the minimum workspace role needed for each user. Use Viewer roles for read-only access and reserve Admin/Owner roles for administrators.
Store secrets securely
Store secrets securely
Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.) for API keys and tokens. Never hardcode them in source code.