---
title: "Get Build Logs"
method: GET
path: "/api/v1/factory/builds/{build_id}/logs"
tags: ["builds"]
---

# Get Build Logs

`GET /api/v1/factory/builds/{build_id}/logs`

## Request

- The document declares no server URL.
- Auth: one of:
  - HTTP bearer
  - HTTP basic

Proxy the log body for a build, source-faithfully.

Fetches the log content from Build Coordinator and returns it as
``text/plain; charset=utf-8`` without modification.  No escape
stripping, no control-byte filtering, no timestamp injection.
Terminal-escape handling is the CLI consumer's responsibility.
The only hygiene applied is at the coordinator client layer: valid
UTF-8 output and a size-capped read.  No JSON envelope; the body
*is* the log.

Returns:
    200 with the log body.
    404 if the build does not exist, has no Build Coordinator
        counterpart (task_id IS NULL), or the coordinator itself
        returns 404.
    500 if an unexpected error occurs (e.g. get_build_by_id raises).
    502 if Build Coordinator is unreachable or returns a 5xx error.

## Path parameters

- `build_id` integer, required

## Response `200`

Log body

## Other responses

- `404`: Build not found or no logs available
- `422`: Unprocessable Entity
- `502`: Build Coordinator unreachable or returned an error

---

[API](https://skmtc.dev/flox/apis/flox-factory-service.md) - [All operations](https://skmtc.dev/flox/apis/flox-factory-service/llms.txt) - [OpenAPI document](https://skmtc.dev/flox/apis/flox-factory-service/revisions/a0a0401010b7?raw)
