Authentication
Authentication methods and token management for Fleet Orchestrator API
Authentication
Fleet Orchestrator uses token-based authentication. This guide covers login flows, token management, and best practices.
Authentication Flow
Login
Obtain tokens by authenticating with your credentials:
Response
| Field | Description |
|---|---|
accessToken | JWT token for API requests (short-lived) |
refreshToken | Token to obtain new access tokens (long-lived) |
expiresIn | Access token lifetime in seconds |
user | Authenticated user details |
Using Access Tokens
Include the access token in the Authorization header:
Token Refresh
When the access token expires, use the refresh token to obtain a new one:
Response
Token Expiration
| Token | Lifetime | Action When Expired |
|---|---|---|
| Access Token | 1 hour | Refresh using refresh token |
| Refresh Token | 7 days | Login again |
Auto-Login
For server-to-server integrations, you can use auto-login with a long-lived API key:
Contact support to obtain an API key for your account.
Who Am I
Verify your current authentication and get user details:
Response
User Roles
| Role | Description |
|---|---|
admin | Full access to all resources and settings |
dispatcher | Manage reservations, trips, and drivers |
viewer | Read-only access |
driver | Access to assigned trips only (driver app) |
Error Responses
Invalid Credentials
Token Expired
Invalid Token
Best Practices
- Store tokens securely - Never expose tokens in client-side code or logs
- Implement token refresh - Proactively refresh tokens before expiration
- Handle 401 errors - Automatically refresh and retry when receiving 401
- Use API keys for servers - For backend integrations, use long-lived API keys
- Scope appropriately - Create users with minimum required permissions
Two-Factor Authentication
If 2FA is enabled for your account, the login flow requires an additional step:
Step 1: Initial Login
Response (2FA Required)
Step 2: Verify OTP
This returns the standard login response with access and refresh tokens.