API Reference

Log Insights Endpoint

Query log entries by category, severity, time window. Subscribe to log patterns.

GET /api/v1/servers/:id/logs

List individual log entries. Scope: read:logs.

Filter params:

  • severity=ERROR|WARNING|FATAL|PANIC|...
  • category=connection_auth|query_error|lock_timeout|autovacuum|...
  • from + to in ISO-8601
  • q — substring match on the message (case-insensitive)
  • page, limit
{
  "data": [
    {
      "id": "log_abc123",
      "server_id": 4,
      "original_time": "2026-04-25T10:13:45.234Z",
      "severity": "ERROR",
      "category": "query_error",
      "user": "app",
      "database": "production",
      "message": "duplicate key value violates unique constraint \"orders_pkey\"",
      "metadata": { "sql_state": "23505", "table": "orders" }
    }
  ]
}

GET /api/v1/servers/:id/logs/patterns

Aggregated patterns. Similar messages get grouped by fingerprint, so "duplicate key on orders_pkey" 47 times shows as one pattern with count 47, not 47 entries you have to scroll through. Scope: read:logs.

{
  "data": [
    {
      "pattern_id": "pat_xyz",
      "fingerprint": "duplicate key value violates unique constraint \"<table>_pkey\"",
      "count_24h": 47,
      "first_seen": "2026-04-23T08:00:00Z",
      "last_seen":  "2026-04-25T10:13:45Z",
      "severity": "ERROR",
      "trend": "rising"
    }
  ]
}

Trend is one of rising, steady, falling, computed against the previous-window count. The "rising" set is what you usually want to look at — fresh problems, not chronic ones.