Build Logs API
Endpoints for retrieving and streaming build logs.
Get Build Logs
Retrieve the complete logs for a finished or running build.
GET /v1/builds/{build_id}/logsAuthentication: User session (Bearer)
Response 200 OK
Returns the build log content as a JSON array of log entries or as plain text, depending on the Accept header.
Stream Build Logs (SSE)
Stream build logs in real-time using Server-Sent Events.
GET /v1/builds/{build_id}/logs/streamAuthentication: Stream token (query parameter)
This endpoint uses SSE (Server-Sent Events) to push log lines as they are produced by the runner. The connection stays open until the build finishes.
Usage
First, create a stream token:
bashcurl -X POST http://127.0.0.1:8787/v1/builds/{build_id}/stream-token \ -H "Authorization: Bearer <session_token>"Then connect to the SSE stream with the token:
bashcurl -N "http://127.0.0.1:8787/v1/builds/{build_id}/logs/stream?token=<stream_token>"
The stream token is short-lived and scoped to the specific build.
Create Stream Token
Generate a short-lived token for connecting to the log stream.
POST /v1/builds/{build_id}/stream-tokenAuthentication: User session (Bearer)
Response 200 OK
{
"token": "stream_token_abc123...",
"expires_at": 1738800600
}Append Build Logs (Runner)
Used by runners to append log lines during build execution.
POST /v1/runners/{runner_id}/jobs/{job_id}/logsAuthentication: Runner token (Bearer)
Request body
Log content to append. Sent as the build executes.
This endpoint is called by the runner process, not by end users.