Stream build logs

OpenAPI contract

Method
GET
Path
/api/v1/builds/{taskId}/logs/stream
Security
jwtBearer (bearer) OR automationKey (bearer)
Response status
200 400 401 403 404 429 500
Request and response schemas
JSON
{
  "requestBody": {},
  "responses": {
    "200": {
      "description": "Build log event stream",
      "content": {
        "text/event-stream": {
          "format": "binary",
          "type": "string"
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "404": {
      "description": "Requested build was not found",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "429": {
      "description": "HTTP rate limit or API-key NCU usage limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RateLimitError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Open an SSE stream for a build using a JWT or an nfy_ key with build:read. A project task additionally requires effective build:read capability on its project; a legacy or ad-hoc task uses its exact-owner fallback. Start from a zero-based line offset to resume after a disconnected client. Each new line is sent as a log event. Once the task reaches success, failure, or cancellation and the stream catches up, it emits done and closes.

The stream has a finite server lifetime, and clients must handle disconnects. Reconnect using the number of lines already consumed, or use the paged log endpoint to establish a safe offset. Authentication and resource authorization are checked before streaming; an absent log is not itself a terminal signal.