Puchify

Logs API

Centralized log aggregation and search.

List log entries

GET /api/v1/logs
const { data: entries } = await puchify.logs.list({
  resource_id: "svr_abc123",
  level: "error",
  from: "2026-05-28T00:00:00Z",
  to: "2026-05-29T00:00:00Z",
})
entries = puchify.logs.list(
  resource_id="svr_abc123",
  level="error",
  from="2026-05-28T00:00:00Z",
  to="2026-05-29T00:00:00Z",
)
entries, err := client.Logs.List(ctx, &puchify.LogListParams{
  ResourceID: puchify.String("svr_abc123"),
  Level:      puchify.String("error"),
  From:       puchify.String("2026-05-28T00:00:00Z"),
  To:         puchify.String("2026-05-29T00:00:00Z"),
})
puchify logs list --resource-id svr_abc123 --level error --from 2026-05-28T00:00:00Z
curl "https://api.puchify.com/api/v1/logs?resource_id=svr_abc123&level=error&from=2026-05-28T00:00:00Z&to=2026-05-29T00:00:00Z" \
  -H "Authorization: Bearer $PUCHIFY_API_KEY"

Query parameters:

ParameterTypeDescription
resource_idstringFilter by resource ID
resource_kindstringFilter by resource kind (server, data, kubernetes)
leveldebug | info | warn | error | fatalFilter by log level
querystringFull-text search query
fromstringStart timestamp (ISO 8601)
tostringEnd timestamp (ISO 8601)
cursorstringPagination cursor
limitinteger (1-1000)Results per page (default 100)
orderasc | descSort direction (default: desc)

Tail logs (streaming)

GET /api/v1/logs/tail
const stream = puchify.logs.tail({
  resource_id: "svr_abc123",
  level: "info",
})
for await (const entry of stream) {
  console.log(entry)
}
for entry in puchify.logs.tail(resource_id="svr_abc123", level="info"):
    print(entry)
stream, err := client.Logs.Tail(ctx, &puchify.LogTailParams{
  ResourceID: puchify.String("svr_abc123"),
  Level:      puchify.String("info"),
})
defer stream.Close()
for stream.Next() {
  fmt.Println(stream.Value())
}
puchify logs tail --resource-id svr_abc123
curl -N "https://api.puchify.com/api/v1/logs/tail?resource_id=svr_abc123" \
  -H "Authorization: Bearer $PUCHIFY_API_KEY"

Query parameters:

ParameterTypeDescription
resource_idstringFilter by resource ID
resource_kindstringFilter by resource kind
leveldebug | info | warn | error | fatalMinimum log level

Returns a Server-Sent Events (SSE) stream of log entries as they are written.

Get log stats

GET /api/v1/logs/stats
const { data: stats } = await puchify.logs.stats({
  resource_id: "svr_abc123",
  from: "2026-05-28T00:00:00Z",
  to: "2026-05-29T00:00:00Z",
})
stats = puchify.logs.stats(
  resource_id="svr_abc123",
  from="2026-05-28T00:00:00Z",
  to="2026-05-29T00:00:00Z",
)
stats, err := client.Logs.Stats(ctx, &puchify.LogStatsParams{
  ResourceID: puchify.String("svr_abc123"),
  From:       puchify.String("2026-05-28T00:00:00Z"),
  To:         puchify.String("2026-05-29T00:00:00Z"),
})
puchify logs stats --resource-id svr_abc123 --from 2026-05-28T00:00:00Z
curl "https://api.puchify.com/api/v1/logs/stats?resource_id=svr_abc123&from=2026-05-28T00:00:00Z&to=2026-05-29T00:00:00Z" \
  -H "Authorization: Bearer $PUCHIFY_API_KEY"

Returns volume statistics — total count per log level for the given time window.

Response shape

{
  "data": [
    {
      "id": "log_001",
      "timestamp": "2026-05-28T10:30:00.123Z",
      "resource_id": "svr_abc123",
      "resource_kind": "server",
      "level": "error",
      "message": "Connection refused on port 443",
      "source": "nginx",
      "metadata": {
        "pid": 1234,
        "host": "web-01"
      }
    }
  ],
  "meta": {
    "next_cursor": "log_050",
    "total_count": 234
  }
}

Error codes

CodeDescription
404Resource not found
422Invalid time range or malformed query

On this page