---
title: "Regenerate Oauth2 Client Secret"
method: POST
path: "/api/v1/oauth/clients/{client_id}/regenerate-secret"
tags: ["oauth2-server"]
---

# Regenerate Oauth2 Client Secret

`POST /api/v1/oauth/clients/{client_id}/regenerate-secret`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/oauth/clients/{client_id}/regenerate-secret`
- Auth: none declared

Regenerate OAuth2 client secret.

Issue #169: Secret regeneration feature. Issue #1752: the owner is emailed
a security notice after the commit.

WARNING: This immediately invalidates the old secret. Update all applications.

Args:
    client_id: OAuth2 client ID

Returns:
    Updated client with new client_secret (only shown once)

Example:
    POST /api/v1/oauth/clients/oauth_abc123/regenerate-secret

## Path parameters

- `client_id` string, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- OAuth2ClientWithSecretResponse: OAuth2 Client response with client secret (only on creation). ``client_secret`` is ``None`` for public clients (``token_endpoint_auth_method="none"``) per RFC 7591 §3.2.1, which forbids issuing a secret to clients that won't authenticate at the token endpoint. Confidential clients always receive a value.
  - `client_id` string, required
  - `client_name` string, required
  - `redirect_uris` string[], required
  - `grant_types` string[], required
  - `response_types` string[], required
  - `scope` string, required
  - `token_endpoint_auth_method` string, required
  - `owner_id` string, nullable, required
  - `provider` string, required
  - `created_at` string, required
  - `plaintext_secret` string, nullable
  - `is_visible` boolean, required
  - `visibility_expires_at` string, nullable
  - `client_secret` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
