API Reference
Logpathio REST API v1. Base URL: https://api.logpathio.com/v1. All requests require an API key in the x-lpi-api-key header.
Authentication
All API requests require a bearer API key. Pass it in the x-lpi-api-key HTTP header.
curl
curl https://api.logpathio.com/v1/workspaces \
-H "x-lpi-api-key: lpi_live_sk_abc123..."
Correlation Query API
Query the correlation engine to get root cause analysis for a time window and optional service filter.
GET
/v1/correlation
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from |
unix timestamp | Yes | Start of time window (seconds) |
to |
unix timestamp | Yes | End of time window (seconds) |
service |
string | No | Filter to a specific service name |
threshold |
float (0-1) | No | Minimum correlation confidence (default: 0.6) |
Response 200 OK
{
"window": {
"from": 1748700000,
"to": 1748703600
},
"root_cause": {
"service": "config-svc",
"first_anomaly_ts": 1748701440,
"confidence": 0.94,
"signal_type": "log_error_spike",
"summary": "Error rate increased 847% at 14:04:00 UTC"
},
"cascade": [
{
"service": "auth-svc",
"lag_seconds": 2,
"signal_type": "log_parse_error"
},
{
"service": "api-gateway",
"lag_seconds": 6,
"signal_type": "http_5xx_spike"
}
],
"correlated_trace_ids": [
"8f2a1b3c4d5e6f7a",
"9e3c2d4e5f6a7b8c"
]
}
Log Query API
POST
/v1/logs/query
Request body
{
"query": "service=auth-svc level=error",
"from": 1748700000,
"to": 1748703600,
"limit": 100,
"offset": 0
}
Trace Query API
GET
/v1/traces/{trace_id}
Response 200 OK
{
"trace_id": "8f2a1b3c4d5e6f7a",
"duration_ms": 2847,
"services": ["api-gateway", "auth-svc", "config-svc"],
"spans": [...],
"has_errors": true,
"root_span": {
"span_id": "a1b2c3d4e5f6",
"service": "api-gateway",
"operation": "POST /api/checkout",
"duration_ms": 2847,
"status": "error"
}
}
Webhooks
Configure webhooks to receive real-time alerts when correlation events are detected. Webhooks use HTTP POST with a JSON payload.
Webhook payload
{
"event": "correlation.detected",
"timestamp": 1748701440,
"workspace": "my-org",
"root_cause": {
"service": "config-svc",
"confidence": 0.94,
"summary": "Error rate spike — likely root cause"
},
"affected_services": ["auth-svc", "api-gateway"],
"dashboard_url": "https://app.logpathio.com/correlation/ev_abc123"
}
Webhook deliveries are retried up to 3 times with exponential backoff. Your endpoint must respond with a 2xx status within 10 seconds or the delivery will be retried.