---
title: "Rotate an OAuth client secret"
method: POST
path: "/api/v1/platform/oauth/clients/{id}/rotate-secret"
tags: ["oauth"]
---

# Rotate an OAuth client secret

`POST /api/v1/platform/oauth/clients/{id}/rotate-secret`

## Request

- Base URL: `https://api.smith.langchain.com`
- URL: `https://api.smith.langchain.com/api/v1/platform/oauth/clients/{id}/rotate-secret`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-Tenant-Id`
  - HTTP bearer

Generates a new client secret for a confidential client, invalidating the previous one. The new secret is shown only once.

## Path parameters

- `id` string, required

## Response `200`

OK

- OauthOAuthClientCredentialsResponse
  - `client` OauthOAuthClientView
    - `allowed_scopes` string[]
    - `client_id` string
    - `client_name` string
    - `client_type` string
    - `client_uri` string
    - `created_at` string
    - `disabled` boolean
    - `grant_types` string[]
    - `id` string
    - `logo_uri` string
    - `policy_uri` string
    - `redirect_uris` string[]
    - `tos_uri` string
    - `updated_at` string
  - `client_secret` string

## Other responses

- `400`: Bad Request
- `404`: Not Found

## Changes

- **2026-10-16** `1a8ee9358d81`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/platform/oauth/clients/:id/rotate-secret/post.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/7a01c01f75e8?raw)
