update an OAuth2 Application, this includes regenerating the client secret
const url = 'https://gitea.com/api/v1/user/applications/oauth2/1';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"confidential_client":true,"name":"example","redirect_uris":["example"],"skip_secondary_authorization":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://gitea.com/api/v1/user/applications/oauth2/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "confidential_client": true, "name": "example", "redirect_uris": [ "example" ], "skip_secondary_authorization": true }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Application to be updated
Request Body
Section titled “Request Body”CreateOAuth2ApplicationOptions holds options to create an oauth2 application
object
Whether the client is confidential
The name of the OAuth2 application
The list of allowed redirect URIs
Whether to skip secondary authorization
Examplegenerated
{ "confidential_client": true, "name": "example", "redirect_uris": [ "example" ], "skip_secondary_authorization": true}CreateOAuth2ApplicationOptions holds options to create an oauth2 application
object
Whether the client is confidential
The name of the OAuth2 application
The list of allowed redirect URIs
Whether to skip secondary authorization
Responses
Section titled “Responses”OAuth2Application
object
The client ID of the OAuth2 application
The client secret of the OAuth2 application
Whether the client is confidential
The timestamp when the application was created
The unique identifier of the OAuth2 application
The name of the OAuth2 application
The list of allowed redirect URIs
Whether to skip secondary authorization
Examplegenerated
{ "client_id": "example", "client_secret": "example", "confidential_client": true, "created": "2026-04-15T12:00:00Z", "id": 1, "name": "example", "redirect_uris": [ "example" ], "skip_secondary_authorization": true}APINotFound is a not found empty response