1. Docs
  2. API Reference
  3. Register a new OAuth client

Register a new OAuth client

POST/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/oauth-clients

Registers a new confidential OAuth client in the current Environment with the given name, redirect_uris, and optional scopes (defaulting to openid profile email). Generates the client_id and a client_secret that is bcrypt-hashed at rest; the raw secret is returned in this response only and is never retrievable again. Responds 201 Created.

Authentication

Bearer TokenAuthorization

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

Requires capability oauth_clients.manageDeveloper Console

Create, edit, rotate, and delete OAuth clients. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.

Request body

application/json

namestring Required
redirect_urisstring[] Required
post_logout_redirect_urisstring[] Optional

Where this client may send someone after RP-initiated logout. Matched exactly, and separate from `redirect_uris`: receiving an authorization code and being a landing page after sign-out are different kinds of trust.

scopesstring[] Optional
backchannel_logout_uristring Optional

Where Canopy delivers a signed logout token, server to server, when a session this client issued tokens for ends. Omit it and the client is told nothing.

invite_redirect_urlstring Optional

Responses

application/json

  • dataOAuthClientCreatedResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Errors

When the request can't be completed, the response body includes a stable error code you can branch on.

403account.capability_requiredForbidden
When it happens

The signed-in user's administrator roles do not grant the capability this endpoint requires.

Remediation

Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.

Returned object

Request
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/oauth-clients" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "redirect_uris": [
      "string"
    ],
    "post_logout_redirect_uris": [
      "string"
    ],
    "scopes": [
      "string"
    ],
    "backchannel_logout_uri": "string",
    "invite_redirect_url": "string"
  }'
Response
{
  "data": {
    "id": "string",
    "client_id": "string",
    "name": "string",
    "redirect_uris": [
      "string"
    ],
    "post_logout_redirect_uris": [
      "string"
    ],
    "grant_types": [
      "string"
    ],
    "scopes": [
      "string"
    ],
    "backchannel_logout_uri": "string",
    "invite_redirect_url": "string",
    "is_active": false,
    "created_at": "2026-04-20T12:00:00.000Z",
    "client_secret": "string"
  }
}
Related endpoints
GETList OAuth clients for Application
GETActive/inactive OAuth client counts for the environment
GETGet OAuth client details
PATCHUpdate OAuth client
DELETEDelete OAuth client
POSTRotate an OAuth client's secret
Was this page helpful?

Tell us how we can improve this guide.