Logs API
Centralized log aggregation and search.
List log entries
GET /api/v1/logsconst { 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:00Zcurl "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:
| Parameter | Type | Description |
|---|---|---|
resource_id | string | Filter by resource ID |
resource_kind | string | Filter by resource kind (server, data, kubernetes) |
level | debug | info | warn | error | fatal | Filter by log level |
query | string | Full-text search query |
from | string | Start timestamp (ISO 8601) |
to | string | End timestamp (ISO 8601) |
cursor | string | Pagination cursor |
limit | integer (1-1000) | Results per page (default 100) |
order | asc | desc | Sort direction (default: desc) |
Tail logs (streaming)
GET /api/v1/logs/tailconst 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_abc123curl -N "https://api.puchify.com/api/v1/logs/tail?resource_id=svr_abc123" \
-H "Authorization: Bearer $PUCHIFY_API_KEY"Query parameters:
| Parameter | Type | Description |
|---|---|---|
resource_id | string | Filter by resource ID |
resource_kind | string | Filter by resource kind |
level | debug | info | warn | error | fatal | Minimum log level |
Returns a Server-Sent Events (SSE) stream of log entries as they are written.
Get log stats
GET /api/v1/logs/statsconst { 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:00Zcurl "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
| Code | Description |
|---|---|
404 | Resource not found |
422 | Invalid time range or malformed query |