TaskLogs API
Query task run information and the message list, and read task messages in real time over SSE.
All three endpoints are user_only: use a grape_ API key or a web JWT; tk_ session tokens return 403.
Ownership checks are shared by all three endpoints. Only the task owner, the repository host, or an administrator can read; all other callers get 403 TASK_LOG_FORBIDDEN. A missing task returns 404.
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET |
/api/task-logs/{task_id}/info |
Task run information |
GET |
/api/task-logs/{task_id}/messages |
Message list |
GET |
/api/task-logs/{task_id}/stream |
Real-time messages over SSE |
For general authentication, see Authentication and credentials.
GET /api/task-logs/{task_id}/info
Returns task run information and the list of files written.
Key response fields
{
"agent_name": "coding",
"agent_version": "",
"device_name": "<worker>",
"status": "completed",
"prompt_full_length": 1234,
"wrote_files": [
{"path": "src/app.py", "bytes": 100, "tool": "write", "seq": 12, "first_seen_at": "..."}
]
}
wrote_files comes from the input of the write/patch tools and does not scan the workspace; it returns an empty array when nothing was written.
GET /api/task-logs/{task_id}/messages
Reads messages by cursor, up to 5000 per request.
Query
| Parameter | Description |
|---|---|
since |
Optional, monotonically increasing seq, defaults to 0 |
Response
[
{
"seq": 1,
"type": "tool_use",
"tool": "read",
"content": "",
"input": {},
"output": "",
"created_at": "2026-01-01T00:00:00Z"
}
]
Common type values: step_start, step_finish, tool_use, tool_finish, tool_result, text, reasoning, error, log, task:retry, done.
done is only persisted and is not pushed over SSE.
GET /api/task-logs/{task_id}/stream
Reads task messages over SSE.
Request header
Accept: text/event-stream
Query
| Parameter | Description |
|---|---|
since |
Optional, incremental cursor |
Event format
data: {"type":"text","seq":2,"content":"..."}
data: {"type":"done"}
After about 15 seconds idle, the server sends : keepalive. After a disconnect, reconnect from the last seq.
Common errors
| Status | Cause |
|---|---|
| 403 | Not the task owner or a repository administrator, or a tk_ credential was used |
| 404 | The task does not exist |
| 401 | Unauthenticated or an invalid key |
Related
Tasks API | Events API | Authentication and credentials | Error code dictionary