1. Docs
  2. API Reference
  3. Update OAuth client

Update OAuth client

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

Updates an OAuth client's mutable fields (name, redirect_uris, post_logout_redirect_uris, backchannel_logout_uri, scopes, is_active, invite_redirect_url, initiate_login_uri), scoped to the current Environment. A scopes value outside openid, profile, email, org and permissions is refused with 400 (oauth.client_scope_unknown). Returns the updated client, or 404 when the client is not found in this Environment. Send If-Match with the client's version to refuse a stale write (409 version_mismatch). The secret is not rotated here.

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.

Path Parameters

accountSlugstring Required

The Account's slug. An unknown one answers 404.

appSlugstring Required

The Application's slug within the Account.

envSlugstring Required

The Environment's slug within the Application.

idstring Required

Headers

  • If-Match

    Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.

Request body

application/json

namestring Optional
redirect_urisstring[] Optional

Replaces the registered redirect URIs. At least one is required, as at creation: a client with none could never complete a sign-in.

post_logout_redirect_urisstring[] Optional

Where this client may send someone after RP-initiated logout. Matched exactly. An empty array removes every destination, which leaves logout working with nowhere to return to.

scopesstring[] Optional
is_activeboolean Optional
allowed_audiencesstring[] Optional

A machine client's audiences, replaced whole. A web client takes none (`400 oauth.web_client_audiences_invalid`).

backchannel_logout_uristring Optional

Where Canopy delivers a signed logout token when a session this client issued tokens for ends. `null` stops the notifications.

invite_redirect_urlstring Optional
initiate_login_uristring Optional

The route in your application that starts a sign-in (OpenID Connect `initiate_login_uri`): it should send the person to Canopy's `/oauth/authorize`. Canopy's hosted pages that end with nothing to return to, such as an accepted invitation or a verified email, offer it as **Sign in**. Absolute `http` or `https` URL; `null` clears it.

Responses

application/json

  • dataOAuthClientResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

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, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs.

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 PATCH "https://auth.canopy-io.com/portal/v1/accounts/value/applications/value/environments/value/oauth-clients/value" \
  -H "If-Match: "3"" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "redirect_uris": [
      "string"
    ],
    "post_logout_redirect_uris": [
      "string"
    ],
    "scopes": [
      "string"
    ],
    "is_active": false,
    "allowed_audiences": [
      "string"
    ],
    "backchannel_logout_uri": "string",
    "invite_redirect_url": "string",
    "initiate_login_uri": "string"
  }'
Response
{
  "data": {
    "id": "string",
    "client_id": "string",
    "name": "string",
    "client_kind": "web",
    "organization_node_id": "string",
    "organization_name": "string",
    "allowed_audiences": [
      "string"
    ],
    "redirect_uris": [
      "string"
    ],
    "post_logout_redirect_uris": [
      "string"
    ],
    "grant_types": [
      "string"
    ],
    "scopes": [
      "string"
    ],
    "backchannel_logout_uri": "string",
    "invite_redirect_url": "string",
    "initiate_login_uri": "string",
    "is_active": false,
    "owner": "developer",
    "last_token_at": "2026-04-20T12:00:00.000Z",
    "previous_secret_expires_at": "2026-04-20T12:00:00.000Z",
    "secret_rotated_at": "2026-04-20T12:00:00.000Z",
    "version": 0,
    "created_at": "2026-04-20T12:00:00.000Z",
    "issuer": "https://auth.yourapp.com"
  }
}
Related endpoints
GETList OAuth clients for Application
POSTRegister a new OAuth client
GETActive/inactive OAuth client counts for the environment
GETGet OAuth client details
DELETEDelete OAuth client
POSTRotate an OAuth client's secret
GETList a machine client's role assignments
POSTAssign a role to a machine client at a node
PATCHChange a machine client's assignment
DELETERemove a machine client's assignment
Was this page helpful?

Tell us how we can improve this guide.