# Sign out of the customer portal

> The portal.sessions.revoke operation: DELETE /api/v1/portal/me/session in the REST API and the portal_sessions_revoke tool in the MCP server.

Ends the signed-in customer's portal session at once; the portal also clears its cookie. Other sessions of the
customer (other browsers) keep working until they expire.

Customer portal only: the caller is the customer signed in to the brand's portal (`portal:write`).

## At a glance

- **REST:** `DELETE /api/v1/portal/me/session`
- **MCP tool:** `portal_sessions_revoke`
- **Operation ID:** `portal.sessions.revoke`
- **Scope:** Brand
- **Permission:** `portal:write`
- **Risk tier:** `write`
- **Dry run:** Not supported
- **Idempotency:** `Idempotency-Key` optional
- **Modes:** Test and live
- **Authentication:** A customer signed in to the customer portal (API keys can't call it)
- **Since:** M9

## Request

### Body

This operation takes no body.

## Response

`200 OK` with a JSON object:

| Field       | Type               | Description |
| ----------- | ------------------ | ----------- |
| `object`    | `"portal_session"` |             |
| `id`        | `psess_…` ID       |             |
| `signedOut` | `true`             |             |

## Examples

### Sign out

```http
DELETE /api/v1/portal/me/session
Authorization: Bearer or_test_…
```

Response (`200`):

```json
{
  "object": "portal_session",
  "id": "psess_01m4tx5nj8emwbyf7y9vcf48b2",
  "signedOut": true
}
```

## Errors

| Code                                                                                         | HTTP status | When                                                                                                               | What to do                                                                                                                  |
| -------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| [`livemode_not_allowed`](https://ownrecord.io/docs/reference/errors.md#livemode_not_allowed) | 403         | The portal session is in the other mode than the request.                                                          | Use test mode, or credentials for the target's mode. Developers need live access granted by an organization owner or admin. |
| [`permission_denied`](https://ownrecord.io/docs/reference/errors.md#permission_denied)       | 403         | The caller isn't a customer signed in to this brand's portal (operators and API keys use the customer operations). | 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): [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed), [`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), [`scope_required`](https://ownrecord.io/docs/reference/errors.md#scope_required), [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found), [`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), [`dry_run_not_supported`](https://ownrecord.io/docs/reference/errors.md#dry_run_not_supported), [`rate_limited`](https://ownrecord.io/docs/reference/errors.md#rate_limited), [`internal_error`](https://ownrecord.io/docs/reference/errors.md#internal_error).
