Install with curl:
curl -X POST https://api.logflow.io/v1/install
All API requests require authentication using an API key. Include your key in the Authorization header.
Verify your API key is valid.
curl -X GET https://api.logflow.io/v1/auth/verify \ -H "Authorization: Bearer YOUR_API_KEY"
{
"valid": true,
"expires_at": "2023-12-31T23:59:59Z"
}
Ingest new log entries into the system.
{
"source": "web-server-1",
"level": "error",
"message": "Database connection failed",
"timestamp": "2023-06-15T14:30:00Z",
"metadata": {
"service": "auth-service",
"ip": "192.168.1.1"
}
}
curl -X POST https://api.logflow.io/v1/logs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source":"web-server-1","level":"error","message":"Database connection failed"}'
{
"id": "log_123456789",
"status": "processed"
}
Query logs with filters and pagination.
level string
Filter by log level (error, warning, info)
source string
Filter by source identifier
limit integer
Number of results per page (default: 50)
page integer
Page number (default: 1)
curl -X GET "https://api.logflow.io/v1/logs?level=error&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "log_123456789",
"source": "web-server-1",
"level": "error",
"message": "Database connection failed",
"timestamp": "2023-06-15T14:30:00Z",
"metadata": {
"service": "auth-service"
}
}
],
"total": 1245,
"page": 1,
"pages": 125
}
List all configured log sources.
curl -X GET https://api.logflow.io/v1/sources \ -H "Authorization: Bearer YOUR_API_KEY"
{
"sources": [
{
"id": "src_123456789",
"name": "web-server-1",
"type": "file",
"path": "/var/log/nginx/access.log",
"status": "active",
"last_activity": "2023-06-15T14:32:00Z"
}
]
}
Create a new alert rule.
{
"name": "High Error Rate",
"condition": "error_count > 10",
"time_window": "5m",
"actions": [
{
"type": "webhook",
"target": "https://hooks.slack.com/services/..."
}
]
}
curl -X POST https://api.logflow.io/v1/alerts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"High Error Rate","condition":"error_count > 10"}'
{
"id": "alert_123456789",
"status": "active"
}
Get system statistics.
curl -X GET https://api.logflow.io/v1/stats \ -H "Authorization: Bearer YOUR_API_KEY"
{
"logs": {
"total": 24568,
"errors": 1245,
"warnings": 876,
"info": 22447
},
"sources": {
"active": 19,
"inactive": 2
},
"storage": {
"used": "45GB",
"available": "155GB"
}
}