---
type: api
title: Unlink an attachment from a stream
description: Unlinks an attachment from a stream. Noop if the attachment is not linked to the stream.<br/><br/>[Required authorization] Route required privileges: manage_stream.
url: https://www.elastic.co/docs/api/doc/kibana-serverless/operation/operation-delete-streams-streamname-attachments-attachmenttype-attachmentid
resource: https://www.elastic.co/docs/api/doc/kibana-serverless/operation/operation-delete-streams-streamname-attachments-attachmenttype-attachmentid
products:
  - Kibana
---

# Unlink an attachment from a stream

Authentication: required

Availability: Experimental

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

## Paths

- `DELETE` `/api/streams/{streamName}/attachments/{attachmentType}/{attachmentId}`
- `DELETE` `/s/{space_id}/api/streams/{streamName}/attachments/{attachmentType}/{attachmentId}`

#### 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.
- `streamName` (string · max length: 200) — required
  The name of the stream
- `attachmentType` (enum) — required
  The type of the attachment
  Values: `dashboard`, `rule`, `slo`
- `attachmentId` (string · max length: 256) — required
  The ID of the attachment

## Description

Unlinks an attachment from a stream. Noop if the attachment is not linked to 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**

## Response

Successfully unlinked attachment

`application/json`

## Code examples

#### Console

```console
DELETE kbn:/api/streams/STREAM_NAME/attachments/dashboard/ATTACHMENT_ID
{}
```

#### curl

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

## Response examples

#### Unlink attachment

`application/json`

```json
{
  "acknowledged": true
}
```

