---
title: "Follows a job attempt's persisted log lines, streaming new lines while the attempt runs."
method: POST
path: "/depot.ci.v1.CIService/StreamJobAttemptLogs"
tags: ["CIService"]
---

# Follows a job attempt's persisted log lines, streaming new lines while the attempt runs.

`POST /depot.ci.v1.CIService/StreamJobAttemptLogs`

## Request

- Base URL: `https://api.depot.dev`
- URL: `https://api.depot.dev/depot.ci.v1.CIService/StreamJobAttemptLogs`
- Auth: HTTP bearer

The response is a Connect/gRPC server stream, not raw text. Consume it with a generated client or a decoder that understands stream framing. Every response reports the attempt's current status. Responses that carry a log line also include `nextCursor`.

 To resume a dropped stream, save the newest `nextCursor` and send it as `cursor` on a new request. The new stream picks up after the last line you received. The stream ends on its own once the attempt has finished, failed, or been cancelled and all persisted lines have been sent.

## Headers

- `Connect-Protocol-Version` 1, required: Define the version of the Connect protocol
- `Connect-Timeout-Ms` number: Define the timeout, in ms

## Request body

- DepotCiV1StreamJobAttemptLogsRequest
  - `attemptId` string: Unique identifier for the job attempt. Set exactly one of `attemptId` or `jobId`.
  - `cursor` string: Opaque cursor returned by a previous stream response for the same target. Omit it to stream from the first persisted line.
  - `jobId` string: Unique identifier for a CI job. The stream resolves it to that job's latest attempt. Set exactly one of `attemptId` or `jobId`.

## Response `200`

Success

- DepotCiV1StreamJobAttemptLogsResponse
  - `line` DepotCiV1LogLine
    - `stepKey` string: Depot-assigned key correlating the line with a workflow step. Stable across responses for the same step.
    - `timestampMs` union: Log timestamp as Unix epoch milliseconds.
      - integer
      - string, int64
    - `lineNumber` integer: Persisted line number within the emitting stream.
    - `stream` integer: 0 for stdout, 1 for stderr.
    - `body` string: Log line content, without a trailing newline.
    - `stepId` string: User-authored workflow step ID from the step's `id:` key. Empty when not set.
    - `stepName` string: User-authored workflow step name from the step's `name:` key. Empty when not set.
  - `nextCursor` string: Opaque cursor to resume after the emitted line. Set on responses that carry a line. Persist the newest value and send it as `cursor` on a later request.
  - `attemptStatus` string: Current state of the attempt. Can be "queued", "waiting", "running", "finished", "failed", or "cancelled".

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/depot/apis/depot-ci-api.md) - [All operations](https://skmtc.dev/depot/apis/depot-ci-api/llms.txt) - [OpenAPI document](https://skmtc.dev/depot/apis/depot-ci-api/revisions/6cf759b535b4?raw)
