---
title: "Create OAuth2 application secret."
method: POST
path: "/api/v2/oauth2-provider/apps/{app}/secrets"
tags: ["Enterprise"]
---

# Create OAuth2 application secret.

`POST /api/v2/oauth2-provider/apps/{app}/secrets`

## Path parameters

- `app` string, required

## Response `200`

OK

- CodersdkOAuth2ProviderAppSecretFull[]
  - `client_secret_full` string
  - `id` string, uuid

## Other responses

- `400` — Public clients cannot have secrets

## Changes

- **2026-09-01** `2baa2f18379f` — 1 info
  - added the non-success response with the status `400`

[Change history](https://skmtc.dev/coder/apis/coder-api/changes/api/v2/oauth2-provider/apps/:app/secrets/post.md)

---

[API](https://skmtc.dev/coder/apis/coder-api.md) · [All operations](https://skmtc.dev/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coder/coder-api/revisions/d139791f7ba3/schema)
