Skip to content
Skip to Content
Coder Docs

Create OAuth2 application.

POST
/api/v2/oauth2-provider/apps

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Request Body

The OAuth2 application to create.

application/json
  1. body
callback_url?string

Deprecated: send redirect_uris instead. If both are sent, callback_url must equal the first entry of redirect_uris.

icon?string
name*string
redirect_uris?array<string>

RedirectURIs is the ordered list of URIs the app may redirect to. The first entry is the primary. Required, unless the deprecated callback_url is sent instead.

scope?string

Scope is the space-separated list of scopes this app's tokens may be granted. Leave empty, or omit, for unrestricted.

Response Body

OK

application/json
  1. response
callback_url?string

Deprecated: equal to the first entry of redirect_uris. Read redirect_uris instead.

client_type?string

ClientType is "confidential" or "public".

Value in"confidential""public"
dynamically_registered?boolean

DynamicallyRegistered is true when the app registered itself through Dynamic Client Registration rather than being created by an admin.

endpoints?

Endpoints are included in the app response for easier discovery. The OAuth2 spec does not have a defined place to find these (for comparison, OIDC has a '/.well-known/openid-configuration' endpoint).

icon?string
id?string
Formatuuid
name?string
redirect_uris?array<string>

RedirectURIs are the app's registered redirect URIs, primary first.

scope?string

Scope is the space-separated list of scopes this app's tokens may be granted. Empty means unrestricted. A non-empty value with no names is a configured allowlist that grants nothing.

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/oauth2-provider/apps" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "name": "string"}'
Example Response200
{  "callback_url": "string",  "client_type": "confidential",  "dynamically_registered": true,  "endpoints": {    "authorization": "string",    "device_authorization": "string",    "token": "string",    "token_revoke": "string"  },  "icon": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "redirect_uris": [    "string"  ],  "scope": "string"}