---
title: "Edit connected app"
method: PATCH
path: "/api/oauth-authorizations/{sid}"
tags: ["oauth_authorizations"]
---

# Edit connected app

`PATCH /api/oauth-authorizations/{sid}`

## Request

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

Edit the caller's own grant without a new consent: team_scope_mode, consented_team_sids (a full replacement, non-empty under selected, each a live membership: 403 not_a_member) and permissions (a full replacement inside the client's ceiling). An empty team set or a token over the ceiling is 422 validation_failed (empty_team_scope, scope_exceeds_ceiling). Live tokens keep their frozen claims until their short TTL: revoke for an immediate cut. At least one field. 404 when not the caller's grant.

Contract:
- MCP tool `update_oauth_authorization`, registry package `mcp.id/oauth_authorizations`, mount `id.access`.
- Operation `update`, response envelope `update`.
- Flags: none.

## Path parameters

- `sid` string, required: OAuth authorization (grant) sid (id_oa_...).

## Request body

- UpdateOauthAuthorizationRequest: Request body of `update_oauth_authorization`.
  - `team_scope_mode` 'selected' | 'all_my_teams': selected = the listed workspaces; all_my_teams = every workspace of the user.
  - `consented_team_sids` string[]: FULL replacement; required and non-empty when the effective mode is selected; ignored under all_my_teams.
  - `permissions` string[]: FULL replacement; inside the client's permission ceiling.

## Response `200`

`update` success envelope.

- UpdateOauthAuthorizationResponse
  - `success` true, required
  - `operation` 'update', required
  - `item` object, required
    - `sid` string, required: Grant sid (id_oa_...).
    - `user_sid` string, required: The account that consented (us_mb_...).
    - `oauth_client_sid` string, required: The connected app or agent (id_oc_...).
    - `team_scope_mode` 'selected' | 'all_my_teams', required: selected = the listed workspaces; all_my_teams = every workspace the user is in, now and later.
    - `consented_team_sids` string[], required: The workspaces in scope (ts_tm_...); empty under all_my_teams.
    - `permissions` string[], required: What the app may do, inside the client's ceiling.
    - `status` 'active' | 'revoked', required: active = tokens can be minted from it; revoked = disconnected.
    - `last_used_at` string, nullable, required: ISO 8601 UTC of the last token minted from the grant; null = never.
    - `created_at` string, required: ISO 8601 UTC (connected since).
    - `updated_at` string, required: ISO 8601 UTC.
  - `updated_fields` string[], required
  - `previous_values` object, required
  - `kept_fields` string[]: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
  - `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)
