---
title: "creates a new OAuth2 application"
method: POST
path: "/user/applications/oauth2"
tags: ["user"]
---

# creates a new OAuth2 application

`POST /user/applications/oauth2`

## 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 `201`

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

---

[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)
