Overview
Quinn uses session-based authentication with HTTP-only cookies. This provides security while maintaining simplicity for client applications.Authentication Flow
1
Login
Send your credentials to the login endpoint:Response:The server returns a
Set-Cookie header with sessionId (HTTP-only, secure).2
Make Authenticated Requests
Include the session cookie in subsequent requests:
3
Logout
End your session:This invalidates the session and clears the cookie.
Session Management
Session Duration
- Default: 7 days
- Activity Extension: Sessions extend on each request
- Absolute Maximum: 30 days
Session Storage
Sessions are stored in PostgreSQL with the following data:- User ID
- Organization ID
- Role
- Created/Expires timestamps
- Impersonation state (for support)
Multi-Tenant Isolation
When you authenticate, your session includes:userId: Your unique user IDorganizationId: Your organization’s IDrole: Your permission level
- ✅ Session exists and is valid
- ✅ User belongs to organization
- ✅ User has required permissions for that endpoint
Role-Based Access Control
Quinn has three role levels:| Role | Description | Permissions |
|---|---|---|
| user | Standard team member | Read/write access to CRM data |
| admin | Organization administrator | All user permissions + organization settings, user management, billing |
| super_admin | Platform administrator | Quinn team only - cross-organization support tools |
Permission Examples
Code Examples
JavaScript/TypeScript
Python
cURL
Security Best Practices
Always Use HTTPS
Always Use HTTPS
Never send credentials over HTTP. Session cookies are marked as
Secure and will only be sent over HTTPS connections.Implement CSRF Protection
Implement CSRF Protection
If building a web application, implement CSRF tokens for state-changing operations (POST, PUT, DELETE).
Rotate Passwords Regularly
Rotate Passwords Regularly
Encourage users to change passwords every 90 days. Quinn supports password requirements via organization settings.
Use Environment Variables
Use Environment Variables
Never hardcode credentials. Use environment variables:
Monitor Failed Login Attempts
Monitor Failed Login Attempts
Quinn rate-limits login attempts (10/minute per IP). Monitor for suspicious activity via admin dashboard.
Error Handling
Common Authentication Errors
| Status Code | Error | Cause | Solution |
|---|---|---|---|
| 401 | Unauthorized | Missing or invalid session | Login again |
| 403 | Forbidden | Insufficient permissions | Contact admin to upgrade role |
| 429 | Too Many Requests | Rate limit exceeded | Wait 60 seconds |
Error Response Format
Advanced: Impersonation (Support)
Super admins can impersonate users to debug issues:- All requests are scoped to the impersonated user’s organization
- Audit log tracks all actions taken
- Destructive actions (delete user, delete organization) are blocked
- Session includes
isImpersonating: trueflag
Testing Authentication
Use the API playground to test authentication:Try it in the Playground
Test the login endpoint with your credentials
Troubleshooting
Session cookie not being set
Session cookie not being set
Getting 401 on every request
Getting 401 on every request
Solutions:
- Verify session cookie is being sent (check browser DevTools → Network → Cookies)
- Re-login to get fresh session
- Check if session expired (7 day limit)
Can't access admin endpoints
Can't access admin endpoints
Verify:
- Your role is
adminorsuper_admin(check/api/auth/me) - You’re accessing the correct organization
- Feature is enabled in organization settings
Next: Learn about Core Concepts or explore the API Reference.