---
title: "GetJobAttemptLogs"
method: POST
path: "/depot.ci.v1.CIService/GetJobAttemptLogs"
tags: ["CIService"]
---

# GetJobAttemptLogs

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

## Request

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

Returns persisted log lines for a job attempt, oldest first. Identify the attempt by `attemptId`, or by `jobId` to use the job's latest attempt. Poll with `pageToken` to fetch lines persisted after a previous response.

## Headers

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

## Request body

- DepotCiV1GetJobAttemptLogsRequest
  - `attemptId` string: Unique identifier for the job attempt. Set exactly one of `attemptId` or `jobId`.
  - `pageToken` string: Token to fetch lines after a previous response. Use the `nextPageToken` value from a prior response. Leave empty to fetch from the first line.
  - `jobId` string, nullable: Unique identifier for a CI job. Resolves to the job's latest attempt; the page token pins that attempt, so later pages stay on the same attempt even if a retry creates a newer one. Set exactly one of `attemptId` or `jobId`.

## Response `200`

Success

- DepotCiV1GetJobAttemptLogsResponse
  - `lines` DepotCiV1LogLine[]: Persisted log lines for the attempt, ordered by timestamp and line number.
    - `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.
  - `nextPageToken` string: Token to fetch lines persisted after this response. Empty when the response contains no lines. While the attempt is running, poll with the newest token to tail new lines.

## 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)
