---
title: "update an OAuth2 Application, this includes regenerating the client secret"
method: PATCH
path: "/user/applications/oauth2/{id}"
tags: ["user"]
---

# update an OAuth2 Application, this includes regenerating the client secret

`PATCH /user/applications/oauth2/{id}`

## Path parameters

- `id` integer, required

## Request body

- CreateOAuth2ApplicationOptions — CreateOAuth2ApplicationOptions holds options to create an oauth2 application
  - `confidential_client` boolean — Whether the client is confidential
  - `name` string — The name of the OAuth2 application
  - `redirect_uris` string[] — The list of allowed redirect URIs
  - `skip_secondary_authorization` boolean — Whether to skip secondary authorization

## Response `200`

OAuth2Application

- OAuth2Application
  - `client_id` string — The client ID of the OAuth2 application
  - `client_secret` string — The client secret of the OAuth2 application
  - `confidential_client` boolean — Whether the client is confidential
  - `created` string, date-time — The timestamp when the application was created
  - `id` integer — The unique identifier of the OAuth2 application
  - `name` string — The name of the OAuth2 application
  - `redirect_uris` string[] — The list of allowed redirect URIs
  - `skip_secondary_authorization` boolean — Whether to skip secondary authorization

## Other responses

- `400` — APIError is error format response
- `404` — APINotFound is a not found empty response

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/revisions/350de506cefa/schema)
