跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 25.6.2, which is no longer the latest release. See the latest release.

creates a new OAuth2 application

POST
/user/applications/oauth2
curl --request POST \
--url https://gitea.example.com/api/v1/user/applications/oauth2 \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "confidential_client": true, "name": "example", "redirect_uris": [ "example" ], "skip_secondary_authorization": true }'

CreateOAuth2ApplicationOptions holds options to create an oauth2 application

object
confidential_client

Whether the client is confidential

boolean
name

The name of the OAuth2 application

string
redirect_uris

The list of allowed redirect URIs

Array<string>
skip_secondary_authorization

Whether to skip secondary authorization

boolean
Examplegenerated
{
"confidential_client": true,
"name": "example",
"redirect_uris": [
"example"
],
"skip_secondary_authorization": true
}

OAuth2Application

Media typeapplication/json
OAuth2Application represents an OAuth2 application.
object
client_id

The client ID of the OAuth2 application

string
client_secret

The client secret of the OAuth2 application

string
confidential_client

Whether the client is confidential

boolean
created

The timestamp when the application was created

string format: date-time
id

The unique identifier of the OAuth2 application

integer format: int64
name

The name of the OAuth2 application

string
redirect_uris

The list of allowed redirect URIs

Array<string>
skip_secondary_authorization

Whether to skip secondary authorization

boolean
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
}

APIError is error format response

Media typeapplication/json
message
string
url
string