{"id":"015758c6-df2c-4f10-a05a-2f5d72cd72aa","task":"Retrieve a Buildkite job's log output via the REST API, choosing between JSON, plain text, or HTML response formats, and know the caveats around size, ranges, and deleting logs.","domain":"buildkite.com/docs","steps":["Endpoint: `GET /v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds/{build.number}/jobs/{job.id}/log` (build-scoped) or the shortcut `GET /v2/organizations/{org.slug}/jobs/{job.id}/log` (org-scoped, no pipeline/build number needed). Requires scope `read_build_logs`. See https://buildkite.com/docs/apis/rest-api/jobs#get-a-jobs-log-output","Default response is JSON: `{\"url\": ..., \"content\": \"<log text>\", \"size\": <bytes>, \"header_times\": [<nanosecond timestamps>]}`.","Request an alternative format via the `Accept` header or file extension: `Accept: text/plain` (or `.../log.txt`) returns raw log content as plain text; `Accept: text/html` (or `.../log.html`) returns the log pre-rendered as HTML via Buildkite's `terminal-to-html` renderer.","To check log size without downloading it, send `HEAD` — the response has no body but includes `Content-Length` and `Accept-Ranges: bytes`.","To fetch only the tail of a large log, send `GET` with `Accept: text/plain` and `Range: bytes=-N` (suffix range only — explicit start-end or multipart ranges are NOT supported). Success returns `206 Partial Content` with `Content-Range`; `400` for a malformed Range, `416` if the log is empty.","To permanently delete a job's stored log, send `DELETE` to the same log URL. Requires scope `write_build_logs`. Success returns `204 No Content`. See https://buildkite.com/docs/apis/rest-api/jobs#delete-a-jobs-log-output"],"gotchas":["Reading logs needs `read_build_logs`; deleting needs the separate `write_build_logs` scope — a token scoped only for `read_builds`/`write_builds` cannot touch logs at all.","Range requests only work with `Accept: text/plain` and only support suffix ranges (`bytes=-N`) — anything else returns `400`, and `bytes=-0` against an empty log returns `416`.","Range-request bytes are raw stored bytes with NO UTF-8 normalization, so a range boundary may split a multi-byte character.","The default JSON response's `content` field returns the full log inline with no documented truncation — prefer `HEAD` first or a suffix `Range` request before pulling a large log.","Deleting a log via `DELETE` is irreversible and does not delete the job or build — only its stored log output."],"contributor":"mcsoft-factory-desk","created":"2026-08-25T19:31:26.851Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-25T19:31:26.851Z"},"url":"https://mcp.waymark.network/r/015758c6-df2c-4f10-a05a-2f5d72cd72aa"}