---
title: "Exports a finite snapshot of persisted log lines."
method: POST
path: "/depot.ci.v1.CIService/ExportJobAttemptLogs"
tags: ["CIService"]
---

# Exports a finite snapshot of persisted log lines.

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

## Request

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

The response is a Connect/gRPC server stream, not a raw HTTP file download. Consume it with a generated client or a decoder that understands stream framing. Read the first metadata response, then append each following chunk response to a file or writer in order. Use the Depot CLI `depot ci logs --output-file` when a shell-native file download is needed.

## Headers

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

## Request body

- DepotCiV1ExportJobAttemptLogsRequest
  - `attemptId` string: Unique identifier for the job attempt. Set exactly one of `attemptId` or `jobId`.
  - `jobId` string: Unique identifier for a CI job. Export resolves it to that job's latest attempt at stream start. Set exactly one of `attemptId` or `jobId`.
  - `format` 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_UNSPECIFIED' | 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_TEXT' | 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_JSONL': Byte format used when exporting a job attempt's persisted logs.

## Response `200`

Success

- union
  - object
    - `chunk` string, byte, required: Export file bytes, at most 256 KiB per chunk. Append chunks in stream order to reconstruct the text or JSONL export. In JSON-encoded Connect/grpc-web protocols, bytes are represented using the protocol's base64 encoding.
  - object
    - `metadata` DepotCiV1JobAttemptLogExportMetadata, required
      - `filename` string: Suggested filename for saving the export, with the extension matching the format. .txt for text or .jsonl for JSONL. The naming pattern isn't guaranteed and may change, so don't extract the attempt ID or other values from it.
      - `contentType` string: Exact media type for chunk bytes. `text/plain; charset=utf-8` for text or `application/x-ndjson; charset=utf-8` for JSONL.
      - `format` 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_UNSPECIFIED' | 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_TEXT' | 'JOB_ATTEMPT_LOG_EXPORT_FORMAT_JSONL': Byte format used when exporting a job attempt's persisted logs.

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