---
title: "User logout"
description: "Use POST /auth/logout to invalidate the current authenticated session."
canonical: https://docs.ordering.co/api-reference/guides/user-logout/
---

# User logout

> **API operation:** [Open the endpoint in Scalar](https://docs.ordering.co/api-reference/#tag/auth/POST/auth/logout)

Use `POST /auth/logout` to invalidate the current authenticated session. The current public operation is `User.logout` and requires an accepted API key or bearer session.

All documented user levels can invoke logout when authenticated. A driver with assigned in-progress orders can be prevented from logging out until those orders are resolved.

To remove a push-notification token during logout, send the optional current request field `token_notification`:

```json
{
  "token_notification": "<notification-token>"
}
```

The token is a placeholder. Do not place a real notification or session token in documentation, source control, or a URL.

Legacy SDK example:

```javascript
const response = await ordering.users().logout()
```

Confirm the SDK package and version before relying on this helper. Scalar remains authoritative for the exact `POST /auth/logout` contract.

## OpenAPI reference

**Operation:** `POST /auth/logout`

**Header parameters**

| Name         | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| `User-Agent` | string | No       | —           |

**Request body fields**

| Name                 | Type | Required |
| -------------------- | ---- | -------- |
| `token_notification` | any  | No       |

**Responses**

| Code | Description                           |
| ---- | ------------------------------------- |
| 200  | OK (Envelope)                         |
| 400  | Bad Request (ErrorResponse)           |
| 401  | Unauthorized                          |
| 403  | Forbidden (ErrorResponse)             |
| 404  | Not Found                             |
| 429  | Too Many Requests (ErrorResponse)     |
| 500  | Internal Server Error (ErrorResponse) |
| 503  | Service Unavailable (ErrorResponse)   |

[Open this operation in the API reference](https://docs.ordering.co/api-reference/#tag/auth/POST/auth/logout)
