---
type: api
title: Remove a query from a stream
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-delete-streams-name-queries-queryid
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-delete-streams-name-queries-queryid
products:
  - Kibana
---

# Remove a query from a stream

deprecated

Availability: Experimental since 9.1

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

## Paths

- `DELETE` `/api/streams/{name}/queries/{queryId}`
- `DELETE` `/s/{space_id}/api/streams/{name}/queries/{queryId}`

#### Path parameters

- `name` (string · max length: 255) — required
  The name of the stream.
- `queryId` (string · max length: 255) — required
  The identifier of the query to remove.

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Remove a query from a stream. Noop if the query is not found on the stream.

## Required authorization

- Privileges: `manage_stream`

## 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

## Request body

`application/json`

Any of:
- **object**
- **object**
- **object**

## Response

The query was removed successfully.

## Code examples

#### Console

```console
DELETE kbn:/api/streams/NAME/queries/QUERY_ID
{}
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/streams/${NAME}/queries/${QUERY_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
```

