---
title: "Start pipeline setup"
method: POST
path: "/api/v1/pipelines/{pipelineId}/setup"
tags: ["Pipelines"]
---

# Start pipeline setup

`POST /api/v1/pipelines/{pipelineId}/setup`

## Request

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

Starts a cloud setup run for the pipeline: Khotan launches a cloud agent against the organization's repository with the intake, gives it a short-lived developer key, and merges its setup PR when every guard holds. Responds 202 with the run in status running; poll GET /api/v1/pipelines/{pipelineId}/setup to follow it. Requires an API key whose role includes developer, created by a member. Only one run may be running per organization. Pass an idempotencyKey to make retries safe.

## Path parameters

- `pipelineId` string, required

## Request body

- object
  - `name` string, required
  - `website` string, uri
  - `logo` string, uri, nullable
  - `idempotencyKey` string: Repeat a start with the same key to get the same run back instead of starting a second one.

## Response `202`

The new run, in status running.

- object
  - `run` object, nullable, required
    - `id` string, required
    - `kind` 'app_setup', required
    - `resourceKind` 'apps' | 'pipelines', required
    - `resourceId` string, required
    - `status` 'running' | 'ready' | 'needs_person' | 'failed' | 'expired', required
    - `reason` string, nullable, required
    - `pullRequestUrl` string, nullable, required
    - `liveUrl` string, nullable, required
    - `agentUrl` string, nullable, required
    - `createdAt` string, required
    - `finishedAt` string, nullable, required

## Other responses

- `400`: The request was malformed or failed validation.
- `401`: Authentication is missing or invalid.
- `403`: The caller is not permitted to perform this action.
- `404`: The resource was not found.
- `409`: Response.
- `429`: Too many requests; retry after the indicated delay.
- `503`: 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)
