---
title: "Generate an App's OAuth Client/Secret"
method: POST
path: "/smartapps/{appNameOrId}/oauth/generate"
tags: ["SmartApps"]
---

# Generate an App's OAuth Client/Secret

`POST /smartapps/{appNameOrId}/oauth/generate`

## Request

- Base URL: `https://api.smartthings.com/v1`
- URL: `https://api.smartthings.com/v1/smartapps/{appNameOrId}/oauth/generate`
- Auth: OAuth 2
  - Implicit: `https://auth-global.api.smartthings.com`
  - Scopes: `w:smartapps`
- TypeScript: <https://skmtc.dev/smartthings/apis/smartthings-api/docs/smartapps/:appNameOrId/oauth/generate/post.ts> (a function with typed inputs; its response is checked against the schema)

When an app is first created, an OAuth client/secret are automatically generated for the integration.  However,
there are times when it may be useful to re-generate a client/secret such as in cases where a secret becomes
compromised.

## Path parameters

- `appNameOrId` string, required

## Headers

- `Authorization` string, string, required

## Request body

- GenerateAppOAuthRequest
  - `clientName` string: A name given to the OAuth Client.
  - `scope` string[]: A list of SmartThings API OAuth scope identifiers that may be required to execute your integration.

## Response `200`

A response object containing the newly created OAuth Client ID/Secret and relevant details
pertaining to the OAuth client.

- GenerateAppOAuthResponse: A response object containing a new OAuth Client and its details.
  - `oauthClientDetails` AppOAuth
    - `clientName` string: A name given to the OAuth Client.
    - `scope` string[]: A list of SmartThings API OAuth scope identifiers that may be required to execute your integration.
    - `redirectUris` string[]: A list of redirect URIs for API_ONLY apps.
    - `corsDomains` string[]: A list of CORS domains.
  - `oauthClientId` string, uuid: The OAuth Client ID.
  - `oauthClientSecret` string, uuid: The OAuth Client Secret.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too many requests
- `default`: Unexpected error

## Changes

- **2026-11-07** `2788a4236800`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smartthings/apis/smartthings-api/changes/smartapps/:appNameOrId/oauth/generate/post.md)

---

[API](https://skmtc.dev/smartthings/apis/smartthings-api.md) - [All operations](https://skmtc.dev/smartthings/apis/smartthings-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartthings/apis/smartthings-api/revisions/2788a4236800?raw)
