---
type: api
title: Batch delete SLO instances
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-deletesloinstancesop
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-deletesloinstancesop
products:
  - Kibana
---

# Batch delete SLO instances

Authentication: required

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

## Paths

- `POST` `/api/observability/slos/_delete_instances`
- `POST` `/s/{space_id}/api/observability/slos/_delete_instances`

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

## Description

The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges.

## Required authorization

- Privileges: `slo_write`

## Header parameters

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

## Request body

`application/json`

- `list` (object[]) — required
  An array of slo id and instance id
  - `excludeRollup` (boolean) — optional
  - `instanceId` (string) — required
    The SLO instance identifier
  - `sloId` (string · min length: 8 · max length: 48 · pattern: ^[a-z0-9-_]+$) — required
    The identifier of the SLO.

## Responses

#### `204`

Successful request

#### `400`

Bad request

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
#### `401`

Unauthorized response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
#### `403`

Forbidden response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
POST kbn:/api/observability/slos/_delete_instances
{
  "list": [
    {
      "instanceId": "host-abc123",
      "sloId": "8853df00-ae2e-11ed-90af-09bb6422b258"
    },
    {
      "instanceId": "host-def456",
      "sloId": "8853df00-ae2e-11ed-90af-09bb6422b258"
    }
  ]
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/observability/slos/_delete_instances" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "list": [
      {
        "instanceId": "host-abc123",
        "sloId": "8853df00-ae2e-11ed-90af-09bb6422b258"
      },
      {
        "instanceId": "host-def456",
        "sloId": "8853df00-ae2e-11ed-90af-09bb6422b258"
      }
    ]
  }'
```

## Response examples

#### Bad request

`application/json`

```json
{
  "error": "Bad Request",
  "message": "Invalid value \u0027foo\u0027 supplied to: list/0/sloId",
  "statusCode": 400
}
```

#### Unauthorized

`application/json`

```json
{
  "error": "Unauthorized",
  "message": "security_exception: unable to authenticate user for REST request [/api/observability/slos]",
  "statusCode": 401
}
```

#### Forbidden

`application/json`

```json
{
  "error": "Forbidden",
  "message": "security_exception: action [slo_write] is unauthorized for user",
  "statusCode": 403
}
```

