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

# Enable an SLO

Authentication: required

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

## Paths

- `POST` `/api/observability/slos/{id}/enable`
- `POST` `/s/{space_id}/api/observability/slos/{id}/enable`

#### 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.
- `id` (string · min length: 8 · max length: 48 · pattern: ^[a-z0-9-_]+$) — required
  The identifier of the SLO.

## Description

You must have the `write` 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`

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

## 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)
#### `404`

Not found response

`application/json`

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

#### Console

```console
POST kbn:/api/observability/slos/ID/enable
{}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/observability/slos/${ID}/enable" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Response examples

#### Bad request

`application/json`

```json
{
  "error": "Bad Request",
  "message": "Invalid value \u0027foo\u0027 supplied to: id",
  "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
}
```

#### Not found

`application/json`

```json
{
  "error": "Not Found",
  "message": "SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found",
  "statusCode": 404
}
```

