# 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.

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`):

| Field  | Type       | Required | Description                                                                  |
| ------ | ---------- | -------- | ---------------------------------------------------------------------------- |
| `id`   | `ses_…` ID | No       | End this session (`ses_…`).                                                  |
| `keep` | `ses_…` ID | No       | End every session but this one: the console passes the session you're using. |

## Response

`200 OK` with a JSON object:

| Field     | Type                   | Description              |
| --------- | ---------------------- | ------------------------ |
| `object`  | `"session_revocation"` |                          |
| `revoked` | integer (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

| Code                                                                                       | HTTP status | When                                            | What to do                                                                      |
| ------------------------------------------------------------------------------------------ | ----------- | ----------------------------------------------- | ------------------------------------------------------------------------------- |
| [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed)     | 400         | Neither or both of `id` and `keep` were passed. | Fix the fields listed in `details.issues` and send the request again.           |
| [`session_not_found`](https://ownrecord.io/docs/reference/errors.md#session_not_found)     | 404         | `id` isn't one of your active sessions.         | Reload your account page to see the sessions that are still active.             |
| [`fresh_auth_required`](https://ownrecord.io/docs/reference/errors.md#fresh_auth_required) | 403         | Your last sign-in is older than 15 minutes.     | Sign in again, then repeat the action within 15 minutes.                        |
| [`permission_denied`](https://ownrecord.io/docs/reference/errors.md#permission_denied)     | 403         | The 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](https://ownrecord.io/docs/reference.md#common-errors): [`api_version_unsupported`](https://ownrecord.io/docs/reference/errors.md#api_version_unsupported), [`invalid_json`](https://ownrecord.io/docs/reference/errors.md#invalid_json), [`unsupported_media_type`](https://ownrecord.io/docs/reference/errors.md#unsupported_media_type), [`authentication_required`](https://ownrecord.io/docs/reference/errors.md#authentication_required), [`api_key_invalid`](https://ownrecord.io/docs/reference/errors.md#api_key_invalid), [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found), [`idempotency_key_required`](https://ownrecord.io/docs/reference/errors.md#idempotency_key_required), [`idempotency_key_reused`](https://ownrecord.io/docs/reference/errors.md#idempotency_key_reused), [`idempotency_in_progress`](https://ownrecord.io/docs/reference/errors.md#idempotency_in_progress), [`rate_limited`](https://ownrecord.io/docs/reference/errors.md#rate_limited), [`internal_error`](https://ownrecord.io/docs/reference/errors.md#internal_error).
