Deleting a Kibana space removes the space entry and every saved object stored inside it. Use it when a tenant, environment, or project area has been retired and dashboards, data views, alert rules, and saved searches no longer need to remain available.

Kibana manages spaces through its own Spaces API, so the request goes to the Kibana URL rather than the Elasticsearch URL. The API removes a space with DELETE /api/spaces/space/{id} and returns 204 when the call succeeds; the default space is reserved and cannot be removed.

Deletion is permanent. Export dashboards, data views, and other saved objects before the request if any content needs to move into another space or deployment, and run the final check with the same credentials that performed the deletion so authorization does not hide the result.

Steps to delete a Kibana space:

  1. Set the Kibana URL, optional base path, Spaces API path, and API key header for the target deployment.
    $ export KIBANA_URL="http://localhost:5601"
    $ export KIBANA_BASE_PATH=""
    $ export KIBANA_SPACES_API="$KIBANA_URL$KIBANA_BASE_PATH/api/spaces/space"
    $ export KIBANA_AUTH_HEADER="Authorization: ApiKey BASE64_ENCODED_API_KEY"

    Set KIBANA_BASE_PATH to a reverse-proxy prefix such as /kibana when Kibana is published below a path. Add --cacert /path/to/ca.crt to the curl commands when the HTTPS endpoint uses a private certificate authority, or replace the API key header with --user username:password when the deployment uses Basic authentication.

  2. List spaces and confirm the target id is a non-reserved entry.
    $ curl --silent --show-error --fail \
      --header "$KIBANA_AUTH_HEADER" \
      "$KIBANA_SPACES_API" | jq '[.[] | {id: .id, name: .name, _reserved: ._reserved}]'
    [
      {
        "id": "default",
        "name": "Default",
        "_reserved": true
      },
      {
        "id": "ops",
        "name": "Operations",
        "_reserved": null
      }
    ]

    A missing or null _reserved value means the space is not reserved. Do not try to delete default because Kibana treats it as the reserved default space.

  3. Fetch the target space by id and confirm it is the space you intend to remove.
    $ curl --silent --show-error --fail \
      --header "$KIBANA_AUTH_HEADER" \
      "$KIBANA_SPACES_API/ops" | jq '{id: .id, name: .name, description: .description, _reserved: ._reserved}'
    {
      "id": "ops",
      "name": "Operations",
      "description": "Operations dashboards and alerts",
      "_reserved": null
    }

    Export any dashboards, data views, saved searches, maps, or other saved objects that must survive before continuing.
    Related: How to export Kibana saved objects

  4. Delete the space by id and expect an HTTP 204 response.

    Deleting a space permanently removes all saved objects stored in that space. Verify the id and export required content before running the request.

    $ curl --silent --show-error --fail --request DELETE \
      --header "$KIBANA_AUTH_HEADER" \
      --header "kbn-xsrf: true" \
      --output /dev/null \
      --write-out "%{http_code}\n" \
      "$KIBANA_SPACES_API/ops"
    204
  5. Confirm the deleted space no longer resolves by id.
    $ curl --silent --show-error --output /dev/null \
      --write-out "%{http_code}\n" \
      --header "$KIBANA_AUTH_HEADER" \
      "$KIBANA_SPACES_API/ops"
    404

    The 404 response from the same Spaces API path confirms Kibana no longer has a space with that id.