---
title: "Revoke session"
method: POST
path: "/api/sessions/{sid}/revoke"
tags: ["sessions"]
---

# Revoke session

`POST /api/sessions/{sid}/revoke`

## Request

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

End a session: active to revoked, the token refused from the next request here and within five minutes on the other services. The canonical delete of this entity (there is no delete tool). Idempotent: an already revoked or expired session answers result.already_revoked true.

Contract:
- MCP tool `revoke_session`, registry package `mcp.id/sessions`, 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: Session sid (id_se_...).

## Response `200`

`action` success envelope.

- RevokeSessionResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` object, nullable, required
    - `sid` string, required: Session sid (id_se_...).
    - `team_sid` string, required: The workspace the session is signed into (ts_tm_...).
    - `user_sid` string, required: The account (us_mb_...).
    - `status` 'active' | 'revoked' | 'expired', required: active = the token is accepted; revoked | expired = it is not.
    - `kind` 'login' | 'oauth', required: login = a browser or app sign-in; oauth = an installation token of a connected app or agent.
    - `oauth_client_sid` string, nullable, required: The OAuth client (id_oc_...) behind a kind oauth session; null on a login.
    - `oauth_authorization_sid` string, nullable, required: The grant (id_oa_...) the installation token was minted from; null on a login.
    - `device` string, nullable, required: The browser or client as reported at sign-in.
    - `ip_hash` string, nullable, required: A hash of the sign-in address, never the address.
    - `last_active_at` string, required: ISO 8601 UTC; bumped lazily, about every 30 s, by requests to this service.
    - `expires_at` string, required: ISO 8601 UTC; the refresh credential's end (14 days by default; about 15 minutes for an agent token).
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `is_current` boolean, required: true on the row behind the calling token.
  - `result` object, required
    - `already_revoked` boolean, required: true: the session was not active before the call.
    - `revoked_at` string, nullable, required: ISO 8601 UTC of the revoke; null when nothing changed.
  - `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)
