---
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/4371/api/doc/kibana/v9/operation/operation-delete-streams-name-queries-queryid
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-delete-streams-name-queries-queryid
products:
  - Kibana
---

# Remove a query from a stream

deprecated

Availability: 9.1+

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

#### Path Parameters

- `name` (string · max: 255)
  The name of the stream.
- `queryId` (string · max: 255)
  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.<br/><br/>[Required authorization] Route required privileges: manage_stream.

## Request Body

`application/json`

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

## Response

The query was removed successfully.

## Code Examples

#### Console

```console
DELETE /api/streams/{name}/queries/{queryId}
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/streams/{name}/queries/{queryId}" \
  -H "kbn-xsrf: true"
```

