Skip to main content
The LogFleet API is organized around REST. It accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and authentication.

Base URL

https://api.logfleet.io/api/v1
For local development:
http://localhost:8080/api/v1

Authentication

LogFleet uses two authentication methods:
MethodHeaderUse Case
JWT BearerAuthorization: Bearer {token}Dashboard, user operations
API KeyX-API-Key: {key}Edge agents
See the Authentication guide for details.

API Groups

Authentication

User registration, login, and password management

Agents

Manage edge agents and their configurations

API Keys

Create and manage API keys for edge agents

Streaming

On-demand log streaming from edge agents

Metric Configs

Configure log-to-metric extraction rules

Edge API

Endpoints used by edge agents (API Key auth)

Request Format

All requests should include:
Content-Type: application/json
Request bodies use JSON format:
{
  "field": "value",
  "nested": {
    "property": 123
  }
}

Response Format

Successful responses return the requested data:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "example",
  "created_at": "2024-01-15T10:00:00Z"
}
List endpoints return paginated results:
{
  "items": [...],
  "total": 100,
  "page": 1,
  "page_size": 20
}

Error Handling

Errors return appropriate HTTP status codes with details:
{
  "error": "validation_error",
  "message": "Invalid request parameters",
  "details": {
    "email": "must be a valid email address"
  }
}

Status Codes

CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request - Invalid parameters
401Unauthorized - Invalid/missing auth
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
409Conflict - Resource already exists or version conflict
429Too Many Requests - Rate limited
500Internal Server Error

Rate Limiting

API requests are rate limited per endpoint group:
Endpoint GroupRate Limit
Authentication10 req/min
Dashboard60 req/min
Agents, API Keys100 req/min
Edge API1000 req/min
Streaming10 req/min
When rate limited, the response includes headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1705312800
Retry-After: 60

Pagination

List endpoints support pagination:
ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
page_sizeinteger20Items per page (max 100)
Example:
GET /api/v1/agents?page=2&page_size=50

Timestamps

All timestamps use ISO 8601 format in UTC:
2024-01-15T10:30:00Z

UUIDs

All resource IDs are UUIDs (v4):
550e8400-e29b-41d4-a716-446655440000