---
type: api
title: Delete a space
description: When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-delete-spaces-space-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-delete-spaces-space-id
products:
  - Kibana
---

# Delete a space

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

## Paths

- `DELETE` `/api/spaces/space/{id}`

#### Path parameters

- `id` (string) — required
  The space identifier.

## Description

When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Header parameters

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

## Responses

#### `204`

Indicates a successful call.

#### `404`

Indicates that the request failed.

## Code examples

#### Console

```console
DELETE kbn:/api/spaces/space/ID
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/spaces/space/${ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

