---
title: "Disable OAuth client"
method: POST
path: "/api/oauth-clients/{sid}/disable"
tags: ["oauth_clients"]
---

# Disable OAuth client

`POST /api/oauth-clients/{sid}/disable`

## Request

- Base URL: `https://beta.getsales.io/id/v1`
- URL: `https://beta.getsales.io/id/v1/api/oauth-clients/{sid}/disable`
- Auth: HTTP bearer and API key in header `Team-SID`

Switch a client off: status disabled, its grants and the installation tokens it issued revoked at once (result.revoked_sessions_count), the flow refuses it until enable_oauth_client. The reversible cut; delete_oauth_client is the final one. Idempotent: already_disabled true the second time.

Contract:
- MCP tool `disable_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
- Operation `action`, response envelope `action`.
- Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.

## Path parameters

- `sid` string, required: OAuth client sid (id_oc_...).

## Response `200`

`action` success envelope.

- DisableOauthClientResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, required
    - `sid` string, required: OAuth client sid (id_oc_...).
    - `team_sid` string, nullable, required: The owning workspace (ts_tm_...); null = a platform client.
    - `name` string, required: The application's name as the consent screen shows it.
    - `client_id` string, required: The public identifier the app presents at /oauth/authorize.
    - `redirect_uris` string[], required: The exact-match https allow-list of callback URLs.
    - `grant_types` string[], required: authorization_code and refresh_token.
    - `permissions` string[], required: The ceiling: the most a grant through this client may hold.
    - `is_confidential` boolean, required: true = a confidential client with a secret; false = public, PKCE only.
    - `registration_kind` 'manual' | 'dynamic', required: manual = registered here; dynamic = registered by the app itself (RFC 7591).
    - `actor_kind` 'agent' | 'integration', nullable, required: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
    - `status` 'active' | 'disabled', required: disabled = its grants and tokens are revoked, the flow refuses it.
    - `created_by` object, required: Who registered the client.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `deleted_at` string, nullable, required: ISO 8601 UTC; null = live.
    - `client_secret` string, nullable: The secret of a confidential client, shown ONCE at create; never on a read.
  - `result` object, required
    - `revoked_sessions_count` integer, required: Installation tokens cut by this call.
    - `already_disabled` boolean, required: true: the client was disabled before the call.
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
    - `actor_type` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-id/revisions/95e48541fe85?raw)
