Skip to content

The Log Management API provides endpoints to list, read, stream, search, and clear execution logs produced by Hoody agents. Use these endpoints to inspect agent output, tail logs in real time, query historical log files, and reclaim storage by removing old entries.

GET /api/v1/exec/logs/list

Returns the available log files or entries. Supports optional filtering by log type and result count.

NameInTypeRequiredDescription
typequerystringNoType query parameter
limitquerystringNoLimit query parameter

This endpoint accepts no request body.

{
"logs": [
"exec-2025-01-15-001.log",
"exec-2025-01-15-002.log",
"exec-2025-01-15-003.log"
],
"count": 3
}
const result = await client.exec.logs.list({
type: "execution",
limit: "50"
});

GET /api/v1/exec/logs/stream

Streams the contents of a log file, optionally following new lines as they are written (similar to tail -f).

NameInTypeRequiredDescription
filequerystringYesFile query parameter
followquerystringNoFollow query parameter

This endpoint accepts no request body.

{
"error": "VALIDATION_ERROR",
"code": "VALIDATION_ERROR",
"timestamp": "2025-01-15T14:32:11.482Z"
}
Error CodeTitleDescriptionResolution
VALIDATION_ERRORInvalid inputRequest parameters failed validationCheck parameter format and requirements
const stream = await client.exec.logs.stream({
file: "exec-2025-01-15-001.log",
follow: "true"
});

POST /api/v1/exec/logs/read

Reads lines from a log file with support for tailing, line limits, and text search.

NameTypeRequiredDefaultDescription
filestringNoFile
executionIdstringNoExecution Id
linesintegerNo100Lines
tailbooleanNotrueTail
searchstringNoSearch
{
"file": "exec-2025-01-15-001.log",
"executionId": "exec_8f3a2b1c9d4e5f6a",
"lines": 200,
"tail": true,
"search": "ERROR"
}
{
"file": "exec-2025-01-15-001.log",
"totalLines": 1024,
"filteredLines": 12,
"returnedLines": 12,
"lines": [
"2025-01-15T14:00:01.000Z [ERROR] Connection refused to upstream service",
"2025-01-15T14:00:02.140Z [ERROR] Retry attempt 1 failed",
"2025-01-15T14:00:03.512Z [ERROR] Retry attempt 2 failed"
],
"size": 1048576,
"modified": "2025-01-15T14:30:00.000Z"
}
const log = await client.exec.logs.read({
file: "exec-2025-01-15-001.log",
lines: 200,
tail: true,
search: "ERROR"
});

POST /api/v1/exec/logs/search

Searches across one or more log files using either a plain-text query or a regular expression.

NameTypeRequiredDefaultDescription
querystringNoQuery
regexstringNoRegex
filesarrayNoFiles
limitintegerNo1000Limit
caseSensitivebooleanNofalseCase Sensitive
{
"query": "timeout",
"files": ["exec-2025-01-15-001.log", "exec-2025-01-15-002.log"],
"limit": 500,
"caseSensitive": false
}
{
"query": "timeout",
"searchType": "text",
"filesSearched": 2,
"matchesFound": 7,
"results": [
{
"file": "exec-2025-01-15-001.log",
"line": 142,
"content": "2025-01-15T13:42:18.221Z [WARN] Request timeout after 30s",
"timestamp": "2025-01-15T13:42:18.221Z"
}
]
}
const matches = await client.exec.logs.search({
query: "timeout",
files: ["exec-2025-01-15-001.log", "exec-2025-01-15-002.log"],
limit: 500,
caseSensitive: false
});

DELETE /api/v1/exec/logs/clear

Deletes log files. Supports targeting a single file, filtering by type, removing entries older than a specified number of days, and requires an explicit confirmation flag.

NameInTypeRequiredDescription
filequerystringNoFile query parameter
typequerystringNoType query parameter
olderThanDaysquerystringNoOlderThanDays query parameter
confirmquerystringNoConfirm query parameter

This endpoint accepts no request body.

{
"deleted": 14,
"totalSize": 15728640,
"message": "Successfully deleted 14 log files (15.73 MB)"
}
const result = await client.exec.logs.clear({
olderThanDays: "30",
confirm: "true"
});