---
type: api
title: "Remove a query from a stream"
description: "Remove a query from a stream. Noop if the query is not found on the stream. [Required authorization] Route required privileges: manage_stream."
url: https://www.elastic.co/elastic/docs-builder/docs/5112/api/kibana/operation/operation-delete-streams-name-queries-queryid
resource: https://www.elastic.co/elastic/docs-builder/docs/5112/api/kibana/operation/operation-delete-streams-name-queries-queryid
products:
  - Kibana
---

# Remove a query from a stream

deprecated

Authentication: required

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

- `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.
- `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

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

## Required privileges

- Privileges: `manage_stream`

## Header parameters

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

## Request body

`application/json`

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

## Responses

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 '{}'
```

