Skip to content

Sign out of your other sessions

The users.sessions.revoke operation: POST /api/v1/users/me/sessions/revoke in the REST API and the users_sessions_revoke tool in the MCP server.

POST/api/v1/users/me/sessions/revoke

Ends one of your console sessions (id), or every session except one (keep: the console passes the session you're using, so this is "sign out everywhere else"). The browsers of the ended sessions are signed out at their next request. Your sign-in activity shows the change.

Who can call it: the signed-in user, for their own sessions, with a sign-in in the last 15 minutes.

At a glance

  • REST: POST /api/v1/users/me/sessions/revoke
  • MCP tool: users_sessions_revoke
  • Operation ID: users.sessions.revoke
  • Scope: Platform
  • Permission: account:write
  • Risk tier: security
  • Dry run: Supported (send Ownrecord-Dry-Run: true)
  • Idempotency: Idempotency-Key required
  • Modes: Test and live
  • Authentication: API key with the account:write scope
  • Fresh sign-in: In the console, a sign-in within the last 15 minutes
  • Since: M13

Request

Body

A JSON object (Content-Type: application/json):

FieldTypeRequiredDescription
idses_… IDNoEnd this session (ses_…).
keepses_… IDNoEnd every session but this one: the console passes the session you're using.

Response

200 OK with a JSON object:

FieldTypeDescription
object"session_revocation"
revokedinteger (at least 0)How many sessions ended.

Examples

Sign out everywhere else

HTTP
POST /api/v1/users/me/sessions/revoke
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14
Content-Type: application/json

{
  "keep": "ses_01m4tx5nj8emwbyf7y9vcf47xc"
}

Response (200):

JSON
{
  "object": "session_revocation",
  "revoked": 2
}

End one session

HTTP
POST /api/v1/users/me/sessions/revoke
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14
Content-Type: application/json

{
  "id": "ses_01m4tx5nj8emwbyf7y9vcf47xd"
}

Response (200):

JSON
{
  "object": "session_revocation",
  "revoked": 1
}

Errors

CodeHTTP statusWhenWhat to do
validation_failed400Neither or both of id and keep were passed.Fix the fields listed in details.issues and send the request again.
session_not_found404id isn't one of your active sessions.Reload your account page to see the sessions that are still active.
fresh_auth_required403Your last sign-in is older than 15 minutes.Sign in again, then repeat the action within 15 minutes.
permission_denied403The caller isn't a signed-in user.Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, resource_not_found, idempotency_key_required, idempotency_key_reused, idempotency_in_progress, rate_limited, internal_error.