---
type: api
title: Delete a Discover session
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v9/operation/operation-delete-discover-session
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v9/operation/operation-delete-discover-session
products:
  - Kibana
---

# Delete a Discover session

Authentication: required

Availability: Planned

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/discover_sessions/{id}`
- `DELETE` `/s/{space_id}/api/discover_sessions/{id}`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `id` (string) — required
  The Discover session ID, as returned by the create or search endpoints.

## Description

Permanently deletes a Discover session by ID.

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Responses

#### `204`

Deleted

#### `403`

Forbidden

#### `404`

Not found

#### `500`

Internal server error

## Code examples

#### Console

```console
DELETE kbn:/api/discover_sessions/web-log-requests
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/discover_sessions/web-log-requests" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "elastic-api-version: 2023-10-31" \
  -H "kbn-xsrf: true"
```

