---
type: api
title: Logout from ECE
description: Destroys the current session.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-logout
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-logout
products:
  - Elastic Cloud Enterprise
---

# Logout from ECE

## Paths

- `POST` `/users/auth/_logout`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#apikey)

## Description

Destroys the current session.

## Responses

#### `200`

The current session was successfully destroyed.

`application/json`

Type: `EmptyResponse`

#### `501`

The administrator needs to configure the authentication cluster. (code: `authc.no_authentication_cluster`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `502`

The authentication cluster failed to process the request. The response body contains details about the error. (code: `authc.authentication_cluster_error`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
POST /users/auth/_logout
```

#### curl

```curl
curl -X POST "/users/auth/_logout"
```

