Authentication
DOLU.ai API uses JWT (JSON Web Token) based authentication.
Login
http
POST /api/v1/auth/loginBody:
json
{
"email": "[email protected]",
"password": "your-password"
}Response:
json
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "user-uuid",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"role": "OWNER"
}
}Using the Token
Include the token in all API requests:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...Refresh Token
http
POST /api/v1/auth/refreshjson
{
"refresh_token": "eyJhbGciOiJIUzI1NiIs..."
}Token Expiration
- Access token: 24 hours
- Refresh token: 30 days
Roles
| Role | Description |
|---|---|
| SUPER_ADMIN | Platform administrator |
| OWNER | Tenant owner |
| ADMIN | Tenant administrator |
| AGENT | Customer service agent |
| VIEWER | Read-only access |
