Skip to main content
LogFleet uses two authentication methods depending on your use case:

JWT Token Authentication

JWT tokens are used for all user-facing operations: managing agents, viewing dashboards, configuring metrics, and accessing billing information.

Obtaining a Token

Tokens are returned when you register or log in:
Response:

Using the Token

Include the token in the Authorization header for all authenticated requests:

Token Expiration

  • Tokens expire after 24 hours by default
  • The expires_in field in the response indicates seconds until expiration
  • When a token expires, users must log in again to obtain a new token

Password Reset

If you forget your password:
1

Request Reset

A reset link will be sent to your email.
2

Reset Password

Use the token from the email to set a new password:

API Key Authentication

API keys are designed for edge agents. They provide long-lived, scoped credentials that don’t require user interaction to refresh.

Creating an API Key

Use a JWT token to create API keys:
Response:
The raw_key is only shown once at creation time. Store it securely—it cannot be retrieved later.

Available Permissions

Using API Keys

Edge agents include the API key in the X-API-Key header:

Managing API Keys

List Keys

Revoke Key

Security Best Practices

Create new API keys periodically and revoke old ones. This limits exposure if a key is compromised.
Only grant the permissions each edge agent actually needs. If an agent only sends heartbeats and metrics, don’t include edge:stream.
Never commit tokens or API keys to version control. Use environment variables or secret management systems.
Regularly review your API keys and revoke any that are no longer in use.

Error Responses

401 Unauthorized

Returned when authentication fails:
Common causes:
  • Token has expired
  • Token is malformed
  • API key has been revoked
  • Missing authentication header

403 Forbidden

Returned when authenticated but lacking permission:
Common causes:
  • API key missing required permission
  • User role doesn’t allow the operation
  • Accessing resources from another organization