---
title: "Revoke gtm connection"
method: POST
path: "/api/gtm-connections/{sid}/revoke"
tags: ["gtm_connections"]
---

# Revoke gtm connection

`POST /api/gtm-connections/{sid}/revoke`

## Request

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

Disconnect a linked gtm-api workspace (scope workspace, the default) or the whole consent it came from (scope consent: every sibling row of the same grant). The sender profiles that ran on it read disconnected, their work holds; nothing is deleted. The managed row is platform-owned and refuses (409).

Contract:
- MCP tool `revoke_gtm_connection`, registry package `mcp.id/gtm_connections`, mount `id.identity`.
- 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: Gtm connection sid (gt_cn_...).

## Request body

- RevokeGtmConnectionRequest: Request body of `revoke_gtm_connection`.
  - `scope` string: workspace (default: this row alone) or consent (every row of the same gtm grant).

## Response `200`

`action` success envelope.

- RevokeGtmConnectionResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, required
    - `sid` string, required: Connection sid (gt_cn_...).
    - `team_sid` string, required: The getsales workspace (ts_tm_...).
    - `mode` string, required: managed = the GetSales Managed Workspace the platform runs for the team; linked = a person's own gtm-api workspace, one row per consent.
    - `status` string, required: active | error (a token or provisioning failure that outlived its retries, see error_reason) | revoked.
    - `gtm_team_sid` string, nullable, required: The gtm-api workspace behind the row; several rows on one workspace (one per consenting member) render as one.
    - `label` string, nullable, required: The gtm workspace's name (GetSales Managed Workspace for the managed row).
    - `error_reason` string, nullable, required: Why the row is in error (not_a_member, linked_credential_unreadable, ...); null otherwise.
    - `gtm_user_email` string, nullable, required: Who connected a linked workspace (the consenting gtm user); null on the managed row.
    - `account_sids` string[], required: The gtm account sids the team's sender profiles use through this row, as unibox last reported them.
    - `linked_at` string, nullable, required: ISO 8601 UTC; when the consent completed; null on the managed row.
    - `created_at` string, nullable, required: ISO 8601 UTC.
  - `result` object, required
    - `revoked_connection_sids` string[], required: The rows the call revoked (several under scope consent).
  - `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)
