---
title: "Rotate pipeline OAuth secret"
method: POST
path: "/api/v1/pipelines/{pipelineId}/oauth/rotate"
tags: ["Pipelines"]
---

# Rotate pipeline OAuth secret

`POST /api/v1/pipelines/{pipelineId}/oauth/rotate`

## Request

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

Invalidates the current secret, injects a new one, and optionally starts a fresh deployment.

## Path parameters

- `pipelineId` string, required

## Request body

- object
  - `redeploy` boolean

## Response `200`

The rotated credentials and redeploy result.

- object
  - `upsertedKeys` string[], required
  - `failedKeys` string[], required
  - `requiresRedeploy` boolean, required
  - `outcome` 'rotated', required
  - `clientId` string, required
  - `clientSecret` string, required
  - `issuer` string, uri, required
  - `redirectUris` string[], required
  - `redeploy` object, required
    - `requested` boolean, required
    - `started` boolean, required
    - `status` 'queued' | 'building' | 'running' | 'ready' | 'failed' | 'canceled', nullable, required
    - `error` string, nullable, required

## Other responses

- `400`: The request was malformed or failed validation.
- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `409`: Response.
- `429`: Too many requests; retry after the indicated delay.

---

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