---
title: "Download a pipeline's source"
method: GET
path: "/api/v1/pipelines/{pipelineId}/source"
tags: ["Pipelines"]
---

# Download a pipeline's source

`GET /api/v1/pipelines/{pipelineId}/source`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/pipelines/{pipelineId}/source`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Returns the pipeline's source files (its subdirectory inside the org mono-root repo) as a JSON listing with paths rooted at the pipeline. Text files are returned as utf-8, binary files as base64. Responds 409 source_not_ready when the pipeline has no repo yet, and 413 source_too_large for sources past the inline download limit.

## Path parameters

- `pipelineId` string, required

## Response `200`

The pipeline's source files.

- object
  - `subdirectory` string, nullable, required
  - `files` object[], required
    - `path` string, required
    - `encoding` 'utf-8' | 'base64', required
    - `content` string, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `409`: The pipeline exists but its source repository is not ready yet.
- `413`: The source is too large to download as a single response.
- `429`: Too many requests; retry after the indicated delay.
- `502`: Response.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
